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

[WIP] Convert openPMD frontend to use openPMD-api #4848

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

henrynjones
Copy link

@henrynjones henrynjones commented Mar 9, 2024

This is a work in progress to change the openPMD frontend to be able to read in all openPMD markup files regardless of backend and add mesh refinement capabilities.

PR Summary

This work-in-progress PR addresses issue #4757 by using the backend-agnostic openPMD-api as the IO module instead of the previous h5py.

TODO

  • Add sorted particles to the particle grid in which they are located, for the short term this will only work for ADIOS2, file-based iteration encoded datasets with the particlePatches.

  • Ensure that HDF5 behavior is preserved if not improved.

    • For HDF5 files, record_component.available_chunks() only contains one chunk and all levels cover the entire domain. We might have to trim/mask higher level data so that only level 0 data exists on the entire domain, and each subsequent level covers only the refined region.
  • Still haven't looked at string handing for file path patterns. Would be great to load a dataset series from file-based iteration-encoded diagnostics. Right now yt uses [0-9] or dd???/dd??? or diag_name_??? while openpmd-api uses %T or %06T for example.

  • Testing has mostly been done using 2d WarpX simulations, where the axes are 'x' and 'z' which causes problems with axis labeling and the orientation of plots, and thus the annotation of particles onto SlicePlots. Work is being done to use the openpmd axis_labels (and later fortran capability with data_order?) to correctly align axes as written.

  • Eventually get to doing yt tests

PR Checklist

  • New features are documented, with docstrings and narrative docs
    • Modern mesh refinement tools similar to the boxlib frontend for ADIOS2 files. Right now this only seems to work with file-based iteration encoding schemes.
  • Adds a test for any bugs fixed. Adds tests for new features.

@chrishavlin
Copy link
Contributor

in addition to adding openPMD-api to on_demand_imports you'll want to add it to the pyproject.yaml file, which has optional dependencies organized by frontend, here's the current open-pmd entry:

open-pmd = ["yt[HDF5]"]

@yut23 yut23 mentioned this pull request May 6, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants