Skip to content

Commit cc648c6

Browse files
committed
mv rest of stagyyparsers into h5.extras
This is only the isnap/istep collection from `time_botT.h5`
1 parent 693b130 commit cc648c6

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/stagpy/_caching.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from . import parsers, phyvars
1111
from .error import InvalidSnapshotError
12-
from .parsers import stagyyparsers
1312

1413
if typing.TYPE_CHECKING:
1514
from collections.abc import Mapping
@@ -98,7 +97,7 @@ def _info(self) -> StepSnapInfo:
9897
isnap = -1
9998
step_to_snap = {}
10099
snap_to_step = {}
101-
for isnap, istep in stagyyparsers.read_time_h5(self.sdat.hdf5):
100+
for isnap, istep in parsers.h5.extras.isnap_istep(self.sdat.hdf5):
102101
step_to_snap[istep] = isnap
103102
snap_to_step[isnap] = istep
104103
return StepSnapInfo(

src/stagpy/parsers/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# ruff: noqa: F401
2+
3+
"""Parsers of StagYY output files.
4+
5+
Note:
6+
These functions are low level utilities. You should not use these unless
7+
you know what you are doing. To access StagYY output data, use an instance
8+
of [`StagyyData`][stagpy.stagyydata.StagyyData].
9+
"""
10+
211
from . import bin, h5, txt

src/stagpy/parsers/h5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# ruff: noqa: F401
22
"""Parsers of hdf5 files."""
33

4-
from . import field, rprof, tracers, tseries
4+
from . import extras, field, rprof, tracers, tseries
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
"""Parsers of StagYY output files.
2-
3-
Note:
4-
These functions are low level utilities. You should not use these unless
5-
you know what you are doing. To access StagYY output data, use an instance
6-
of [`StagyyData`][stagpy.stagyydata.StagyyData].
7-
"""
8-
91
from __future__ import annotations
102

113
import typing
@@ -17,7 +9,7 @@
179
from pathlib import Path
1810

1911

20-
def read_time_h5(h5folder: Path) -> Iterator[tuple[int, int]]:
12+
def isnap_istep(h5folder: Path) -> Iterator[tuple[int, int]]:
2113
"""Iterate through (isnap, istep) recorded in h5folder/'time_botT.h5'.
2214
2315
Args:

0 commit comments

Comments
 (0)