lsst.dax.apdb g011c388f00+4c8162c5ad
|
Public Member Functions | |
__init__ (self, str schema_file, str schema_name="ApdbSchema") | |
type|str | column_dtype (self, type[felis.types.FelisType] felis_type) |
VersionTuple | schemaVersion (self) |
Public Attributes | |
tableSchemas | |
Protected Member Functions | |
tuple[Mapping[ApdbTables, Table], VersionTuple|None] | _buildSchemas (self, str schema_file, str schema_name="ApdbSchema") |
Protected Attributes | |
_schemaVersion | |
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 schemas and builds dictionary containing `TableDef` 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 ------- schemas : `dict` Mapping of table names to `TableDef` 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, | |
type[felis.types.FelisType] | felis_type ) |
Return Pandas data type for a given Felis column type. Parameters ---------- felis_type : `type` Felis type, on of the classes defined in `felis.types` 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.
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.