All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
manageDataRunDefinitions.SampleInfo Class Reference

Public Member Functions

def __init__
 
def isRunDefined
 
def isStageComplete
 
def isStreamComplete
 
def isProjectVersionComplete
 
def isComplete
 
def defName
 
def copy
 
def __str__
 

Static Public Member Functions

def makeOptionList
 
def hasOptions
 

Public Attributes

 run
 
 stage
 
 stream
 
 projectVersion
 

Static Private Member Functions

def _isIterable
 
def _copyList
 

Detailed Description

Definition at line 31 of file manageDataRunDefinitions.py.

Constructor & Destructor Documentation

def manageDataRunDefinitions.SampleInfo.__init__ (   self,
  run = None,
  stage = None,
  stream = None,
  projectVersion = None 
)

Definition at line 32 of file manageDataRunDefinitions.py.

32 
33  def __init__(self, run=None, stage=None, stream=None, projectVersion=None, ):
34  self.run = SampleInfo._copyList(run)
35  self.stage = SampleInfo._copyList(stage)
36  self.stream = SampleInfo._copyList(stream)
self.projectVersion = SampleInfo._copyList(projectVersion)

Member Function Documentation

def manageDataRunDefinitions.SampleInfo.__str__ (   self)

Definition at line 79 of file manageDataRunDefinitions.py.

79 
80  def __str__(self):
81  s = f"run {self.run if self.run else 'unspecified'}"
82  if self.stage: s += f", stage {self.stage}"
83  if self.stream: s += f", stream {self.stream}"
84  if self.projectVersion: s += f", project version {self.projectVersion}"
return s
def manageDataRunDefinitions.SampleInfo._copyList (   value)
staticprivate

Definition at line 99 of file manageDataRunDefinitions.py.

99 
100  def _copyList(value):
101  return value[:] if SampleInfo._isIterable(value) else value
102 
103 # class SampleInfo
104 
105 
# ------------------------------------------------------------------------------
def manageDataRunDefinitions.SampleInfo._isIterable (   value)
staticprivate

Definition at line 96 of file manageDataRunDefinitions.py.

96 
97  def _isIterable(value): return hasattr(value, "__iter__")
def manageDataRunDefinitions.SampleInfo.copy (   self,
  kwargs 
)

Definition at line 71 of file manageDataRunDefinitions.py.

71 
72  def copy(self, **kwargs):
73  kwargs.setdefault('run', self.run)
74  kwargs.setdefault('stage', self.stage),
75  kwargs.setdefault('stream', self.stream),
76  kwargs.setdefault('projectVersion', self.projectVersion),
return SampleInfo(**kwargs)
def manageDataRunDefinitions.SampleInfo.defName (   self)

Definition at line 58 of file manageDataRunDefinitions.py.

58 
59  def defName(self):
60  components = [ ExperimentName, 'data' ]
61  if self.isRunDefined() and self.run is not None:
62  components.append(f"run{self.run}")
63  if self.isStageComplete() and self.stage is not None:
64  components.append(self.stage)
65  if self.isStreamComplete() and self.stream is not None:
66  components.append(self.stream)
67  if self.isProjectVersionComplete() and self.projectVersion is not None:
68  components.append(self.projectVersion)
return "_".join(filter(None, components))
Framework includes.
S join(S const &sep, Coll const &s)
Returns a concatenation of strings in s separated by sep.
def manageDataRunDefinitions.SampleInfo.hasOptions (   value)
static

Definition at line 92 of file manageDataRunDefinitions.py.

92 
93  def hasOptions(value):
94  return SampleInfo._isIterable(value) and not isinstance(value, str)
def manageDataRunDefinitions.SampleInfo.isComplete (   self,
  returns,
  if,
  there,
  are,
  no,
  ambiguities,
  left,
  in,
  the,
  info 
)

Definition at line 53 of file manageDataRunDefinitions.py.

53 
54  def isComplete(self) -> "returns if there are no ambiguities left in the info":
55  return self.isRunDefined() and self.isStageComplete() \
and self.isStreamComplete() and self.isProjectVersionComplete()
def manageDataRunDefinitions.SampleInfo.isProjectVersionComplete (   self,
  returns,
  if,
  project,
  version,
  is,
  collapsed,
  to,
  a,
  value 
)

Definition at line 50 of file manageDataRunDefinitions.py.

50 
51  def isProjectVersionComplete(self) -> "returns if project version is collapsed to a value":
52  return not SampleInfo.hasOptions(self.projectVersion)
def manageDataRunDefinitions.SampleInfo.isRunDefined (   self,
  returns,
  if,
  run,
  is,
  collapsed,
  to,
  a,
  value 
)

Definition at line 39 of file manageDataRunDefinitions.py.

39 
40  def isRunDefined(self) -> "returns if run is collapsed to a value":
41  return not SampleInfo.hasOptions(self.run) \
and (AllowAllRuns or self.run is not None)
def manageDataRunDefinitions.SampleInfo.isStageComplete (   self,
  returns,
  if,
  stage,
  is,
  collapsed,
  to,
  a,
  value 
)

Definition at line 44 of file manageDataRunDefinitions.py.

44 
45  def isStageComplete(self) -> "returns if stage is collapsed to a value":
46  return not SampleInfo.hasOptions(self.stage)
def manageDataRunDefinitions.SampleInfo.isStreamComplete (   self,
  returns,
  if,
  stream,
  is,
  collapsed,
  to,
  a,
  value 
)

Definition at line 47 of file manageDataRunDefinitions.py.

47 
48  def isStreamComplete(self) -> "returns if stream is collapsed to a value":
49  return not SampleInfo.hasOptions(self.stream)
def manageDataRunDefinitions.SampleInfo.makeOptionList (   value)
static

Definition at line 88 of file manageDataRunDefinitions.py.

88 
89  def makeOptionList(value):
90  return value if SampleInfo.hasOptions(value) else [ value ]

Member Data Documentation

manageDataRunDefinitions.SampleInfo.projectVersion

Definition at line 36 of file manageDataRunDefinitions.py.

manageDataRunDefinitions.SampleInfo.run

Definition at line 33 of file manageDataRunDefinitions.py.

manageDataRunDefinitions.SampleInfo.stage

Definition at line 34 of file manageDataRunDefinitions.py.

manageDataRunDefinitions.SampleInfo.stream

Definition at line 35 of file manageDataRunDefinitions.py.


The documentation for this class was generated from the following file: