pisces.particles.utils.inspect_particle_count#
- pisces.particles.utils.inspect_particle_count(path: str | Path) dict[str, int] [source]#
Inspect the number of particles in each species group of a particle dataset without fully loading the file.
This function:
Opens the HDF5 particle file at the top level.
Iterates over all top-level groups (each representing a particle species).
Skips any group with the attribute
NOT_PARTICLE_GROUP
set to a truthy value.Reads the
NUMBER_OF_PARTICLES
attribute from each valid particle group.
- Parameters:
- Returns:
Mapping of particle group names to integer particle counts.
- Return type:
- Raises:
FileNotFoundError – If the file does not exist or is not a regular file.
ValueError – If a valid particle group is missing the required
NUMBER_OF_PARTICLES
attribute.