Home | Trees | Indices | Help |
|
---|
|
Functions taking strings and returning python values.
All of them accept None and return None for Nullvalue processing.
All of them leave values alone if they already have the right type.
This is usually used in conjunction with base.typesystems.ToPythonCodeConverter.
Classes | |
NumericRange A `Range` suitable to pass Python numeric types to a PostgreSQL range. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Function Details |
returns an int from a literal, or None if literal is None or an empty string. >>> parseInt("32") 32 >>> parseInt("") >>> parseInt(None)
|
returns a float from a literal, or None if literal is None or an empty string. Temporarily, this includes a hack to work around a bug in psycopg2. >>> parseFloat(" 5e9 ") 5000000000.0 >>> parseFloat(None) >>> parseFloat(" ") >>> parseFloat("wobbadobba") Traceback (most recent call last): ValueError: could not convert string to float: wobbadobba
|
returns a python boolean from some string. Boolean literals are strings like True, false, on, Off, yes, No in some capitalization.
|
returns a pair of RA, DEC floats if they can be made out in soup or raises a value error. No range checking is done (yet), i.e., as long as two numbers can be made out, the function is happy. >>> parseCooPair("23 12") (23.0, 12.0) >>> parseCooPair("23.5,-12.25") (23.5, -12.25) >>> parseCooPair("3.75 -12.125") (3.75, -12.125) >>> parseCooPair("3 25,-12 30") (51.25, -12.5) >>> map(str, parseCooPair("12 15 30.5 +52 18 27.5")) ['183.877083333', '52.3076388889'] >>> parseCooPair("3.39 -12 39") Traceback (most recent call last): ValueError: Invalid time with sepChar None: '3.39' >>> parseCooPair("12 15 30.5 +52 18 27.5e") Traceback (most recent call last): ValueError: 12 15 30.5 +52 18 27.5e has no discernible position in it >>> parseCooPair("QSO2230+44.3") Traceback (most recent call last): ValueError: QSO2230+44.3 has no discernible position in it |
returns an ``SPoint`` for a coordinate pair. The coordinate pair can be formatted in a variety of ways; see the `function parseCooPair`_. Input is always in degrees. |
returns a dict containing all exported names from this module. This is useful with typesystems.ToPythonCodeConverter; see rscdef.column.Parameter for an example. This is always the same dict; thus, if you change it, copy it first.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |