Class AnnotatedColumn
source code
object --+
|
AnnotatedColumn
A collection of annotations for a column.
ColumnAnntotations are constructed with columns and retain a
reference to them ("original").
In addition, they provide a getitem/setitem interface to a
dictionary that contains "digested" information on the column.
This dictionary serves as an accumulator for information useful
during the serialization process.
The main reason for this class is that Columns are supposed to be
immutable; thus, any ephemeral information needs to be kept in a
different place. In particular, the mapper factories receive such
annotations.
As a special service to coerce internal tables to external standards,
you can pass a votCast dictionary to AnnotatedColumn. Give any
key/value pairs in there to override what AnnotatedColumn guesses
or infers. This is used to force the sometimes a bit funky
SCS/SIAP types to standard values.
The castMapperFactory enabled by default checks for the presence of
a castFunction in an AnnotatedColumn. If it is there, it will be used
for mapping the values, so this is another thing you can have in votCast.
The SerManager tries to obtain votCasts from a such-named
attribute on the table passed in.
Though of course clients can access original, the mapping facets should
only be accessed through getitem/setitem since they may be updated
wrt what is in original.
Attributes available via the setitem/getitem interface include:
- nullvalue -- a suitable nullvalue for this column, if provided by the
column's values or otherwise obtained
- name -- a name for the column
- dbtype -- the column's database type
- xtype -- the column's xtype (e.g., "timestamp")
- datatype, arraysize -- a VOTable type for the column
- displayHint -- a parsed display hint
- note -- a reference to a table not (these get entered by SerManager)
- ucd, utype, unit, description -- as for column
- id -- a string suitable as XML id (externally managed)
- votablewrite would evaluate min and max (but right now nothing adds
this)
|
__init__(self,
column,
votCast=None)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
__init__(self,
column,
votCast=None)
(Constructor)
| source code
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|