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
Sci palettes for matplotlib/seaborn

sci palettes for matplotlib/seaborn Installation python3 -m pip install sci-palettes Usage import seaborn as sns import matplotlib.pyplot as plt impor

Qingdong Su 2 Jun 07, 2022
Process dataframe in a easily way.

Popanda Written by Shengxuan Wang at OSU. Used for processing dataframe, especially for machine learning. The name is from "Po" in the movie Kung Fu P

ShawnWang 1 Dec 24, 2021
Simple, realtime visualization of neural network training performance.

pastalog Simple, realtime visualization server for training neural networks. Use with Lasagne, Keras, Tensorflow, Torch, Theano, and basically everyth

Rewon Child 416 Dec 29, 2022
By default, networkx has problems with drawing self-loops in graphs.

By default, networkx has problems with drawing self-loops in graphs. It makes it hard to draw a graph with self-loops or to make a nicely looking chord diagram. This repository provides some code to

Vladimir Shitov 5 Jan 06, 2022
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 723 Jan 07, 2023
Exploratory analysis and data visualization of aircraft accidents and incidents in Brazil.

Exploring aircraft accidents in Brazil Occurrencies with aircraft in Brazil are investigated by the Center for Investigation and Prevention of Aircraf

Augusto Herrmann 5 Dec 14, 2021
Custom Plotly Dash components based on Mantine React Components library

Dash Mantine Components Dash Mantine Components is a Dash component library based on Mantine React Components Library. It makes it easier to create go

Snehil Vijay 239 Jan 08, 2023
UNMAINTAINED! Renders beautiful SVG maps in Python.

Kartograph is not maintained anymore As you probably already guessed from the commit history in this repo, Kartograph.py is not maintained, which mean

1k Dec 09, 2022
Glue is a python project to link visualizations of scientific datasets across many files.

Glue Glue is a python project to link visualizations of scientific datasets across many files. Click on the image for a quick demo: Features Interacti

675 Dec 09, 2022
Simple spectra visualization tool for astronomers

SpecViewer A simple visualization tool for astronomers. Dependencies Python = 3.7.4 PyQt5 = 5.15.4 pyqtgraph == 0.10.0 numpy = 1.19.4 How to use py

5 Oct 07, 2021
`charts.css.py` brings `charts.css` to Python. Online documentation and samples is available at the link below.

charts.css.py charts.css.py provides a python API to convert your 2-dimension data lists into html snippet, which will be rendered into charts by CSS,

Ray Luo 3 Sep 23, 2021
A way of looking at COVID-19 data that I haven't seen before.

Visualizing Omicron: COVID-19 Deaths vs. Cases Click here for other countries. Data is from Our World in Data/Johns Hopkins University. About this pro

1 Jan 10, 2022
Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Péter Ferenc Gyarmati 1 Jan 17, 2022
哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看、waifu2x等功能。

picacomic-windows 哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看等功能。 功能介绍 登陆分流,还原安卓端的三个分流入口 分类,搜索,排行,收藏夹使用同一的逻辑,滚轮下滑自动加载下一页,双击打开 漫画详情,章节列表和评论列表 下载功能,目

1.8k Dec 31, 2022
Automatically generate GitHub activity!

Commit Bot Automatically generate GitHub activity! We've all wanted to be the developer that commits every day, but that requires a lot of work. Let's

Ricky 4 Jun 07, 2022
Python code for solving 3D structural problems using the finite element method

3DFEM Python 3D finite element code This python code allows for solving 3D structural problems using the finite element method. New features will be a

Rémi Capillon 6 Sep 29, 2022
Package managers visualization

Software Galaxies This repository combines visualizations of major software package managers. All visualizations are available here: http://anvaka.git

Andrei Kashcha 1.4k Dec 22, 2022
demir.ai Dataset Operations

demir.ai Dataset Operations With this application, you can have the empty values (nan/null) deleted or filled before giving your dataset to machine le

Ahmet Furkan DEMIR 8 Nov 01, 2022
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 694 Jan 04, 2023
GitHub Stats Visualizations : Transparent

GitHub Stats Visualizations : Transparent Generate visualizations of GitHub user and repository statistics using GitHub Actions. ⚠️ Disclaimer The pro

YuanYap 7 Apr 05, 2022