openPMD / openPMD-api

:floppy_disk: C++ & Python API for Scientific I/O
https://openpmd-api.readthedocs.io
GNU Lesser General Public License v3.0
134 stars 51 forks source link

Don't require unitSI when reading a patch record component #1470

Closed franzpoeschel closed 1 year ago

franzpoeschel commented 1 year ago

The openPMD standard is not quite clear if unitSI is required for patch record components. At least for numParticles and numParticlesOffset, they don't really make sense. The openPMD-api currently requires that these attributes are set and will fail at reading time if they are not (and subsequently skip the components).

With this PR, the openPMD-api ignores if they are not present, but still writes them to maintain compatibility with versions of the openPMD-api that are not so lenient.