IMAS Data Dictionaries converted to Python Dataclass used in the IMAS-GK/IDSPy project
Project description
IDSPy_Dictionaries
IMAS Data Dictionaries converted to Python Dataclass used in the IDSPy suite.
Prerequisites
To use this script, you need to have Python 3.9 or later installed. You can download Python from https://www.python.org/downloads/. Please note that Python at least 3.10 is recommended.
Installation
To install the necessary packages, run the following command:
python -m pip install idspy_dictionaries
Usage
To load the desired IDS :
from idspy_dictionaries import ids_gyrokinetics # or any other available IDS
new_ids = ids_gyrokinetics.Gyrokinetics()
FAQ
- Q: What is the minimum required version of Python to run this script?
- A: The recommended version of Python is 3.10. It can be used with Python >= 3.9
but there is no support in that case.
- Q: Can I add new members to the dataclasses?
A: This option is not possible to be sure that the dataclasses follow the IMAS conventions.
- Q: Is the package compatible with pydantic and/or attrs?
A: Short answer, no ;)
- Q: I would really like to use python <3.9 is it really impossible?
- A: IDSPy_dictionaries used mainly python dataclasses and the slot property which had been added in python 3.10 only.
The main reason to use __slots__ is to avoid addition of members in the IDS and remains fully compliant with IMAS. A version of the package had been published “as it is” without the slots dependency but need at least python 3.9. The way dataclasses are generated with the associated fields, at the opposite, is not compatible at all with python 3.8.
- Q: Can I load all the dictionaries at once?
A: For performances reasons, it’s not possible right now.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for idspy_dictionaries-33900.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad6b7411458afd8ea49afc5d2f42395b161836cb90f1a0c023b1bd1149aa4ec7 |
|
MD5 | 726722654f2f39a3bf5cf6a9d909e33d |
|
BLAKE2b-256 | 547abc251f49a6fde13a0a3844c9ed3062add02d3f35a1082bb2b9991b1bc118 |
Hashes for idspy_dictionaries-33900.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916009f3b349b96a0bbb283e76cad94c7f0d5cc51938f3dc3a1520445d2fc4cf |
|
MD5 | c37ce8265802bb9c851e175f141e9596 |
|
BLAKE2b-256 | 187f67a6810448ae54516e889c8f9a51e5bf6efdaa4025aaf7e9e10b5fbedf9f |