Open
Description
Describe the bug
Currently, read_iterations()
cannot be looped multiple times.
Error message:
openpmd_api.openpmd_api_cxx.ErrorWrongAPIUsage:
Wrong API usage: Trying to call Series::readIterations() on a (partially) read Series.
This is a bit unusual, since it should start over on the same open series, at least in regular/random access mode (non-streaming.)
To Reproduce
Python:
import openpmd_api as io
# ...
series = io.Series(filename, io.Access_Type.read_only)
# start-to-end read:
for count, iteration in enumerate(series.read_iterations()):
pass
# another start-to-end read:
for count, iteration in enumerate(series.read_iterations()):
pass
Expected behavior
Usually in Python on generators/iterators, one should start iterations over when reading files that way.
Software Environment
- version of openPMD-api: 0.15.0 & 0.15.1
- installed openPMD-api via: conda
- operating system: Linux
- machine: any
- name and version of Python implementation: any
- version of HDF5: hdf5 1.12.2 (nompi_ha7af310_101)
- version of ADIOS1: N/A
- version of ADIOS2: N/A
- name and version of MPI: none
Additional context
First seen by @s-sajid-ali.