Python package for the analysis and visualisation of finite-difference fields.

Overview

discretisedfield

Marijan Beg1,2, Martin Lang2, Samuel Holt3, Ryan A. Pepper4, Hans Fangohr2,5,6

1 Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK
2 Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, UK
3 Department of Physics, University of Warwick, Coventry CV4 7AL, UK
4 Research Software Group, University of Birmingham, Birmingham B15 2TT, UK
5 Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany
6 Center for Free-Electron Laser Science, Luruper Chaussee 149, 22761 Hamburg, Germany

Description Badge
Tests Build status
conda
Releases PyPI version
Anaconda-Server Badge
Coverage codecov
Documentation Documentation
YouTube YouTube
Binder Binder
Platforms Platforms
Downloads Downloads
License License
DOI DOI

About

discretisedfield is a Python package, integrated with Jupyter, providing:

  • definition of finite-difference regions, meshes, lines, and fields,

  • analysis of finite-difference fields,

  • visualisation using matplotlib and k3d, and

  • manipulation of different file types (OVF, VTK, and HDF5).

It is available on Windows, MacOS, and Linux. It requires Python 3.8+.

Documentation

APIs and tutorials are available in the documentation. To access the documentation, use the badge in the table above.

Installation, testing, and upgrade

We recommend installation using conda package manager. Instructions can be found in the documentation.

Binder

This package can be used in the cloud via Binder. To access Binder, use the badge in the table above.

YouTube

YouTube video tutorials are available on the Ubermag channel.

Support

If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in ubermag/help repository.

Contributions

All contributions are welcome, however small they are. If you would like to contribute, please fork the repository and create a pull request. If you are not sure how to contribute, please contact us by raising an issue in ubermag/help repository, and we are going to help you get started and assist you on the way.

Contributors:

License

Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the LICENSE file.

How to cite

  1. M. Beg, M. Lang, and H. Fangohr. Ubermag: Towards more effective micromagnetic workflows. IEEE Transactions on Magnetics (2021).

  2. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. AIP Advances 7, 56025 (2017).

  3. Marijan Beg, Martin Lang, Samuel Holt, Ryan A. Pepper, Hans Fangohr. discretisedfield: Python package for the analysis and visualisation of finite-difference fields. DOI: 10.5281/zenodo.3539461 (2021).

Acknowledgements

  • OpenDreamKit – Horizon 2020 European Research Infrastructure project (676541)

  • EPSRC Programme Grant on Skyrmionics (EP/N032128/1)

Comments
  • Add to_xarray as field method

    Add to_xarray as field method

    Adding to_xarray method for Field object which returns field value as an xarray.DataArray.

    1. Typically, the returned DataArray has four dimensions, namely x, y, z, and comp. The first three corresponds to geometry while the fourth dimension corresponds to the components of field. comp dimension has field.components as co-ordinates.
    2. If the Field object is a scalar field, the comp dimension is 'squeezed' and the DataArray has only three dimensions corresponding to the geometry.
    3. Instead of giving fourth dimension (i.e. comp) the name of the field, the name is assigned to the DataArray itself. The default name is 'field', but it can be changed with name parameter.
    4. The units of the field can be set with units parameter. Units of geometry dimensions are set to mesh.attributes['unit'] if the attribute exists, otherwise set to 'm' (meter).
    opened by swapneelap 16
  • Rewrite ovf reading routine

    Rewrite ovf reading routine

    Execution times for 1M cells:

    • Reading
    mode   old    new   speedup
    ==== ======= ====== =======
    bin4 1730 ms  21 ms   82
    bin8 1860 ms  36 ms   52
    text 4920 ms 401 ms   12
    
    • Writing
    mode    old    new   speedup
    ==== ======== ====== =======
    bin4 63000 ms  56 ms   1125
    bin8 64000 ms  84 ms    762
    text 69000 ms 4510 ms    15
    

    Filesizes are

    • 2.9M for bin4
    • 5.8M for bin8
    • 15M for txt
    opened by lang-m 13
  • New initialisation method when passin a `df.Field` using the new xarray functionality.

    New initialisation method when passin a `df.Field` using the new xarray functionality.

    Test

    • field with mesh.n = (100, 100, 10)
    • creation of a new field with mesh.n = (10, 10, 10) and passing the old field to value

    Performance improvement:

    • old implementation (using that the field is callable): ~ 6.5 s
    • new implementation (interpolation done by xarray): ~ 5 ms

    @swapneelap This is probably the first use case for your new method.

    opened by lang-m 10
  • Refactor region

    Refactor region

    @lang-m I've made the initial critical changes we discussed and added tests.

    There are two main issues that I have at the moment that it would be good for you to look at if you have time:

    • [x] Typesystem - as I am not familiar with the type system I've not too sure how to do the correct types for things like units and pmin etc. this is causing some errors in the tests. e.g. allowing complex numbers
    • [x] html representation - this is causing some tests to fail now that I have changed the repr to include pmin and pmax rather than p1 and p2. I don't know all the html code off of the top of my head so I'm hoping it will be a quicker fix for you but let me know if not.
    opened by samjrholt 8
  • On the value of discretisedfield

    On the value of discretisedfield

    Dear Ubermag team, I encountered a problem in simulating a multilayer structure. I don't know what it means to define a three-dimensional value in field. I don't know if I rely on this value and norm=Ms to determine the initial magnetic moment distribution of this material. There is a non-magnetic layer in the multilayer structure that I simulate. How should I define its value for this non-magnetic region? I define the value of field through the following figure function, but when I am creating field, the program reports an error. How can I solve this problem to achieve the desired results? image image

    opened by code-whale 8
  • Mumax view

    Mumax view

    Hi there, Have you considered integrating mumax-view as a tool to visualize 3D fields ? Compared to k3d, it is faster as it is compiled to wasm and has better shaders out of the box. I'm not sure if it's possible to embed it as a notebook widget in a similar way to k3d. Also it would require a few changes to be called through python. I doubt this would be an easy task but k3d can be insanely slow even on top-end workstations ( single-threaded js can only go so far ). I also think mumax-view is a beautifully written software that deserves more attention and it might shine as part of the Ubermag framework.

    opened by MathieuMoalic 7
  • Representation strings.

    Representation strings.

    After merging #86 we have to review __repr__ for Region, Mesh, Field, and FieldRotator. Representation strings are difficult to read because of bad formatting and relatively much information.

    opened by lang-m 5
  • Method returning vector field component as a scalar field

    Method returning vector field component as a scalar field

    Probably the most convenient way for accessing individual components of a vector field is to have a method which returns a scalar field. The question is how this method should be named and called. Maybe

    field.component("x")
    

    Also, we can allow the argument to be 0, 1, 2

    enhancement question 
    opened by marijanbeg 5
  • Copy method in Field class

    Copy method in Field class

    Should Field class be able to set its value with another field like:

    f1 = Field(mesh, dim=3, value=(0, 0, 1))
    f2 = Field(mesh, dim=3)
    
    f2.value = f1
    

    Or f2.value = f1.value is already sufficient?

    enhancement question interface 
    opened by marijanbeg 5
  • Refactor field: vdims

    Refactor field: vdims

    • renamed: dim -> nvdim
    • renamed: components -> vdims
    • removed: coordinate_field
    • removed: typesystem decorator

    Todo

    • [x] check doctests
    • [x] update docstrings
    opened by lang-m 4
  • Automatically determine dtype for array_like inputs.

    Automatically determine dtype for array_like inputs.

    Simplifies array creation and mathematical operations with fields.

    This had been implemented previously but I had initially removed it when rewriting the as_array function.

    Determining the array for callable or dict for value is more complex and therefore not anymore done automatically. Instead, the numpy default (np.float64) is used by default. Furthermore, these types of value only occur during creation by the user where a different dtype can be easily specified (so we don't have any issues with wrong data types during operations on fields).

    opened by lang-m 4
  • Refactor `mesh.allclose` method

    Refactor `mesh.allclose` method

    At present the use of atol and rtol in the method is a bit confusing. Moreover, the method fails if one of the points in the two meshes that are equal to or close to 0.0. We can refactor it to take into account the exponent of the cell dimensions, for example.

    opened by swapneelap 0
Releases(0.65.0)
Owner
ubermag
Computational magnetism tools
ubermag
Create HTML profiling reports from pandas DataFrame objects

Pandas Profiling Documentation | Slack | Stack Overflow Generates profile reports from a pandas DataFrame. The pandas df.describe() function is great

10k Jan 01, 2023
An interactive dashboard for visualisation, integration and classification of data using Active Learning.

AstronomicAL An interactive dashboard for visualisation, integration and classification of data using Active Learning. AstronomicAL is a human-in-the-

45 Nov 28, 2022
Visualizing weather changes across the world using third party APIs and Python.

WEATHER FORECASTING ACROSS THE WORLD Overview Python scripts were created to visualize the weather for over 500 cities across the world at varying di

G Johnson 0 Jun 12, 2021
Streaming pivot visualization via WebAssembly

Perspective is an interactive visualization component for large, real-time datasets. Originally developed for J.P. Morgan's trading business, Perspect

The Fintech Open Source Foundation (www.finos.org) 5.1k Dec 27, 2022
NW 2022 Hackathon Project by Angelique Clara Hanzel, Aryan Sonik, Damien Fung, Ramit Brata Biswas

Spiral-Data-Visualizer NW 2022 Hackathon Project by Angelique Clara Hanzell, Aryan Sonik, Damien Fung, Ramit Brata Biswas Description This project vis

Damien Fung 2 Jan 16, 2022
Functions for easily making publication-quality figures with matplotlib.

Data-viz utils 📈 Functions for data visualization in matplotlib 📚 API Can be installed using pip install dvu and then imported with import dvu. You

Chandan Singh 16 Sep 15, 2022
A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.

Visdom A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Python. Overview Concepts Setup Usage API To

FOSSASIA 9.4k Jan 07, 2023
Interactive chemical viewer for 2D structures of small molecules

👀 mols2grid mols2grid is an interactive chemical viewer for 2D structures of small molecules, based on RDKit. ➡️ Try the demo notebook on Google Cola

Cédric Bouysset 154 Dec 26, 2022
A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

Pooya 1 Dec 02, 2021
WhatsApp Chat Analyzer is a WebApp and it can be used by anyone to analyze their chat. 😄

WhatsApp-Chat-Analyzer You can view the working project here. WhatsApp chat Analyzer is a WebApp where anyone either tech or non-tech person can analy

Prem Chandra Singh 26 Nov 02, 2022
This is a super simple visualization toolbox (script) for transformer attention visualization ✌

Trans_attention_vis This is a super simple visualization toolbox (script) for transformer attention visualization ✌ 1. How to prepare your attention m

Mingyu Wang 3 Jul 09, 2022
view cool stats related to your discord account.

DiscoStats cool statistics generated using your discord data. How? DiscoStats is not a service that breaks the Discord Terms of Service or Community G

ibrahim hisham 5 Jun 02, 2022
Some problems of SSLC ( High School ) before outputs and after outputs

Some problems of SSLC ( High School ) before outputs and after outputs 1] A Python program and its output (output1) while running the program is given

Fayas Noushad 3 Dec 01, 2021
An XLSX spreadsheet renderer for Django REST Framework.

drf-renderer-xlsx provides an XLSX renderer for Django REST Framework. It uses OpenPyXL to create the spreadsheet and returns the data.

The Wharton School 166 Dec 01, 2022
The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualizing NFT data from OpenSea, using PostgreSQL and TimescaleDB.

Timescale NFT Starter Kit The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualiz

Timescale 102 Dec 24, 2022
Dimensionality reduction in very large datasets using Siamese Networks

ivis Implementation of the ivis algorithm as described in the paper Structure-preserving visualisation of high dimensional single-cell datasets. Ivis

beringresearch 284 Jan 01, 2023
PanGraphViewer -- show panenome graph in an easy way

PanGraphViewer -- show panenome graph in an easy way Table of Contents Versions and dependences Desktop-based panGraphViewer Library installation for

16 Dec 17, 2022
A command line tool for visualizing CSV/spreadsheet-like data

PerfPlotter Read data from CSV files using pandas and generate interactive plots using bokeh, which can then be embedded into HTML pages and served by

Gino Mempin 0 Jun 25, 2022
Flow-based visual scripting for Python

A simple visual node editor for Python Ryven combines flow-based visual scripting with Python. It gives you absolute freedom for your nodes and a simp

Leon Thomm 3.1k Jan 06, 2023
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 3.1k Jan 08, 2023