Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
generic.models.PlotInfo.CanvasSummary Class Reference
Inheritance diagram for generic.models.PlotInfo.CanvasSummary:
object

Classes

class  _MethodWrapper
 

Public Member Functions

def __init__ (self, name, kwargs)
 

Public Attributes

 name
 
 num_plots
 
short int type
 
short int number
 
cat_entry star
 

Static Public Attributes

list INFORMATION
 
 GETTERS
 
 wrapper
 

Detailed Description

Type just for collecting information about a canvas that will be shown on a page. 

Definition at line 89 of file PlotInfo.py.

Constructor & Destructor Documentation

def generic.models.PlotInfo.CanvasSummary.__init__ (   self,
  name,
  kwargs 
)

Definition at line 131 of file PlotInfo.py.

131  def __init__(self, name, **kwargs):
132  self.name = name
133 
134  # maybe they gave me the plots themselves
135  if "plots" in kwargs:
136 # print kwargs["plots"]
137  for prop_name, getter in CanvasSummary.GETTERS.iteritems():
138  setattr(self, prop_name, [getter(h) for h in kwargs["plots"]])
139  del kwargs["plots"]
140 
141  self.num_plots = max( len(kwargs[prop]) for prop in CanvasSummary.INFORMATION if prop in kwargs and not isinstance(kwargs[prop], basestring) )
142 
143  # or maybe they passed me the information directly
144  for attr in CanvasSummary.INFORMATION:
145  # don't overwrite values obtained from a plot with None
146  val = kwargs[attr] if attr in kwargs else [None,]*self.num_plots
147  if any(val) or not hasattr(self, attr):
148  setattr(self, attr, val)
149  if attr in kwargs:
150  del kwargs[attr]
151 
152  if len(kwargs) > 0:
153  raise AttributeError("Unexpected argument to %s: '%s'", (self.__class__, attr))
154 
def __init__(self, name, kwargs)
Definition: PlotInfo.py:131
char name[SIZE_OF_OBJ_NAME]
Definition: novas.h:116
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68

Member Data Documentation

generic.models.PlotInfo.CanvasSummary.GETTERS
static

Definition at line 119 of file PlotInfo.py.

list generic.models.PlotInfo.CanvasSummary.INFORMATION
static
Initial value:
1 = [
2  "name",
3  "titles",
4  "labels",
5  "exposures",
6  "means",
7  "nums_entries",
8  "peak_locations",
9  "RMSs",
10  ]

Definition at line 91 of file PlotInfo.py.

generic.models.PlotInfo.CanvasSummary.name
generic.models.PlotInfo.CanvasSummary.num_plots

Definition at line 141 of file PlotInfo.py.

short int object::number
inherited

Definition at line 115 of file novas.h.

cat_entry object::star
inherited

Definition at line 117 of file novas.h.

short int object::type
inherited

Definition at line 114 of file novas.h.

generic.models.PlotInfo.CanvasSummary.wrapper
static

Definition at line 120 of file PlotInfo.py.


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