Skip to content

Commit

Permalink
fix millenium load / single chunk snapshots (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbyrohl authored Sep 17, 2024
1 parent 126bf11 commit 9ce5bc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/scida/io/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9ce5bc5

Please sign in to comment.