oommfpy


Nameoommfpy JSON
Version 1.4 PyPI version JSON
download
home_pagehttps://github.com/davidcortesortuno/oommfpy
SummaryMinimal Python lib to process OOMMF format output files
upload_time2024-09-26 22:29:18
maintainerNone
docs_urlNone
authorDavid Cortés-Ortuño
requires_python<3.13,>=3.10
licenseBSD-2-Clause
keywords oommf omf python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2611194.svg)](https://doi.org/10.5281/zenodo.2611194)
![GH Actions Test](https://github.com/davidcortesortuno/oommfpy/actions/workflows/manual-test.yml/badge.svg?)

```
   .+------+-------+-------+-------+-------+-------+-------+
 .'      .'      .'      .'      .'      .'      .'      .'|
+---+--+'------+'------+'------+'------+'------+'------+'  -
|      |       |       |       |       |       |       |   |
|   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](https://pypi.org/project/oommfpy)

    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
  the`site-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},
}
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/davidcortesortuno/oommfpy",
    "name": "oommfpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": "oommf, omf, python",
    "author": "David Cort\u00e9s-Ortu\u00f1o",
    "author_email": "d.i.cortes@uu.nl",
    "download_url": null,
    "platform": null,
    "description": "[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2611194.svg)](https://doi.org/10.5281/zenodo.2611194)\n![GH Actions Test](https://github.com/davidcortesortuno/oommfpy/actions/workflows/manual-test.yml/badge.svg?)\n\n```\n   .+------+-------+-------+-------+-------+-------+-------+\n .'      .'      .'      .'      .'      .'      .'      .'|\n+---+--+'------+'------+'------+'------+'------+'------+'  -\n|      |       |       |       |       |       |       |   |\n|   O  +   O   +   M   +   M   +   F   +   P   +   Y   +   +\n|      |       |       |       |       |       |       | .'\n+------+'------+'------+'------+-------+-------+-------+'\n```\n\n# OOMMFPy\n\nA very minimal and simple Python library to read and extract data from OOMMF\nmagnetisation files `omf`, which are also used in MuMax3. In addition to this\nlibrary we provide tools to plot `omf` files and convert them to `vtk` files.\n\nHighlights:\n\n- Read `omf` files in any format\n- Can also read `ovf` files and MuMax3 files\n- Painless conversion of the data in an `omf` file into Numpy arrays for data\n  analysis\n- Fast calculation (using Numpy) of the skyrmion number in a slice of the\n  system in any plane orientation (`xy`, `xz`, `yz`)\n- Fast reading of `omf` files in binary format (using Numpy's `fromfile`)\n- Minimal and super fast tool to convert `omf` files to VTK format\n- Plot functions\n- Early support for Paraview plugin: read `omf` files directly!\n\n## Install\n\nThe easiest is to use `pip` or `poetry` to install the package from\n[PyPI](https://pypi.org/project/oommfpy)\n\n    pip install oommfpy\n\nThe Github address can also be directly used to install the package via `pip`\n\n    pip install git+https://github.com/davidcortesortuno/oommfpy\n\nAlternatively, a `setup.py` file is provided to install this library\n\n    git clone https://github.com/davidcortesortuno/oommfpy\n    cd oommfpy\n    pip install ./\n\nIf successful, the `plot_omf` and `omf2vtk` tools are installed in the\ncorresponding `bin` directory and can be called from the command line.\n\nA C library is built with the installation process, thus the setup file tries\nto install Cython if is not present in the system.\n\n### Paraview plugin\n\nA first version of a reader for Paraview is added in this last version. For now\nthe installation is a bit of a hack:\n\n- After installing the `oommfpy` library, locate the `oommfpy` folder from\n  the`site-packages` directory\n\n- Download the latest version of Paraview with Python > 3.8 support\n\n- Copy the `oommfpy` directory into the Paraview Python `site-packages` folder.\n  For example, for Paraview 5.9.0 installed in the `home` folder:\n\n  ```\n  cp -r oommfpy $HOME/ParaView-5.9.0-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/\n  ```\n\n- Open Paraview and go to `Tools -> Manage Plugins -> Load New` and select the\n  Python file in the `tools/` folder of `oommfpy` (you can clone the\n  repository)\n\n- Now you can open any `omf` file without converting to VTK!\n\n## Documentation\n\nFor now check the `doc/ipynb` folder which contains a tutorial with basic\nfunctionality. To load a file with a magnetisation field, which is found more\ncommonly in simulations, use the `MagnetisationData` class. To load any field,\nsuch as the dipolar field, use the `FieldData` class.\n\nScripts to convert `omf` to VTK can be called directly as, for example,\n\n```\nomf2vtk -i omfs/my_oommf_output.omf -o test.vtk\n```\n\nThe input path can also be a directory or a path with a wildcard, *e.g.*\n`omfs/*.omf`. This method assumes the files in the path come from the same\nsimulation as the tool loads the mesh from the first file in the path and then\nonly updates the magnetisation fields.\n\nSimilar options are provided for the `plot_omf` function. Use the `--help` for\ndetails.\n\n## TODO\n\n- [ ] More tests\n- [ ] Add pyproject.toml file to avoid manual installation of Cython in setup.py\n- [ ] More options to plotting library\n- [ ] Print `z` coordinate when computing sk number\n- [ ] Allow Periodic boundaries for the skyrmion number calculation\n- [ ] Add typing check\n- [ ] Support for multiple OS\n\n# Citation\n\nIf you find this library useful, please cite this repository as:\n\n```\n@Misc{Cortes2019,\n  author       = {David Cort{\\'e}s-Ortu{\\~n}o},\n  title        = {OOMMFPy},\n  howpublished = {Zenodo doi:10.5281/zenodo.2611194. Github: https://github.com/davidcortesortuno/oommfpy},\n  year         = {2019},\n  doi          = {10.5281/zenodo.2611194},\n  url          = {https://doi.org/10.5281/zenodo.2611194},\n}\n```\n\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause",
    "summary": "Minimal Python lib to process OOMMF format output files",
    "version": "1.4",
    "project_urls": {
        "Homepage": "https://github.com/davidcortesortuno/oommfpy",
        "Repository": "https://github.com/davidcortesortuno/oommfpy"
    },
    "split_keywords": [
        "oommf",
        " omf",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46dd20d63205c83dddb68a147cd1190204c40b41d7d3113e26d79db663b4059f",
                "md5": "1c5ebca7f9ba41c8f342601366f5b742",
                "sha256": "739ca097a0481c3f3e89b953182b20f3afeb2efbe08c580c8a2dc23451943152"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp310-cp310-macosx_14_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "1c5ebca7f9ba41c8f342601366f5b742",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.10",
            "size": 316584,
            "upload_time": "2024-09-26T22:29:18",
            "upload_time_iso_8601": "2024-09-26T22:29:18.690631Z",
            "url": "https://files.pythonhosted.org/packages/46/dd/20d63205c83dddb68a147cd1190204c40b41d7d3113e26d79db663b4059f/oommfpy-1.4-cp310-cp310-macosx_14_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fca89c591b6fb0a96b0e51819f78bea4fbd842d6f31d8d48e510a01333693994",
                "md5": "d71b72f44d31f4735ca1bd12af7af595",
                "sha256": "3c5849953f2c1e5b79db865b2a8d9edfa8899b1d11ef64850a900e1c1cf0719b"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp310-cp310-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d71b72f44d31f4735ca1bd12af7af595",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.10",
            "size": 619585,
            "upload_time": "2024-09-26T22:29:20",
            "upload_time_iso_8601": "2024-09-26T22:29:20.345345Z",
            "url": "https://files.pythonhosted.org/packages/fc/a8/9c591b6fb0a96b0e51819f78bea4fbd842d6f31d8d48e510a01333693994/oommfpy-1.4-cp310-cp310-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ccf7bdea7dd5464980705969c698c8891352f12e942efaedcc170c5343aaec3",
                "md5": "8ae98e8fe6e329596202763efa354141",
                "sha256": "44a34b31d8b521a9068ae278dc90a949c80894e2ffb039578cfd8d3833c893b8"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "8ae98e8fe6e329596202763efa354141",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": "<3.13,>=3.10",
            "size": 237209,
            "upload_time": "2024-09-26T22:29:21",
            "upload_time_iso_8601": "2024-09-26T22:29:21.484572Z",
            "url": "https://files.pythonhosted.org/packages/7c/cf/7bdea7dd5464980705969c698c8891352f12e942efaedcc170c5343aaec3/oommfpy-1.4-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcbdac49d69f4eb50ab1190d9d302580334a88eb57ebf7a0e59a8edc599cf254",
                "md5": "4ad287506ab58a272ee99b728d95e2bd",
                "sha256": "e5aa67f624f119e11cf552710905c90e74fc7ddb1f93f91de7c3956efa9ce476"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp311-cp311-macosx_14_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "4ad287506ab58a272ee99b728d95e2bd",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.10",
            "size": 316497,
            "upload_time": "2024-09-26T22:29:22",
            "upload_time_iso_8601": "2024-09-26T22:29:22.702260Z",
            "url": "https://files.pythonhosted.org/packages/dc/bd/ac49d69f4eb50ab1190d9d302580334a88eb57ebf7a0e59a8edc599cf254/oommfpy-1.4-cp311-cp311-macosx_14_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96970d35d6682c9569f48bfcc3f54409ec1202899db825e9436325421d41fd8a",
                "md5": "dd9657b5a198af3d7569cd3c3067b4bc",
                "sha256": "29064d3d6f2feb6b3b78b271af547a145c17bad0b3a305366647b588b1901d79"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp311-cp311-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "dd9657b5a198af3d7569cd3c3067b4bc",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.10",
            "size": 653951,
            "upload_time": "2024-09-26T22:29:23",
            "upload_time_iso_8601": "2024-09-26T22:29:23.871160Z",
            "url": "https://files.pythonhosted.org/packages/96/97/0d35d6682c9569f48bfcc3f54409ec1202899db825e9436325421d41fd8a/oommfpy-1.4-cp311-cp311-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c431d3c26be4453d263b7def10048e809006534b53ad72c94b7313a802b4c20",
                "md5": "659052664b0abef0d9217509183d6fbb",
                "sha256": "1bd6885f8192a86977746699d2297d4fb680bd6d23cab4b7f73f0e3ce54b7699"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "659052664b0abef0d9217509183d6fbb",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": "<3.13,>=3.10",
            "size": 237287,
            "upload_time": "2024-09-26T22:29:24",
            "upload_time_iso_8601": "2024-09-26T22:29:24.947460Z",
            "url": "https://files.pythonhosted.org/packages/9c/43/1d3c26be4453d263b7def10048e809006534b53ad72c94b7313a802b4c20/oommfpy-1.4-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21deb6955d2f577b185c0b611d952f113ab4668a314b149ccb3cad3390159dd3",
                "md5": "66844935f2a75448675dd6605256359c",
                "sha256": "dc786febcc25298ea8c5d6f57a163ba6fc3d8a7c2489c43f6263c4c2e911b2c6"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp312-cp312-macosx_14_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "66844935f2a75448675dd6605256359c",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.10",
            "size": 319704,
            "upload_time": "2024-09-26T22:29:26",
            "upload_time_iso_8601": "2024-09-26T22:29:26.633905Z",
            "url": "https://files.pythonhosted.org/packages/21/de/b6955d2f577b185c0b611d952f113ab4668a314b149ccb3cad3390159dd3/oommfpy-1.4-cp312-cp312-macosx_14_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "239ac750abbe5ce4aa624985adc6114d29f1686a837250bb1d7e2efa2358b178",
                "md5": "b82a405c7712efdc835d77f2d47cbc68",
                "sha256": "cac62089525505c94d9932674e7c7da486925c12027c90ddbc9542c88491539c"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp312-cp312-manylinux_2_35_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b82a405c7712efdc835d77f2d47cbc68",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.10",
            "size": 642598,
            "upload_time": "2024-09-26T22:29:28",
            "upload_time_iso_8601": "2024-09-26T22:29:28.176714Z",
            "url": "https://files.pythonhosted.org/packages/23/9a/c750abbe5ce4aa624985adc6114d29f1686a837250bb1d7e2efa2358b178/oommfpy-1.4-cp312-cp312-manylinux_2_35_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df59da4a17d8697f8a61aea8d1abbef2b879bd4d7f0e23a511d5b61161466d56",
                "md5": "9709b7a044d58c066a822a226fa2df62",
                "sha256": "e41ebcf1477b959386d0baad67cfdf2bd19942b06b90fccfb4f738f40e9e57cd"
            },
            "downloads": -1,
            "filename": "oommfpy-1.4-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "9709b7a044d58c066a822a226fa2df62",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": "<3.13,>=3.10",
            "size": 238117,
            "upload_time": "2024-09-26T22:29:29",
            "upload_time_iso_8601": "2024-09-26T22:29:29.333422Z",
            "url": "https://files.pythonhosted.org/packages/df/59/da4a17d8697f8a61aea8d1abbef2b879bd4d7f0e23a511d5b61161466d56/oommfpy-1.4-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-26 22:29:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "davidcortesortuno",
    "github_project": "oommfpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "oommfpy"
}
        
Elapsed time: 2.70163s