calibpipe.database.adapter.database_containers package#
Contain database containers for CalibPipe and the table version manager.
All CalibPipe data is defined at the database level in this sub-package. In particular, a SQLTableInformation can be found for each CalibPipe container.
In addition, two utilities are present here to ease the use of DB containers:
TableVersionManager: Creates tables objects specific to a version number (needed for CalibPipe data).
ContainerMap: Maps CalibPipe containers (ultimately ctapipe.core.container) to database table information. The mapping is built-in, and allows users to quickly access the DB container corresponding to a CalibPipe container (or the contrary).
- class calibpipe.database.adapter.database_containers.TableVersionManager[source]#
Bases:
objectCreate versioned tables for CalibPipe.
The main method is apply_version() that returns a table given a table information and a version. The returned table will contain the same data as the table information and have a unique name containing the common table name and the software version.
- static get_safe_version_string(version: str) str[source]#
Create a string from a version that is safe for table names.
- class calibpipe.database.adapter.database_containers.ContainerMap[source]#
Bases:
objectMap CalibPipe and database containers.
The correspondence must be set using the register_container_pair() method, called automatically for the built-in CalibPipe containers. Once set, this map allows us to quickly get the DB container associated to a CalilbPipe container (or contrary) to switch between the two worlds.
- db_container_info#
alias of
SQLTableInfo
- static map_to_cp_container(db_container: SQLTableInfo) type[Container][source]#
Return the CalibPipe container corresponding to a DB container.
- static map_to_db_container(cp_container: type[Container]) SQLTableInfo[source]#
Return the DB container corresponding to a CalibPipe container.
Submodules#
calibpipe.database.adapter.database_containers.atmosphere module#
Atmospheric SQL table info.
calibpipe.database.adapter.database_containers.common_metadata module#
Common Metadata SQL info.
calibpipe.database.adapter.database_containers.container_map module#
ContainerMap class.
- class calibpipe.database.adapter.database_containers.container_map.ContainerMap[source]#
Bases:
objectMap CalibPipe and database containers.
The correspondence must be set using the register_container_pair() method, called automatically for the built-in CalibPipe containers. Once set, this map allows us to quickly get the DB container associated to a CalilbPipe container (or contrary) to switch between the two worlds.
- db_container_info#
alias of
SQLTableInfo
- static map_to_cp_container(db_container: SQLTableInfo) type[Container][source]#
Return the CalibPipe container corresponding to a DB container.
- static map_to_db_container(cp_container: type[Container]) SQLTableInfo[source]#
Return the DB container corresponding to a CalibPipe container.
calibpipe.database.adapter.database_containers.observatory module#
Observatory SQL table info.
calibpipe.database.adapter.database_containers.table_version_manager module#
TableVersionManager class.
- class calibpipe.database.adapter.database_containers.table_version_manager.TableVersionManager[source]#
Bases:
objectCreate versioned tables for CalibPipe.
The main method is apply_version() that returns a table given a table information and a version. The returned table will contain the same data as the table information and have a unique name containing the common table name and the software version.
- static get_safe_version_string(version: str) str[source]#
Create a string from a version that is safe for table names.
calibpipe.database.adapter.database_containers.throughput module#
OpticalThroughput SQL info.
calibpipe.database.adapter.database_containers.version_control module#
SQL info for run metadata.