https://github.com/openpmd/openpmd-validator
:ballot_box_with_check: Validator and Example Scripts
https://github.com/openpmd/openpmd-validator
community fileformat openpmd openscience research validation
Last synced: 4 months ago
JSON representation
:ballot_box_with_check: Validator and Example Scripts
- Host: GitHub
- URL: https://github.com/openpmd/openpmd-validator
- Owner: openPMD
- License: isc
- Created: 2015-09-01T11:38:00.000Z (over 10 years ago)
- Default Branch: 1.1.X
- Last Pushed: 2025-01-02T23:33:41.000Z (about 1 year ago)
- Last Synced: 2025-09-08T21:53:25.677Z (5 months ago)
- Topics: community, fileformat, openpmd, openscience, research, validation
- Language: Python
- Homepage:
- Size: 313 KB
- Stars: 6
- Watchers: 5
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# openPMD Validator Scripts

[](https://opensource.org/licenses/ISC)
This repository contains scripts to validate existing files that (claim to)
implement the [openPMD Standard](https://github.com/openPMD/openPMD-standard)
in version `1.1.*`.
Additional scripts to create random/empty files with the valid markup of the
standard are also provided.
## Rationale
These tools are intended for developers that want to implementent the standard.
They were written to allow an easy *implement-test-correct* workflow without
the hazzle to check every word of the written standard twice.
Nevertheless, these scripts can not validate 100% of the standard and uncovered
sections shall be cross-checked manually with the words of the written
standard.
For more information on requirements for implementations, please refer to the
section
[*Implementations*](https://github.com/openPMD/openPMD-standard/blob/1.1.0/STANDARD.md#implementations)
of the openPMD standard. The repository
[openPMD-projects](https://github.com/openPMD/openPMD-projects)
also lists a large collection of open source projects that already implement
the openPMD standard.
## Install
[](https://pypi.python.org/pypi/openPMD-validator)
[](https://spack.io)
[](https://anaconda.org/conda-forge/openpmd-validator)
Choose *one* of the install methods below to get started:
### PyPI
```bash
# optional: append --user
pip install openPMD-validator==1.1.0.6
```
### Spack
```bash
spack install py-openpmd-validator@1.1.0.6 ^py-h5py~mpi
spack load --dependencies py-openpmd-validator@1.1.0.6 ^py-h5py~mpi
```
### Conda
```bash
conda install -c conda-forge openpmd-validator
```
### From Source
```bash
wget https://github.com/openPMD/openPMD-validator/archive/1.1.0.6.tar.gz
tar -xf 1.1.0.6.tar.gz
cd openPMD-validator-1.1.0.6/
# optional: append --user
python setup.py install
```
## Usage
### CLI
We provide the command-line tools for individual files:
```bash
# optional: create dummy example files
openPMD_createExamples_h5
# validate
openPMD_check_h5 -i example.h5
# optional: append --EDPIC for the Partice-in-Cell Extension
```
### Module
Additionally, the validator tools can be used as *Python module* in your projects, e.g. to verify a file before opening it for reading.
**Create:**
```python
from openpmd_validator import createExamples_h5
# create "example.h5"
createExamples_h5.main()
```
**Check:**
```python
from openpmd_validator import check_h5
result_array = check_h5.check_file("example.h5", verbose=False)
print("Result: %d Errors and %d Warnings."
%( result_array[0], result_array[1]))
```
## Development
The development of these scripts is carried out *per-branch*.
Each branch corresponds to a certain version of the standard and might
be updated in case tests did contain bugs or we found a way to cover more
sections of the standard.