LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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.