From 034b1ee1999731c00c9f3e7c5bc6cd3d9b16da66 Mon Sep 17 00:00:00 2001 From: Chris Byrohl <9221545+cbyrohl@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:54:25 +0200 Subject: [PATCH] fix millenium load --- src/scida/io/_base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scida/io/_base.py b/src/scida/io/_base.py index 89990e8..f32ea5c 100644 --- a/src/scida/io/_base.py +++ b/src/scida/io/_base.py @@ -1002,10 +1002,15 @@ def _get_chunkedfiles( files_numbered = [] for f in files: try: - numbers.append(int(f.split(".")[-2])) + numbers.append( + int(f.split(".")[-2]) + ) # first check that we have the format prefix_SNAPID.CHUNKID.FORMAT files_numbered.append(f) except ValueError: - pass # do not add file + # if this fails, we might have the format prefix.SNAPID.FORMAT in a single file (otherwise ignore file) + if len(files) == 1: + numbers.append(0) + files_numbered.append(f) sortidx = np.argsort(numbers) files_numbered = np.array(files_numbered) files = files_numbered[sortidx]