LSSTApplications  15.0+21,16.0+1,16.0+3,16.0+4,16.0+8,16.0-1-g2115a9e+2,16.0-1-g4515a79+6,16.0-1-g5c6f5ee+4,16.0-1-g7bb14cc,16.0-1-g80120d7+4,16.0-1-g98efed3+4,16.0-1-gb7f560d+1,16.0-14-gb4f0cd2fa,16.0-2-g1ad129e+1,16.0-2-g2ed7261+1,16.0-2-g311bfd2,16.0-2-g568a347+3,16.0-2-g852da13+6,16.0-2-gd4c87cb+3,16.0-3-g099ede0,16.0-3-g150e024+3,16.0-3-g1f513a6,16.0-3-g958ce35,16.0-4-g08dccf71+4,16.0-4-g128aaef,16.0-4-g84f75fb+5,16.0-4-gcfd1396+4,16.0-4-gde8cee2,16.0-4-gdfb0d14+1,16.0-5-g7bc0afb+3,16.0-5-g86fb31a+3,16.0-6-g2dd73041+4,16.0-7-g95fb7bf,16.0-7-gc37dbc2+4,w.2018.28
LSSTDataManagementBasePackage
spatialCell.py
Go to the documentation of this file.
1 from lsst.pex.exceptions import NotFoundError
2 from ._spatialCell import SpatialCellCandidateIterator, SpatialCell
3 
4 __all__ = [] # import this module only for its side effects
5 
6 
8  while True:
9  try:
10  yield self.__deref__()
11  except NotFoundError:
12  return
13  self.__incr__()
14 
15 
16 SpatialCellCandidateIterator.__iter__ = spatialCellCandidateIter
17 
18 
19 def spatialCellIter(self):
20  return self.begin().__iter__()
21 
22 
23 SpatialCell.__iter__ = spatialCellIter
24 
25 
26 def spatialCellGetitem(self, idx):
27  idx = int(idx)
28  num_cells = len(self)
29  if idx < -num_cells or idx >= num_cells:
30  raise IndexError("idx={} < -{} or >= {})".format(idx,
31  num_cells, num_cells))
32  if idx < 0:
33  idx += num_cells
34  for i, cell in enumerate(self):
35  if i >= idx:
36  return cell
37 
38 
39 SpatialCell.__getitem__ = spatialCellGetitem
def spatialCellCandidateIter(self)
Definition: spatialCell.py:7
def spatialCellGetitem(self, idx)
Definition: spatialCell.py:26
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134