Skip to main content

Data validation for IMAS IDS data

Project description

README

IMAS-Validator is a tool to validate IMAS IDS's through the use of general and case-specific validation rules.

Installation

Installation guide readthedocs

CLI

After installation process is completed one can run CLI application by executing imas_validator command in bash console

See imas_validator -h for more information

Documentation

Documentation is autogenerated from the source using Sphinx and can be found at the readthedocs

The documentation can be manually generated by installing sphinx and running:

make -C docs html

Examples

@validator("*")
def validate_ids_plugins_metadata(ids):
  """Validate mandatory attributes in the ids_properties.plugins."""
  plugins = ids.ids_properties.plugins
  for node in plugins.node:
    assert node.path != ""
    for name in node.put_operation:
      assert name != ""
  # etc.

@validator("gyrokinetics_local")
def validate_gyrokinetics_electron_definition(gk):
  """Validate that there is an electron species in the species AoS."""
  for species in gk.species:
    if species.charge_norm != -1:
      continue
    assert species.mass_norm == 2.724437108e-4
    assert species.temperature_norm == 1.0
    assert species.density_norm == 1.0
    break
  else:
    assert False, "No electron species found"

@validator("core_profiles")
def validate_ion_charge(cp):
  """Validate that profiles_1d/ion/z_ion is defined."""
  for p1d in cp.profiles_1d:
    for ion in p1d.ion:
      assert ion.z_ion.has_value

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

imas_validator-1.0.0.tar.gz (85.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imas_validator-1.0.0-py3-none-any.whl (63.7 kB view details)

Uploaded Python 3

File details

Details for the file imas_validator-1.0.0.tar.gz.

File metadata

  • Download URL: imas_validator-1.0.0.tar.gz
  • Upload date:
  • Size: 85.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for imas_validator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 132d73b7b7f24628e8e12a60381fc8c65bf1ed996f817c442a0a4d1124e8c63b
MD5 0d71f36852bdb5cca29ddec0c48434c1
BLAKE2b-256 cc899c8078134ac670815815cb0f89813324eeb26c65e1fe80bafd7e3d9327e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for imas_validator-1.0.0.tar.gz:

Publisher: publish_pypi.yml on iterorganization/IMAS-Validator

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

File details

Details for the file imas_validator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: imas_validator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 63.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for imas_validator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2e482aaf6988e74d71204a4dd3e1a7987dd7a38aa0c00fbf87d204a76f7719
MD5 0d9aaada7cabc935ef155a5a9dc3e08f
BLAKE2b-256 58ca17a035ddae1bbb6a0d42b91e2aea4092790be553dc337a0626636b7c49dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for imas_validator-1.0.0-py3-none-any.whl:

Publisher: publish_pypi.yml on iterorganization/IMAS-Validator

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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page