mumaxxr


Namemumaxxr JSON
Version 0.0.17 PyPI version JSON
download
home_pageNone
Summaryxarray engine to load ovf files from mumax simulations into xarray
upload_time2024-08-06 09:34:26
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            mumaxXR contains an engine for xarray to read output directories of mumax directly, lazily into xarray.
Therefore, the class OvfEngine needs to be imported from mumaxXR. Simply pass the directory, or an ovf file (e.g. m000000.ovf) as the filename_or_obj argument to the method.
If only the directory is specified, the engine tries to find magnetization ovf files. If no magnetization ovf files are found the engine tries to load displacement ovf files.
If neither magnetization nor displacement ovf files are found the engine just loads the first appearing type of ovf files.
The engine has to be passed to xarray as engine=OvfEngine. Set chunks='auto' in order to parallelize loading of the ovf-files. If you want to set chunks to something else, keep in mind,
that each ovf file has to be accessed multiple times, if the chunks for the dimensions x, y, z and comp are not set the default values.

.. code-block:: python

    from mumaxXR import OvfEngine
    dataset = xr.open_dataset(example_mumax_output_dir, chunks='auto', engine=OvfEngine)

If multiple kinds of ovf files have been stored in the same time steps, another argument 'wavetype' can be passed to open_dataset, containing a list of the other short names, e.g.,

.. code-block:: python

    dataset = xr.open_dataset(path_to_example_mumax_output_dir, chunks='auto', engine=OvfEngine, wavetype=['m', 'u'])

Keep in mind that the names passed to wavetype have to be exactly like the prefix of ovf files. 

If multiple simulation directories are supposed to be concatenated, multiple mumax simulation directories can be passed to the engine.
If the number of ovf-files in the directories is not the same, the data is going to be interpolated lineariliy towards the time scaling, of the major mumax-directory.
Please notice that this only makes sense, if the simulations did not crash or were interrupted in another way.
This is meant for concatenating simulations of parameter sweeps.
For 1D concatenation simply pass the parameter values inside a list to the engine.

.. code-block:: python

    dataset = xr.open_dataset(example_mumax_output_dir_0, chunks='auto', engine=OvfEngine, dirListToConcat=[path_to_example_mumax_output_dir_1, path_to_example_mumax_output_dir_2], sweepName='name_of_changed_parameter', sweepParam=[value_0_of_parameter, value_1_of_parameter, value_2_of_parameter])

For ND concatenation pass a list of names to sweepNames and a list of tuples to sweepParams

.. code-block:: python

    dataset = xr.open_dataset(example_mumax_output_dir_1, chunks='auto', engine=OvfEngine, dirListToConcat=[path_to_example_mumax_output_dir_2, path_to_example_mumax_output_dir_3, path_to_example_mumax_output_dir_4], sweepName=['name_of_changed_parameter_1', 'name_of_changed_parameter_2'], sweepParam=[(value_1_1_of_parameter, value_2_1_of_parameter), (value_1_2_of_parameter, value_2_1_of_parameter), (value_1_1_of_parameter, value_2_2_of_parameter), (value_1_2_of_parameter, value_2_2_of_parameter)])

If you want the ovf-files to be deleted after reading, set removeOvfFiles=True. This only works, if the ovf-files don't have to be accessed multiple times.
If you want to use ovf-files periodically, set useEachNthOvfFile=N. N has to be larger than one. Otherwise it is ignored. Using this flag, only each nth ovf file is used for the dataset.
The singleLoad option allows you to not load all of the ovf-files but only one specific one.

Of course the wavetype option and the mumax directory concatenation can be used simultaneously.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mumaxxr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Tim Vogel <tim.vogel@physik.uni-kl.de>",
    "download_url": "https://files.pythonhosted.org/packages/08/4b/762a6dddd3e81c31f13df9db5e93d099b770cf111d8491ae4d4ea19f89e5/mumaxxr-0.0.17.tar.gz",
    "platform": null,
    "description": "mumaxXR contains an engine for xarray to read output directories of mumax directly, lazily into xarray.\r\nTherefore, the class OvfEngine needs to be imported from mumaxXR. Simply pass the directory, or an ovf file (e.g. m000000.ovf) as the filename_or_obj argument to the method.\r\nIf only the directory is specified, the engine tries to find magnetization ovf files. If no magnetization ovf files are found the engine tries to load displacement ovf files.\r\nIf neither magnetization nor displacement ovf files are found the engine just loads the first appearing type of ovf files.\r\nThe engine has to be passed to xarray as engine=OvfEngine. Set chunks='auto' in order to parallelize loading of the ovf-files. If you want to set chunks to something else, keep in mind,\r\nthat each ovf file has to be accessed multiple times, if the chunks for the dimensions x, y, z and comp are not set the default values.\r\n\r\n.. code-block:: python\r\n\r\n    from mumaxXR import OvfEngine\r\n    dataset = xr.open_dataset(example_mumax_output_dir, chunks='auto', engine=OvfEngine)\r\n\r\nIf multiple kinds of ovf files have been stored in the same time steps, another argument 'wavetype' can be passed to open_dataset, containing a list of the other short names, e.g.,\r\n\r\n.. code-block:: python\r\n\r\n    dataset = xr.open_dataset(path_to_example_mumax_output_dir, chunks='auto', engine=OvfEngine, wavetype=['m', 'u'])\r\n\r\nKeep in mind that the names passed to wavetype have to be exactly like the prefix of ovf files. \r\n\r\nIf multiple simulation directories are supposed to be concatenated, multiple mumax simulation directories can be passed to the engine.\r\nIf the number of ovf-files in the directories is not the same, the data is going to be interpolated lineariliy towards the time scaling, of the major mumax-directory.\r\nPlease notice that this only makes sense, if the simulations did not crash or were interrupted in another way.\r\nThis is meant for concatenating simulations of parameter sweeps.\r\nFor 1D concatenation simply pass the parameter values inside a list to the engine.\r\n\r\n.. code-block:: python\r\n\r\n    dataset = xr.open_dataset(example_mumax_output_dir_0, chunks='auto', engine=OvfEngine, dirListToConcat=[path_to_example_mumax_output_dir_1, path_to_example_mumax_output_dir_2], sweepName='name_of_changed_parameter', sweepParam=[value_0_of_parameter, value_1_of_parameter, value_2_of_parameter])\r\n\r\nFor ND concatenation pass a list of names to sweepNames and a list of tuples to sweepParams\r\n\r\n.. code-block:: python\r\n\r\n    dataset = xr.open_dataset(example_mumax_output_dir_1, chunks='auto', engine=OvfEngine, dirListToConcat=[path_to_example_mumax_output_dir_2, path_to_example_mumax_output_dir_3, path_to_example_mumax_output_dir_4], sweepName=['name_of_changed_parameter_1', 'name_of_changed_parameter_2'], sweepParam=[(value_1_1_of_parameter, value_2_1_of_parameter), (value_1_2_of_parameter, value_2_1_of_parameter), (value_1_1_of_parameter, value_2_2_of_parameter), (value_1_2_of_parameter, value_2_2_of_parameter)])\r\n\r\nIf you want the ovf-files to be deleted after reading, set removeOvfFiles=True. This only works, if the ovf-files don't have to be accessed multiple times.\r\nIf you want to use ovf-files periodically, set useEachNthOvfFile=N. N has to be larger than one. Otherwise it is ignored. Using this flag, only each nth ovf file is used for the dataset.\r\nThe singleLoad option allows you to not load all of the ovf-files but only one specific one.\r\n\r\nOf course the wavetype option and the mumax directory concatenation can be used simultaneously.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "xarray engine to load ovf files from mumax simulations into xarray",
    "version": "0.0.17",
    "project_urls": {
        "Homepage": "https://github.com/timvgl/mumaxXR/",
        "Issues": "https://github.com/timvgl/mumaxXR/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "962956ce7b0074d6be5a490c78c3f7d65d191bfcfc9a445f2c422297d503a494",
                "md5": "66e4636e52e1e27429ee8f6de39a54d3",
                "sha256": "c3f43144233d4195ef438c28f839ebb2bca9433825278223c7a8d39b58b9fdda"
            },
            "downloads": -1,
            "filename": "mumaxxr-0.0.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66e4636e52e1e27429ee8f6de39a54d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11281,
            "upload_time": "2024-08-06T09:34:25",
            "upload_time_iso_8601": "2024-08-06T09:34:25.359955Z",
            "url": "https://files.pythonhosted.org/packages/96/29/56ce7b0074d6be5a490c78c3f7d65d191bfcfc9a445f2c422297d503a494/mumaxxr-0.0.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "084b762a6dddd3e81c31f13df9db5e93d099b770cf111d8491ae4d4ea19f89e5",
                "md5": "07caae6d49de3ad0f388753f0e576215",
                "sha256": "209334ead7abe1566f9799186a67caf8e41e7983277bf77a29e73ca5962910f0"
            },
            "downloads": -1,
            "filename": "mumaxxr-0.0.17.tar.gz",
            "has_sig": false,
            "md5_digest": "07caae6d49de3ad0f388753f0e576215",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12440,
            "upload_time": "2024-08-06T09:34:26",
            "upload_time_iso_8601": "2024-08-06T09:34:26.383112Z",
            "url": "https://files.pythonhosted.org/packages/08/4b/762a6dddd3e81c31f13df9db5e93d099b770cf111d8491ae4d4ea19f89e5/mumaxxr-0.0.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-06 09:34:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "timvgl",
    "github_project": "mumaxXR",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mumaxxr"
}
        
Elapsed time: 0.35816s