Public Member Functions | |
| __init__ (self, str schema_file, str schema_name="ApdbSchema") | |
| type|str | column_dtype (self, felis.datamodel.DataType|ExtraDataTypes felis_type) |
| VersionTuple | schemaVersion (self) |
| bool | has_mjd_timestamps (self) |
Public Attributes | |
| tableSchemas | |
Protected Member Functions | |
| tuple[Mapping[ApdbTables, Table], VersionTuple|None] | _buildSchemas (cls, str schema_file, str schema_name="ApdbSchema") |
Protected Attributes | |
| tuple[Mapping[ApdbTables, Table], VersionTuple|None] | _schemaVersion = self._buildSchemas(schema_file, schema_name) |
Class for management of APDB schema.
Attributes
----------
tableSchemas : `dict`
Maps table name to `TableDef` instance.
Parameters
----------
schema_file : `str`
Name of the YAML schema file.
schema_name : `str`, optional
Name of the schema in YAML files.
|
protected |
Create schema definitions for all tables.
Reads YAML schema and builds a dictionary containing
`.schema_model.Table` instances for each table.
Parameters
----------
schema_file : `str`
Name of YAML file with ``felis`` schema.
schema_name : `str`, optional
Name of the schema in YAML files.
Returns
-------
tables : `dict`
Mapping of table names to `.schema_model.Table` instances.
version : `VersionTuple` or `None`
Schema version defined in schema file, `None` if version is not
defined.
| type | str lsst.dax.apdb.apdbSchema.ApdbSchema.column_dtype | ( | self, | |
| felis.datamodel.DataType | ExtraDataTypes | felis_type ) |
Return Pandas data type for a given Felis column type.
Parameters
----------
felis_type : `felis.datamodel.DataType`
Felis type, on of the enums defined in `felis.datamodel` module.
Returns
-------
column_dtype : `type` or `str`
Type that can be used for columns in Pandas.
Raises
------
TypeError
Raised if type is cannot be handled.
| bool lsst.dax.apdb.apdbSchema.ApdbSchema.has_mjd_timestamps | ( | self | ) |
True if timestamps columns are in MJD (`bool`).
| VersionTuple lsst.dax.apdb.apdbSchema.ApdbSchema.schemaVersion | ( | self | ) |
Return schema version as defined in YAML schema file.
Returns
-------
version : `VersionTuple`
Version number read from YAML file, if YAML file does not define
schema version then "0.1.0" is returned.