Skip to content

Commit b77cea4

Browse files
committed
Remove files and binfiles_set from StagyyData API
1 parent d018928 commit b77cea4

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

docs/sources/apiref/stagyydata.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ stagyydata
22
=============
33

44
.. automodule:: stagpy.stagyydata
5-
:members:
6-
:private-members:
7-
:exclude-members: _bind, _as_view_item, _read_refstate, _pass
5+
:members: _Scales, _Refstate, _Steps, _Snaps, _StepsView, StagyyData

stagpy/_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def geom(self):
289289
None if not available for this time step.
290290
"""
291291
if self._header is UNDETERMINED:
292-
binfiles = self.step.sdat.binfiles_set(self.step.isnap)
292+
binfiles = self.step.sdat._binfiles_set(self.step.isnap)
293293
if binfiles:
294294
self._header = stagyyparsers.fields(binfiles.pop(),
295295
only_header=True)

stagpy/stagyydata.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
def _as_view_item(obj):
18-
"""Return None or a suitable iterable to build a _StepView."""
18+
"""Return None or a suitable iterable to build a _StepsView."""
1919
try:
2020
iter(obj)
2121
return obj
@@ -327,7 +327,7 @@ def __getitem__(self, isnap):
327327
istep = self._isteps.get(
328328
isnap, None if self._all_isteps_known else UNDETERMINED)
329329
if istep is UNDETERMINED:
330-
binfiles = self.sdat.binfiles_set(isnap)
330+
binfiles = self.sdat._binfiles_set(isnap)
331331
if binfiles:
332332
istep = stagyyparsers.fields(binfiles.pop(), only_istep=True)
333333
else:
@@ -357,7 +357,7 @@ def __len__(self):
357357
rgx = re.compile(
358358
'^{}_([a-zA-Z]+)([0-9]{{5}})$'.format(out_stem))
359359
fstems = set(fstem for fstem in phyvars.FIELD_FILES)
360-
for fname in self.sdat.files:
360+
for fname in self.sdat._files:
361361
match = rgx.match(fname.name)
362362
if match is not None and match.group(1) in fstems:
363363
self._last = max(int(match.group(2)), self._last)
@@ -536,6 +536,7 @@ def __init__(self, path=None):
536536
steps (:class:`_Steps`): collection of time steps.
537537
snaps (:class:`_Snaps`): collection of snapshots.
538538
scales (:class:`_Scales`): dimensionful scaling factors.
539+
refstate (:class:`_Refstate`): reference state profiles.
539540
"""
540541
if path is None:
541542
path = conf.core.path
@@ -657,7 +658,7 @@ def rtimes(self):
657658
return self._rprof_and_times[1]
658659

659660
@property
660-
def files(self):
661+
def _files(self):
661662
"""Set of found binary files output by StagYY."""
662663
if self._rundir['ls'] is UNDETERMINED:
663664
out_stem = pathlib.Path(self.par['ioin']['output_file_stem'] + '_')
@@ -778,7 +779,7 @@ def filename(self, fname, timestep=None, suffix='', force_legacy=False):
778779
fpath = self.path / fpath
779780
return fpath
780781

781-
def binfiles_set(self, isnap):
782+
def _binfiles_set(self, isnap):
782783
"""Set of existing binary files at a given snap.
783784
784785
Args:
@@ -789,4 +790,4 @@ def binfiles_set(self, isnap):
789790
"""
790791
possible_files = set(self.filename(fstem, isnap, force_legacy=True)
791792
for fstem in phyvars.FIELD_FILES)
792-
return possible_files & self.files
793+
return possible_files & self._files

0 commit comments

Comments
 (0)