python parser and usefull script related to the saclay format
Project description
Saclay_format (v0.2.2)
This repository contains a proposal format definition to exchange inputs/outputs between some mean-field theory codes in the nuclear physics and astrophysics communities. This format relies on a series of custom binary files containing the raw data along with a YAML header containing metadata. It adheres to the results of the 05/2025 and 10/2025 ESNT workshops entitled "Simulating dense matter on three-dimensional coordinate space meshes (part I and II)".
Content
saclay_format— Python3 package to parse and visualize this formatdocs— documentation of the format (not yet up to date)examples— nuclear mean-field outputs in this formattests— unit tests of the package (not yet up to date)
Requirements
pyyaml— Python3 package for YAML parsingh5py— Python3 package for HDF5 parsing
Running the parser
From a Python terminal, import the parser module and use its read() and write() methods.
To see the expected structure of the data dictionary, check the
create_dummy_data() function in tests/test_saclay_format.py.
Example:
cd tests/
python3 test_saclay_format.py
Examples
Example structure
examples/20Ne_bcs/
├── 20Ne_rho_n.wdat
├── 20Ne_state
├── 20Ne.h5
├── 20Ne.yaml
└── README.md
examples/alpha_alpha_3MeV/
├── reaction_alpha_alpha_3MeV_header.yml
├── reaction_alpha_alpha_3MeV_rho_n.bin
├── reaction_alpha_alpha_3MeV_rho_p.bin
├── README_visualisation_convert.md
└── script_test.convert.sh
examples/Ca40_ev8/
├── Ca40_HF_SLy4.yaml
├── Ca40_HF_SLy4_*.dat
└── README_test.md
Conversion test
python3 ../../saclay_format/hdf5_yaml_converter.py -h5 Ca40_HF_SLy4.yaml
python3 ../../saclay_format/ev8_to_ev1.py Ca40_HF_SLy4.h5 -o Ca40_HF_SLy4_ev1.h5
python3 ../../saclay_format/ev1_to_cr1.py Ca40_HF_SLy4_ev1.h5 -o Ca40_HF_SLy4_cr1.h5
Visualization test
Static:
python3 ../../saclay_format/visualisation_rho.py reaction_alpha_alpha_3MeV_header.yml
Dynamic:
python3 ../../saclay_format/visualisation_rho_TD.py -H reaction_alpha_alpha_3MeV_header.yml
Conversion and round-trip test:
python3 ../../saclay_format/hdf5_yaml_converter.py -h5 reaction_alpha_alpha_3MeV_header.yml
mv reaction_alpha_alpha_3MeV_header.h5 reaction_alpha_alpha_3MeV_converted.h5
python3 ../../saclay_format/visualisation_rho_TD.py reaction_alpha_alpha_3MeV_converted.h5
python3 ../../saclay_format/hdf5_yaml_converter.py -yaml reaction_alpha_alpha_3MeV_converted.h5
python3 ../../saclay_format/visualisation_rho_TD.py reaction_alpha_alpha_3MeV_converted.yaml
rm reaction_alpha_alpha_3MeV_converted*
Todo
- Test the format
- Add documentation
- Update unit tests
Project layout
This project follows the structure recommended by the Hitchhiker’s Guide to Python:
https://docs.python-guide.org/writing/structure
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file saclay_format-0.2.2.tar.gz.
File metadata
- Download URL: saclay_format-0.2.2.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6ad5e25fa769c325c3e1350a7c4845b663532a8ee147c86f116381a6299cbee
|
|
| MD5 |
7f1daf106d0ff47fdf94448147503127
|
|
| BLAKE2b-256 |
a8161b89f7acb0980bffe4e8e6a57b272d168bf282c182e6f5aa0c80dd16a428
|
File details
Details for the file saclay_format-0.2.2-py3-none-any.whl.
File metadata
- Download URL: saclay_format-0.2.2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1459e6792c6fc3470a6823cdb548b0594d22c1c4ddc6115330c4c6a11ea716
|
|
| MD5 |
403ee744e5ad97481cb67cc99dee5d4e
|
|
| BLAKE2b-256 |
ee2d0031c495449f2979e6d6f2dd27eef7ef1e2d023baa4f14704b5f2843fbad
|