Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do data layout transpose internally when reading chunks #1708

Open
BenWibking opened this issue Dec 23, 2024 · 0 comments
Open

do data layout transpose internally when reading chunks #1708

BenWibking opened this issue Dec 23, 2024 · 0 comments

Comments

@BenWibking
Copy link

BenWibking commented Dec 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant