yt-idefix


Nameyt-idefix JSON
Version 2.3.1 PyPI version JSON
download
home_pageNone
SummaryAn extension module for yt, adding a frontend for Idefix and Pluto
upload_time2024-04-17 08:32:58
maintainerNone
docs_urlNone
authorC.M.T. Robert
requires_python>=3.9
licenseGPL-3.0
keywords astronomy astrophysics visualization amr adaptivemeshrefinement
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# yt_idefix
[![PyPI](https://img.shields.io/pypi/v/yt-idefix.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/yt_idefix/)
[![yt-project](https://img.shields.io/static/v1?label="works%20with"&message="yt"&color="blueviolet")](https://yt-project.org)

<!--- Tests and style --->
[![CI](https://github.com/neutrinoceros/yt_idefix/actions/workflows/ci.yml/badge.svg)](https://github.com/neutrinoceros/yt_idefix/actions/workflows/ci.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/neutrinoceros/yt_idefix/main.svg)](https://results.pre-commit.ci/latest/github/neutrinoceros/yt_idefix/main)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)

A maturing yt frontend for Idefix and Pluto, packaged as an extension for yt.

## Installation

```shell
python -m pip install yt_idefix
```

## Supported formats

| Code   | format | supported since | additional dependencies |
|--------|:------:|:---------------:|-------------------------|
| Idefix | `.dmp` | v0.1.0          |                         |
| Idefix | `.vtk` | v0.3.0          |                         |
| Pluto  | `.vtk` | v0.9.0          |                         |
| Pluto  |  XDMF  | v1.1.0          | `h5py`                  |

## Usage

Integration with yt is seamless. *Installing* this plugin is all that's required to make yt
compatible with data formats supported by `yt_idefix` !

### Additional arguments to `yt.load`
The metadata are parsed from data file, definitions header file and inifile when loading dataset.

Definitions header file (`definitions.h` for Pluto, or `definitions.hpp` for Idefix) and inifile (`pluto.ini` and `idefix.ini` respectively) are discovered automatically if they match default names, are located along with data files, and unique. Otherwise, they can be specified explicitly as paths (either relative to data files or absolute paths) with parameters `definitions_header` and `inifile` respectively.

```python
ds = yt.load(
    "data.0010.vtk",
    definitions_header="../definitions.h",
    inifile="example.ini",
)
```

Geometry is parsed automatically whenever possible, but as a last resort, it can also be specified as a keyword argument (possible values are "cartesian", "spherical", "cylindrical" and "polar").

```python
ds = yt.load("data.0010.vtk", geometry="spherical")
```

The data are loaded as physical quantities with units. The default unit system is `cgs` in yt. Data is always interpreted as dimensionful.
For Pluto simulation, metadata is retrieved from `definitions.h` and `pluto.ini` to guess the proper on-disk units automatically.

Units may also be provided at runtime using the `units_override` argument
```python
ds = yt.load(
    "data.0010.vtk",
    units_override={
        "length_unit": (100.0, "au"),
        "mass_unit": yt.units.mass_sun,
    },
)
```
Note that other units will also be changed for consistency (Pluto).

Displayed units can also be controled using the `unit_system` argument.
Accepted values are `"cgs"` (default), `"mks"` and `"code"`.

```python
ds = yt.load("data.0010.vtk", unit_system="mks")
```

With Pluto data, units not specified with `units_override` will be derived consistently with given units, within the following rules:
1. Temperature unit cannot be overridden (always set to Kelvin)
2. No more than three units can be overridden at once (overconstrained systems are never validated for simplicity)
3. When given less than three overrides, base units in Pluto (ordered: velocity_unit, density_unit, length_unit) are assumed
4. The following combinations are not allowed

```python
{"magnetic_unit", "velocity_unit", "density_unit"},
{"velocity_unit", "time_unit", "length_unit"},
{"density_unit", "length_unit", "mass_unit"}
```

yt is able to provide some derived fields from existed fields, e.g., `"cell_volume"`. Fields related to element species can be created according to primordial abundances of H and He, through `default_species_fields` (`"neutral"` and `"ionized"`) parameters.

```python
ds = yt.load("data.0010.vtk", default_species_fields="ionized")
```

### Conventions on field names

Field names of on-disk fields for density, pressure, velocity and magnetic field components are always normalized to upper case, even if Pluto may use lowercase in some versions.

```python
>>> ds.field_list
[('pluto-vtk', 'PRS'),
 ('pluto-vtk', 'RHO'),
 ('pluto-vtk', 'VX1'),
 ('pluto-vtk', 'VX2'),
 ('pluto-vtk', 'VX3')]
```

This normalization is only applied to non-user-defined outputs and Pluto's ion
fraction outputs.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yt-idefix",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "astronomy astrophysics visualization amr adaptivemeshrefinement",
    "author": "C.M.T. Robert",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/96/31/ebfee6f330b3da833f17333712e54674518a9468c7c1481ee3bc49fcd91e/yt_idefix-2.3.1.tar.gz",
    "platform": null,
    "description": "\n# yt_idefix\n[![PyPI](https://img.shields.io/pypi/v/yt-idefix.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/yt_idefix/)\n[![yt-project](https://img.shields.io/static/v1?label=\"works%20with\"&message=\"yt\"&color=\"blueviolet\")](https://yt-project.org)\n\n<!--- Tests and style --->\n[![CI](https://github.com/neutrinoceros/yt_idefix/actions/workflows/ci.yml/badge.svg)](https://github.com/neutrinoceros/yt_idefix/actions/workflows/ci.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/neutrinoceros/yt_idefix/main.svg)](https://results.pre-commit.ci/latest/github/neutrinoceros/yt_idefix/main)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)\n\nA maturing yt frontend for Idefix and Pluto, packaged as an extension for yt.\n\n## Installation\n\n```shell\npython -m pip install yt_idefix\n```\n\n## Supported formats\n\n| Code   | format | supported since | additional dependencies |\n|--------|:------:|:---------------:|-------------------------|\n| Idefix | `.dmp` | v0.1.0          |                         |\n| Idefix | `.vtk` | v0.3.0          |                         |\n| Pluto  | `.vtk` | v0.9.0          |                         |\n| Pluto  |  XDMF  | v1.1.0          | `h5py`                  |\n\n## Usage\n\nIntegration with yt is seamless. *Installing* this plugin is all that's required to make yt\ncompatible with data formats supported by `yt_idefix` !\n\n### Additional arguments to `yt.load`\nThe metadata are parsed from data file, definitions header file and inifile when loading dataset.\n\nDefinitions header file (`definitions.h` for Pluto, or `definitions.hpp` for Idefix) and inifile (`pluto.ini` and `idefix.ini` respectively) are discovered automatically if they match default names, are located along with data files, and unique. Otherwise, they can be specified explicitly as paths (either relative to data files or absolute paths) with parameters `definitions_header` and `inifile` respectively.\n\n```python\nds = yt.load(\n    \"data.0010.vtk\",\n    definitions_header=\"../definitions.h\",\n    inifile=\"example.ini\",\n)\n```\n\nGeometry is parsed automatically whenever possible, but as a last resort, it can also be specified as a keyword argument (possible values are \"cartesian\", \"spherical\", \"cylindrical\" and \"polar\").\n\n```python\nds = yt.load(\"data.0010.vtk\", geometry=\"spherical\")\n```\n\nThe data are loaded as physical quantities with units. The default unit system is `cgs` in yt. Data is always interpreted as dimensionful.\nFor Pluto simulation, metadata is retrieved from `definitions.h` and `pluto.ini` to guess the proper on-disk units automatically.\n\nUnits may also be provided at runtime using the `units_override` argument\n```python\nds = yt.load(\n    \"data.0010.vtk\",\n    units_override={\n        \"length_unit\": (100.0, \"au\"),\n        \"mass_unit\": yt.units.mass_sun,\n    },\n)\n```\nNote that other units will also be changed for consistency (Pluto).\n\nDisplayed units can also be controled using the `unit_system` argument.\nAccepted values are `\"cgs\"` (default), `\"mks\"` and `\"code\"`.\n\n```python\nds = yt.load(\"data.0010.vtk\", unit_system=\"mks\")\n```\n\nWith Pluto data, units not specified with `units_override` will be derived consistently with given units, within the following rules:\n1. Temperature unit cannot be overridden (always set to Kelvin)\n2. No more than three units can be overridden at once (overconstrained systems are never validated for simplicity)\n3. When given less than three overrides, base units in Pluto (ordered: velocity_unit, density_unit, length_unit) are assumed\n4. The following combinations are not allowed\n\n```python\n{\"magnetic_unit\", \"velocity_unit\", \"density_unit\"},\n{\"velocity_unit\", \"time_unit\", \"length_unit\"},\n{\"density_unit\", \"length_unit\", \"mass_unit\"}\n```\n\nyt is able to provide some derived fields from existed fields, e.g., `\"cell_volume\"`. Fields related to element species can be created according to primordial abundances of H and He, through `default_species_fields` (`\"neutral\"` and `\"ionized\"`) parameters.\n\n```python\nds = yt.load(\"data.0010.vtk\", default_species_fields=\"ionized\")\n```\n\n### Conventions on field names\n\nField names of on-disk fields for density, pressure, velocity and magnetic field components are always normalized to upper case, even if Pluto may use lowercase in some versions.\n\n```python\n>>> ds.field_list\n[('pluto-vtk', 'PRS'),\n ('pluto-vtk', 'RHO'),\n ('pluto-vtk', 'VX1'),\n ('pluto-vtk', 'VX2'),\n ('pluto-vtk', 'VX3')]\n```\n\nThis normalization is only applied to non-user-defined outputs and Pluto's ion\nfraction outputs.\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "An extension module for yt, adding a frontend for Idefix and Pluto",
    "version": "2.3.1",
    "project_urls": {
        "Documentation": "https://yt-project.org/docs/dev/",
        "Homepage": "https://yt-project.org/",
        "Source": "https://github.com/neutrinoceros/yt_idefix",
        "Tracker": "https://github.com/neutrinoceros/yt_idefix/issues"
    },
    "split_keywords": [
        "astronomy",
        "astrophysics",
        "visualization",
        "amr",
        "adaptivemeshrefinement"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18415f04a770c0f29a80fed78542bd6c6bcdbf821d251b4457753a5500cbe650",
                "md5": "ad7743ba7763e6d8c82af383e36391cd",
                "sha256": "aad989972375e78a3b12795e3c26917e746be35a0445d6128060b1c97fb12b85"
            },
            "downloads": -1,
            "filename": "yt_idefix-2.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad7743ba7763e6d8c82af383e36391cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 39564,
            "upload_time": "2024-04-17T08:32:51",
            "upload_time_iso_8601": "2024-04-17T08:32:51.009876Z",
            "url": "https://files.pythonhosted.org/packages/18/41/5f04a770c0f29a80fed78542bd6c6bcdbf821d251b4457753a5500cbe650/yt_idefix-2.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9631ebfee6f330b3da833f17333712e54674518a9468c7c1481ee3bc49fcd91e",
                "md5": "a04736a216cfc5361e98305027f60acc",
                "sha256": "30801b40f32074ee6ef4659310bfaf75e17687178d2ce77b4aba5ec9b50aa44c"
            },
            "downloads": -1,
            "filename": "yt_idefix-2.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a04736a216cfc5361e98305027f60acc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 41309,
            "upload_time": "2024-04-17T08:32:58",
            "upload_time_iso_8601": "2024-04-17T08:32:58.708429Z",
            "url": "https://files.pythonhosted.org/packages/96/31/ebfee6f330b3da833f17333712e54674518a9468c7c1481ee3bc49fcd91e/yt_idefix-2.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 08:32:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "neutrinoceros",
    "github_project": "yt_idefix",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "yt-idefix"
}
        
Elapsed time: 0.25058s