do data layout transpose internally when reading chunks
- Dominant language
- C++
- Stars
- 161
- Forks
- 59
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 7
Description
**Is your feature request related to a problem? If so, please describe.**
Each reader plugin seems to have its own bespoke solution to transforming the data layout into that expected by the viz tool.
For example, the Paraview reader plugin uses `np.transpose` combined with `np.flatten(order='F')` to put the arrays in the order expected by VTK: https://gitlab.kitware.com/paraview/paraview/-/blob/master/Wrapping/Python/paraview/algorithms/openpmd.py#L423
https://gitlab.kitware.com/paraview/paraview/-/blob/master/Wrapping/Python/paraview/algorithms/openpmd.py#L434
However, the VisIt plugin appears to (only?) permute the axis labels, while leaving the arrays untouched (as far as I can tell): https://github.com/visit-dav/visit/blob/a2d6854d8c874939db44f15794d85090c8c1c01b/src/databases/OpenPMD/avtOpenPMDFileFormat.C#L301
This does not make a lot of sense, since VTK renders the data under the hood for both VisIt and Paraview.
**Describe the solution you'd like**
It would be great if this could be handled internally by openpmd-api, either by returning data arrays in a transposed layout in-memory, or by returning axis labels and particle coordinates that have been likewise transformed. The user should only have to specify the data layout they want returned, for example, in order of slowest-to-fastest-varying index.
**Describe alternatives you've considered**
N/A
**Additional context**
In some cases, Paraview reader and VisIt reader appear to display the example openPMD datasets differently: https://github.com/openPMD/openPMD-example-datasets
Contributor guide
Assessment
This issue has not been assessed yet.