AMReX-Codes / pyamrex

GPU-Enabled, Zero-Copy AMReX Python Bindings including AI/ML
http://pyamrex.readthedocs.io
Other
35 stars 19 forks source link

Pandas: `ParticleContainer_*.to_df()` #220

Closed ax3l closed 11 months ago

ax3l commented 11 months ago

Copy all particles into a pandas.DataFrame. Supports local and MPI-gathered results.

Future Directions (Attribute Names in AMReX)

At the moment, we make up generic names for the AoS and SoA attributes when we convert them to numpy, cupy and pandas.

It would generally be nice if AMReX supported the functionality to name particle attributes. In WarpX, we added this as NamedParticleContainer, but as a mainstream implementation we could avoid deriving yet another class type (because if we do, we will again have additional compile-time to bind that custom type in pyAMReX), and instead could just extend the particle classes with these runtime details.

Future Directions (Write)

Once the AMReX SoA transition is complete in:

we might even be able to provide node-local, zero-copy write access in Pandas and cuDF particle data frames... (follow-up PRs).