Skip to main content

An extension module for yt, adding a frontend for Idefix and Pluto

Project description

yt_idefix

PyPI yt-project

CI pre-commit.ci status Ruff

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

Installation

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.

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").

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

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".

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
{"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.

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.

>>> 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.

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

yt_idefix-2.4.2.tar.gz (51.5 MB view details)

Uploaded Source

Built Distribution

yt_idefix-2.4.2-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file yt_idefix-2.4.2.tar.gz.

File metadata

  • Download URL: yt_idefix-2.4.2.tar.gz
  • Upload date:
  • Size: 51.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for yt_idefix-2.4.2.tar.gz
Algorithm Hash digest
SHA256 48e441a50b8fddc1dba5285acbb6f56564263f601dcce18f7a2fb5a52fd22dd5
MD5 795af8d0a68c5024773e7d2850272915
BLAKE2b-256 c19b2af5f97c391cddbc20bd6a5426b5b4f9fe66526d5c5cb21224d553cfe755

See more details on using hashes here.

Provenance

The following attestation bundles were made for yt_idefix-2.4.2.tar.gz:

Publisher: cd.yml on neutrinoceros/yt_idefix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yt_idefix-2.4.2-py3-none-any.whl.

File metadata

  • Download URL: yt_idefix-2.4.2-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for yt_idefix-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 edcd7d223e04e4addb2696b863ccdb149c9bc20ac15523dcb2b6f1c537c73f34
MD5 79c172049bd718c63836a601a925cc5d
BLAKE2b-256 c5b346022f18988d94134ee736b085285c82c89b8cdd722e956663f878eea04d

See more details on using hashes here.

Provenance

The following attestation bundles were made for yt_idefix-2.4.2-py3-none-any.whl:

Publisher: cd.yml on neutrinoceros/yt_idefix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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