openPMD / openPMD/openPMD-api

Wrong dimensionality of default attributes

Open
#1,815 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
161
Forks
59
Avg merge
2d 22h
Merged PRs (30d)
7

Description

Without setting the mesh position, gridGlobalOffset, gridSpacing attributes explicitly `openPMD-api` writes default values. This happens for example when following the First Write example. These default values are integer and not arrays with the dimension of the dataset.

See example:
```
string /data/0/meshes/dens/axisLabels attr = {"x", "y", "z"}
string /data/0/meshes/dens/dataOrder attr = "C"
string /data/0/meshes/dens/geometry attr = "cartesian"
double /data/0/meshes/dens/gridGlobalOffset attr = 0
double /data/0/meshes/dens/gridSpacing attr = 1
double /data/0/meshes/dens/gridUnitSI attr = 1
double /data/0/meshes/dens/position attr = 0
```

According to the standard:
> type: 1-dimensional array containing N (float64 / REAL8) elements, where N is the number of dimensions in the simulation

So I think the single integer is not standard compliant, even if the value is identical for all? This breaks my scipp reader (I know, #1716 is still waiting for me to have time to finish it). Now do I need to support the single integer or is this an actual inconsistency with the standard?

Using openpmd 0.16.1 and adios2 bp5 backend

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.