openPMD-standard icon indicating copy to clipboard operation
openPMD-standard copied to clipboard

No standard-conforming way to define a Series that only has meshes (resp. particles) in some iterations

Open franzpoeschel opened this issue 4 years ago • 2 comments

Issue first noticed while working on this PR for the openPMD API. Quoting the technical files on meshesPath and particlesPath:

  • note: if this attribute is missing, the file is interpreted as if it contains no mesh records! If the attribute is set, the group behind it must exist! […]
  • note: if this attribute is missing, the file is interpreted as if it contains no particle records! If the attribute is set, the group behind it must exist!

Since both these attributes live at the root level of the hierarchy and cannot be defined specifically per iteration, this makes it impossible to have a Series where only some, but not all iterations contain meshes/particles. If I'm not mistaken, this holds true for file-based as well as group-based iteration layout. So, I suggest replacing

the group behind it must exist

with

the group behind it may or may not exist

Reading software would then need to check for group existence.

franzpoeschel avatar Mar 16 '21 08:03 franzpoeschel

Thank you for raising this. We introduced the clarification in openPMD 1.1 to ease readers, but the choice should indeed be considered a defect.

It's easier to check for existence at read time than the problem it introduces at write time. I am still thinking if we should also mak the attribute optional, which is clearer for purely mesh- or particle-containing series. This then means we need at read time two checks: attribute exists (y/n) - no means no meshes/particles in the series - and then value points to something existing (y/n).

ax3l avatar Mar 17 '21 04:03 ax3l

This then means we need at read time two checks: attribute exists (y/n) - no means no meshes/particles in the series - and then value points to something existing (y/n).

So, a one-sided implication? Current rule: mesh group exists <-> meshesPath is set Your suggestion: mesh group exists -> meshesPath is set

If yes, sounds good with me.

franzpoeschel avatar Mar 17 '21 15:03 franzpoeschel