Skip to content

Commit 7aac569

Browse files
committed
_Snaps.bind becomes _Snaps._bind
The call to bind in Step.isnap is unecessary since it is already made is _Snaps.__getitem__. It hence makes sense to declare _bind as an internal method of _Snaps.
1 parent 38e0c0a commit 7aac569

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

docs/sources/apiref/stagyydata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ stagyydata
44
.. automodule:: stagpy.stagyydata
55
:members:
66
:private-members:
7-
:exclude-members: bind, _as_view_item, _read_refstate, _pass
7+
:exclude-members: _bind, _as_view_item, _read_refstate, _pass

stagpy/_step.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ def isnap(self):
443443
while (istep is None or istep < self.istep) and isnap < 99999:
444444
isnap += 1
445445
istep = self.sdat.snaps[isnap].istep
446-
self.sdat.snaps.bind(isnap, istep)
447446
# all intermediate istep could have their ._isnap to None
448447
if istep != self.istep:
449448
self._isnap = None

stagpy/stagyydata.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def __getitem__(self, isnap):
333333
else:
334334
istep = None
335335
if istep is not None:
336-
self.bind(isnap, istep)
336+
self._bind(isnap, istep)
337337
else:
338338
self._isteps[isnap] = None
339339
return self.sdat.steps[istep]
@@ -348,7 +348,7 @@ def __len__(self):
348348
if self.sdat.hdf5:
349349
isnap = -1
350350
for isnap, istep in stagyyparsers.read_time_h5(self.sdat.hdf5):
351-
self.bind(isnap, istep)
351+
self._bind(isnap, istep)
352352
self._last = isnap
353353
self._all_isteps_known = True
354354
if self._last < 0:
@@ -395,11 +395,9 @@ def at_time(self, time, after=False):
395395
igp -= 1
396396
return self[igp]
397397

398-
def bind(self, isnap, istep):
398+
def _bind(self, isnap, istep):
399399
"""Register the isnap / istep correspondence.
400400
401-
Users of :class:`StagyyData` should not use this method.
402-
403401
Args:
404402
isnap (int): snapshot index.
405403
istep (int): time step index.

0 commit comments

Comments
 (0)