Package gavo :: Package adql :: Module fieldinfo :: Class FieldInfo
[frames] | no frames]

Class FieldInfo

source code

object --+
         |
        FieldInfo

is a container for meta information on columns.

It is constructed with a unit, a ucd and userData. UserData is a sequence of opaque objects. A FieldInfo combined from more than one FieldInfo will have all userDatas of the combined FieldInfos in its userData attribute.

There's also a properties dictionary you can use to set arbitrary keys in. These should not be inherited. This is used for:

Instance Methods
 
__init__(self, type, unit, ucd, userData=(), tainted=False, stc=None, sqlName=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
change(self, **kwargs) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
fromMulExpression(cls, opr, fi1, fi2)
returns a new FieldInfo built from the multiplication-like operator opr and the two field infos.
source code
 
fromAddExpression(cls, opr, fi1, fi2, forceType=None)
returns a new FieldInfo built from the addition-like operator opr and the two field infos.
source code
Static Methods
 
combineUserData(fi1, fi2) source code
 
combineSTC(fi1, fi2)
tries to find a common STC system for fi1 and fi2.
source code
Properties

Inherited from object: __class__

Method Details

__init__(self, type, unit, ucd, userData=(), tainted=False, stc=None, sqlName=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

combineSTC(fi1, fi2)
Static Method

source code 

tries to find a common STC system for fi1 and fi2.

Two STC systems are compatible if at least one is None or if they are equal.

If this method discovers incompatible systems, it will set the stc attribute to "BROKEN".

fromMulExpression(cls, opr, fi1, fi2)
Class Method

source code 

returns a new FieldInfo built from the multiplication-like operator opr and the two field infos.

The unit is unit1 opr unit2 unless we have a dimless (empty unit), in which case we keep the unit but turn the tainted flag on, unless both are empty.

The ucd is always empty unless it's a simple dimless multiplication, in which case the ucd of the non-dimless is kept (but the info is tainted).

fromAddExpression(cls, opr, fi1, fi2, forceType=None)
Class Method

source code 

returns a new FieldInfo built from the addition-like operator opr and the two field infos.

If both UCDs and units are the same, they are kept. Otherwise, they are cleared and the fieldInfo is tainted.