Skip to content

Commit

Permalink
Merge pull request #358 from neutrinoceros/pluto/hdf5/bug/fix_regexp_…
Browse files Browse the repository at this point in the history
…subject

BUG: fix incorrect regexp subject (only match basenames, not entire paths)
  • Loading branch information
neutrinoceros authored Jan 17, 2025
2 parents 8356d47 + ea68f70 commit 3a8b921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yt_idefix/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _read_fluid_selection(self, chunks, selector, fields, size):
2 4.998045e+00 3.400969e-03 1458 single_file little rho vx1 vx2 vx3 prs tr1 tr2 tr3 Temp ndens PbykB mach
3 7.497932e+00 3.386245e-03 2186 single_file little rho vx1 vx2 vx3 prs tr1 tr2 tr3 Temp ndens PbykB mach
"""
if (match := re.search(r"\d{4}", self.ds.filename)) is not None:
if (match := re.search(r"\d{4}", self.ds.basename)) is not None:
entry = int(match.group())
else:
raise RuntimeError(f"Failed to parse output number from {self.ds.filename}")
Expand Down

0 comments on commit 3a8b921

Please sign in to comment.