LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.pipe.tasks.repositoryIterator Namespace Reference

Classes

class  SourceData
 
class  RepositoryInfo
 
class  RepositoryIterator
 

Functions

def _getDTypeList
 

Variables

int STR_PADDING = 5
 

Function Documentation

def lsst.pipe.tasks.repositoryIterator._getDTypeList (   keyTuple,
  valTuple 
)
private
Construct a numpy dtype for a data ID or repository ID

@param[in] keyTuple: ID key names, in order
@param[in] valTuple: a value tuple
@return numpy dtype as a list

@warning: this guesses at string length (STR_PADDING + length of string in valTuple);
longer strings will be truncated when inserted into numpy structured arrays

Definition at line 34 of file repositoryIterator.py.

34 
35 def _getDTypeList(keyTuple, valTuple):
36  """Construct a numpy dtype for a data ID or repository ID
37 
38  @param[in] keyTuple: ID key names, in order
39  @param[in] valTuple: a value tuple
40  @return numpy dtype as a list
41 
42  @warning: this guesses at string length (STR_PADDING + length of string in valTuple);
43  longer strings will be truncated when inserted into numpy structured arrays
44  """
45  typeList = []
46  for name, val in itertools.izip(keyTuple, valTuple):
47  if isinstance(val, str):
48  predLen = len(val) + STR_PADDING
49  typeList.append((name, str, predLen))
50  else:
51  typeList.append((name, numpy.array([val]).dtype))
52  return typeList

Variable Documentation

int lsst.pipe.tasks.repositoryIterator.STR_PADDING = 5

Definition at line 31 of file repositoryIterator.py.