Skip to content

Support prt.bp data#33

Merged
JamesMcClung merged 20 commits into
mainfrom
adios-prt
Apr 28, 2026
Merged

Support prt.bp data#33
JamesMcClung merged 20 commits into
mainfrom
adios-prt

Conversation

@JamesMcClung
Copy link
Copy Markdown
Owner

Initial, somewhat hacky support of loading adios2's bp-format particle data, as will be implemented in a future PSC PR.

The hacky part is how the loaders are registered for each species variant, since in principle the prefixes (prt.i, prt.e, etc.) can have arbitrary species names.

I'm also not particularly happy with how species are "discovered" from the last PR, but that's another matter.

JamesMcClung and others added 20 commits April 27, 2026 15:40
the cases were reran. Field data and all plots (including prt) was identical,
but something in the h5 files clearly is different.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Needed so BP-loaded particle data (no per-particle q/m columns) can flow
through SpeciesFilter. Semantically a no-op on H5 single-species data.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Scan the data dir for prt.<species_key>.*.bp files at parser build time and
register a ParticleLoaderBp under each. The loader itself is a stub here; its
get_data() raises NotImplementedError until Task 6.

Note: BP "files" are directories in ADIOS2's layout, so the scan accepts both.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
dd.DataFrame.assign(t=scalar) creates a broadcast-scalar column whose
to_dask_array() trips an IndexError in dask-expr's optimizer when the source
dataframe came from xarray's to_dask_dataframe. map_partitions produces a
proper per-row column that survives the optimizer.

Co-Authored-By: Claude <noreply@anthropic.com>
Each new test in test_plots.py shares a baseline PNG with its H5 counterpart
via pytest-mpl's filename= marker. Since test-2d and test-3d BP data was
generated from the same PSC runs as the H5 data, the plots match within
tolerance=2.

Also fix particle_bp to look up var_info under the "prt" prefix rather than
"prt.<species_key>"; the registry is keyed by the bare prefix, so without
this the BP path fell back to raw column names (e.g. "py" instead of "u_y").

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@JamesMcClung JamesMcClung added the enhancement New feature or request label Apr 28, 2026
@JamesMcClung JamesMcClung merged commit 1093341 into main Apr 28, 2026
1 check passed
@JamesMcClung JamesMcClung deleted the adios-prt branch April 28, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant