From f872f3ce0ada8a00190b3a907812807184a5a268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 4 Oct 2023 15:29:17 +0200 Subject: [PATCH] Add fix --- src/ReadIterations.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ReadIterations.cpp b/src/ReadIterations.cpp index e92ede964f..41edd4ed05 100644 --- a/src/ReadIterations.cpp +++ b/src/ReadIterations.cpp @@ -88,7 +88,20 @@ void SeriesIterator::initSeriesInLinearReadMode() case PP::UpFront: series.readGorVBased( /* do_always_throw_errors = */ false, /* init = */ true); - series.advance(AdvanceMode::BEGINSTEP); + /* + * In linear read mode (where no parsing at all is done upon + * constructing the Series), it might turn out after parsing + * that what we expected to be a group-based Series was in fact + * a single file of a file-based Series. + * (E.g. when opening "data00000100.h5" directly instead of + * "data%T.h5") + * So we need to check the current value of + * `iterationEncoding()` once more. + */ + if (series.iterationEncoding() != IterationEncoding::fileBased) + { + series.advance(AdvanceMode::BEGINSTEP); + } break; } data.parsePreference = *fOpen.out_parsePreference;