Skip to main content

Minimal Python lib to process OOMMF format output files

Project description

DOI GH Actions Test

   .+------+-------+-------+-------+-------+-------+-------+
 .'      .'      .'      .'      .'      .'      .'      .'|
+---+--+'------+'------+'------+'------+'------+'------+'  -
|      |       |       |       |       |       |       |   |
|   O  +   O   +   M   +   M   +   F   +   P   +   Y   +   +
|      |       |       |       |       |       |       | .'
+------+'------+'------+'------+-------+-------+-------+'

OOMMFPy

A very minimal and simple Python library to read and extract data from OOMMF magnetisation files omf, which are also used in MuMax3. In addition to this library we provide tools to plot omf files and convert them to vtk files.

Highlights:

  • Read omf files in any format
  • Can also read ovf files and MuMax3 files
  • Painless conversion of the data in an omf file into Numpy arrays for data analysis
  • Fast calculation (using Numpy) of the skyrmion number in a slice of the system in any plane orientation (xy, xz, yz)
  • Fast reading of omf files in binary format (using Numpy's fromfile)
  • Minimal and super fast tool to convert omf files to VTK format
  • Plot functions
  • Early support for Paraview plugin: read omf files directly!

Install

The easiest is to use pip or poetry to install the package from PyPI

pip install oommfpy

The Github address can also be directly used to install the package via pip

pip install git+https://github.com/davidcortesortuno/oommfpy

Alternatively, a setup.py file is provided to install this library

git clone https://github.com/davidcortesortuno/oommfpy
cd oommfpy
pip install ./

If successful, the plot_omf and omf2vtk tools are installed in the corresponding bin directory and can be called from the command line.

A C library is built with the installation process, thus the setup file tries to install Cython if is not present in the system.

Paraview plugin

A first version of a reader for Paraview is added in this last version. For now the installation is a bit of a hack:

  • After installing the oommfpy library, locate the oommfpy folder from thesite-packages directory

  • Download the latest version of Paraview with Python > 3.8 support

  • Copy the oommfpy directory into the Paraview Python site-packages folder. For example, for Paraview 5.9.0 installed in the home folder:

    cp -r oommfpy $HOME/ParaView-5.9.0-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/
    
  • Open Paraview and go to Tools -> Manage Plugins -> Load New and select the Python file in the tools/ folder of oommfpy (you can clone the repository)

  • Now you can open any omf file without converting to VTK!

Documentation

For now check the doc/ipynb folder which contains a tutorial with basic functionality. To load a file with a magnetisation field, which is found more commonly in simulations, use the MagnetisationData class. To load any field, such as the dipolar field, use the FieldData class.

Scripts to convert omf to VTK can be called directly as, for example,

omf2vtk -i omfs/my_oommf_output.omf -o test.vtk

The input path can also be a directory or a path with a wildcard, e.g. omfs/*.omf. This method assumes the files in the path come from the same simulation as the tool loads the mesh from the first file in the path and then only updates the magnetisation fields.

Similar options are provided for the plot_omf function. Use the --help for details.

TODO

  • More tests
  • Add pyproject.toml file to avoid manual installation of Cython in setup.py
  • More options to plotting library
  • Print z coordinate when computing sk number
  • Allow Periodic boundaries for the skyrmion number calculation
  • Add typing check
  • Support for multiple OS

Citation

If you find this library useful, please cite this repository as:

@Misc{Cortes2019,
  author       = {David Cort{\'e}s-Ortu{\~n}o},
  title        = {OOMMFPy},
  howpublished = {Zenodo doi:10.5281/zenodo.2611194. Github: https://github.com/davidcortesortuno/oommfpy},
  year         = {2019},
  doi          = {10.5281/zenodo.2611194},
  url          = {https://doi.org/10.5281/zenodo.2611194},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oommfpy-1.3.tar.gz (544.4 kB view details)

Uploaded Source

Built Distributions

oommfpy-1.3-cp39-cp39-win_amd64.whl (413.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

oommfpy-1.3-cp39-cp39-manylinux_2_31_x86_64.whl (550.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

oommfpy-1.3-cp39-cp39-macosx_10_15_x86_64.whl (206.2 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

oommfpy-1.3-cp38-cp38-win_amd64.whl (413.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

oommfpy-1.3-cp38-cp38-manylinux_2_31_x86_64.whl (560.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

oommfpy-1.3-cp38-cp38-macosx_10_15_x86_64.whl (204.2 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file oommfpy-1.3.tar.gz.

File metadata

  • Download URL: oommfpy-1.3.tar.gz
  • Upload date:
  • Size: 544.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3.tar.gz
Algorithm Hash digest
SHA256 fd338dd807097649b032ae3fb050f933bdbe5a04621be8fdfd2ae3083494e837
MD5 0edef489c17d9e099821cb2d28306f9c
BLAKE2b-256 facc0977cd2ad9e9a18cd7990a9b4ba01ae2e532e77d4a3d461dbff7543627a0

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 413.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 60e7bd8eb55d74bf434aeb2991fbc63c45b34042a26586e4e6f3d894b85068b0
MD5 98fc4b5ae0e12ab8a4b83f5ebc64bb72
BLAKE2b-256 b223f00a854504bb89a44f3d78725120a0f4995427ae98a9210add39ad30f9ad

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp39-cp39-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp39-cp39-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 550.0 kB
  • Tags: CPython 3.9, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 78d07250834aeae1d92aa4e0c755a6efb6765eb696ed744b0c0682ab4dfb4b69
MD5 8bc7474471e640da67e2455bf9b4e405
BLAKE2b-256 9ffac8a24e2ca56de58b1da8af7ee73c6dfc0362d5e5f694d17449f69991b416

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 206.2 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d4173c0d26c5bc2aed637f0991222ea4aabdc70057ad93586730a234c1f1c661
MD5 cd9f9c633d8ed914af626aed16f879a8
BLAKE2b-256 5d6ea3a349297fa7fb4d66d827cdc6ea129bb04ef674f3479e6bd9ef2ce71fd7

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 413.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d1a439ae8a938cc8f3ec8b2bd37f9d5eb770e6bf39fe31cc38387f526793ae64
MD5 8292acad2416345bdeb661ffed33fba0
BLAKE2b-256 581f6204c27a7c83e19609b851b7e075ec1c8a684da288764fdc959f15c92e87

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp38-cp38-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 560.0 kB
  • Tags: CPython 3.8, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 9c28837eb47eae2bcee0ffee40949429e3187966565e61dc20aaf1bfaa08ef6f
MD5 fe45a818ddde0068c0628eac097b7bb6
BLAKE2b-256 010c5fc2a3bde59a5bdb40cb43fd42554be2c760edaadf583c0ebe4e87dfcf24

See more details on using hashes here.

File details

Details for the file oommfpy-1.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: oommfpy-1.3-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 204.2 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for oommfpy-1.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f19b84b73e9d8e1db7ff556554957e3260f9a254031488b69843a88d94ff8cef
MD5 a5e5bd83f78a899c55d1b3eb84addec7
BLAKE2b-256 64ab4ae0a2eee695c8804f9ab334ceb616c36a4f518a347718c80cc399194b16

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page