Home | Trees | Indices | Help |
|
---|
|
Common definitions for the GAVO VOTable modules.
Classes | |
VOTableError The base class of VOTable-related errors. |
|
BadVOTableLiteral Raised when a literal in a VOTable is invalid. |
|
BadVOTableData Raised when something is wrong with a value being inserted into a VOTable. |
|
VOTableParseError Raised when something is grossly wrong with the document structure. |
|
NULLFlags an interface to the BINARY2 NULL flags. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
NaN = nan
|
|
__package__ =
|
Function Details |
a dumb handler for decoder errors. This is like python's "replace" handler except that we'll always return question marks rather than ufffd. The latter makes sense in a unicode environment, but we need this for VOTable chars, and there that's just a nuisance. |
raise an error if val is not a legal int for VOTables. Actually, this is for tabledata, and after the relaxed 1.3 rules, we allow the empty string ("NULL"), too. |
returns a function to map code over arrays. This is used by *XtypeEncoderCode functions below, and for now only deals with 1D arrays of xtyped things, which right now means 2D arrays of votable arrays. This will return a callable accepting a list of lines (the xtype decoder for an elementary thing), nor None if the array is too complex. |
returns code that turns special internal representations for xtyped fields to what's serialised in VOTables. For None or unknown xtypes, this will return an empty list. Otherwise, it expects the value in a local variable val and will leave the transformed value there. This is currently only called for char and float arrays, as no xtypes are defined for other types. If that changes, you'll have to change the *_enc modules. This will handle 1D arrays of xtyped things but nothing more deeply nested. More deeply nested structures will be left alone (which will only work under very special conditions and yield ugly error messages otherwise). |
returns code that turns generic VOTable arrays into special internal representations based on xtype. This returns a list of lines or an empty list if no known xtype is found. The code is executed with the unpacked array seen as val, and it should set val to the special representation. This will handle 1D arrays of xtyped things but nothing more deeply nested. More deeply nested structures will be left alone (which is ok for round-tripping but probably will fail when DaCHS components want to process stuff). |
returns True if the VOTable arraysize denotes a variable-length array. This is, of course, False for None arraysizes, |
returns the number of elements expected for an array described with the VOTable attribute arraysize. A 1-element array isn't told apart from a scalar here. Both return 1. For variable-length arrays, this returns None. Bad arraysize specs will give ValueErrors (perhaps not always with the most helpful messages). >>> getLength(None) 1 >>> getLength("*") >>> getLength("5") 5 >>> getLength("5x*") >>> getLength("5x6*") >>> getLength("7x5x6") 210 >>> getLength("7*x5x6") Traceback (most recent call last): ValueError: invalid literal for int() with base 10: '7*' |
returns a numpy-compatible shape for a VOTable arraysize. For variable length 1D arrays, this returns None; for 2+D arrrays, the last dimension is currently replaced by 1. Which doesn't sound smart. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |