Open agolovanov opened 1 year ago
Oh, good catch!
@RemiLehe and I took a look at it. The comment is a typo, it meant to say skip constant records
.
Anyway, we also want to filter constant records :sweat_smile:
We will correct that, thx @RemiLehe for volunteering.
If particle data for a particular species contains only one particle, the
select
filter is not taken into account.Take, for example, attached data which is an OpenPMD file containing a single particle dataset
data/2997/particles/electrons_oxygen_7
with only one particle (all other datasets have been removed). Try reading with openPMD-viewer:Now
data
contains:The expected result is
data
should be empty as the value of 0.49 is not between 20 and 150, so this single data point should have been filtered out.This happens because the
utilities.apply_selection
has the following condition which specifically ignores the filter for the case of 1 particle:Perhaps this condition is relevant to some other cases when the record is truly scalar. But in my case, the record is not scalar, just sometimes for some iterations and species the number of particles in species turns out to be exactly equal to 1, and then I get incorrect results. Correspondingly, for datasets with 0 or 2+ particles, filtering works correctly, so only 1 particle is problematic.