tvaLib
Public Member Functions | Public Attributes | List of all members
lib.scene.Cluster Class Reference
Inheritance diagram for lib.scene.Cluster:

Public Member Functions

def __init__ (self, cluster, config)
 
def __getitem__ (self, i)
 
def __len__ (self)
 
def __iter__ (self)
 

Public Attributes

 idx
 
 name
 
 xref_dbname
 
 analyses
 
 site_analyses
 
 labels
 
 colours
 
 plot_sites
 
 size
 

Detailed Description

Definition at line 587 of file scene.py.

Constructor & Destructor Documentation

◆ __init__()

def lib.scene.Cluster.__init__ (   self,
  cluster,
  config 
)
Each entry is a single cluster out of a group defined by a common 
    cluster.name . Point to specific site_analyses and/or to analyses
    as a whole.
    
    xref_dbname can also be used to cross-reference a different
    database name. This database has to be placed in the same folder as
    the parent cluster folder.
    
    The order of clusters determines the cluster number.

Definition at line 588 of file scene.py.

588  def __init__(self, cluster, config):
589  ''' Each entry is a single cluster out of a group defined by a common
590  cluster.name . Point to specific site_analyses and/or to analyses
591  as a whole.
592 
593  xref_dbname can also be used to cross-reference a different
594  database name. This database has to be placed in the same folder as
595  the parent cluster folder.
596 
597  The order of clusters determines the cluster number.
598  '''
599  tvaLib.Constructors.SuperList.__init__(self)
600  self.idx = cluster.idx
601  self.name = cluster.name
602  self.xref_dbname = tvaLib.Constructors.SuperListParse(cluster.xref_dbname, type='str', dimension=1, removeEmpty=False)
603  self.analyses = tvaLib.Constructors.SuperListParse(cluster.analyses, type='int', dimension=1)
604  self.site_analyses = tvaLib.Constructors.SuperListParse(cluster.site_analyses, type='int', dimension=1)
605  self.labels = tvaLib.Constructors.SuperListParse(cluster.labels, type='str', dimension=1, removeEmpty=False)
606  self.colours = tvaLib.Constructors.SuperListParse(cluster.colours, type='str', dimension=1, removeEmpty=False)
607  self.plot_sites = cluster.plot_sites
608  self.size = max(len(self.xref_dbname), len(self.analyses), len(self.site_analyses), len(self.labels), len(self.colours))
609  if(not self.site_analyses): self.site_analyses = [None for x in range(self.size)]
610  if(not self.labels): self.labels = ['' for x in range(self.size)]
611  return

Member Function Documentation

◆ __getitem__()

def lib.scene.Cluster.__getitem__ (   self,
  i 
)

Definition at line 612 of file scene.py.

612  def __getitem__(self, i): return self.analyses[i]

◆ __iter__()

def lib.scene.Cluster.__iter__ (   self)

Definition at line 614 of file scene.py.

614  def __iter__(self): return iter(zip(self.xref_dbname, self.analyses, self.site_analyses, self.labels, self.colours))
615 
616 
617 

◆ __len__()

def lib.scene.Cluster.__len__ (   self)

Definition at line 613 of file scene.py.

613  def __len__(self): return self.size

Member Data Documentation

◆ analyses

lib.scene.Cluster.analyses

Definition at line 603 of file scene.py.

◆ colours

lib.scene.Cluster.colours

Definition at line 606 of file scene.py.

◆ idx

lib.scene.Cluster.idx

Definition at line 600 of file scene.py.

◆ labels

lib.scene.Cluster.labels

Definition at line 605 of file scene.py.

◆ name

lib.scene.Cluster.name

Definition at line 601 of file scene.py.

◆ plot_sites

lib.scene.Cluster.plot_sites

Definition at line 607 of file scene.py.

◆ site_analyses

lib.scene.Cluster.site_analyses

Definition at line 604 of file scene.py.

◆ size

lib.scene.Cluster.size

Definition at line 608 of file scene.py.

◆ xref_dbname

lib.scene.Cluster.xref_dbname

Definition at line 602 of file scene.py.


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