bamboost.index.schema
SQLAlchemy Core schema definitions for the BAMBOOST index database.
Attributes
- metadata=
MetaData() - collections_table=
Table(TABLENAME_COLLECTIONS, metadata, Column('uid', String, primary_key=True), Column('path', String, nullable=False), Column('created_at', DateTime, nullable=True), Column('description', String, nullable=False, default='', server_default=''), Column('tags', JSON, nullable=False, default=list, server_default='[]'), Column('aliases', JSON, nullable=False, default=list, server_default='[]'), Column('author', JSON, nullable=True, default=None, server_default='null')) - simulations_table=
Table(TABLENAME_SIMULATIONS, metadata, Column('id', Integer, primary_key=True, autoincrement=True), Column('collection_uid', String, ForeignKey(f'{TABLENAME_COLLECTIONS}.uid', ondelete='CASCADE')), Column('name', String, nullable=False), Column('created_at', DateTime, nullable=False, default=(datetime.now)), Column('modified_at', DateTime, nullable=False, default=(datetime.now)), Column('description', String, nullable=True), Column('status', String, nullable=False, default='initialized', server_default='initialized'), Column('submitted', Boolean, nullable=False, default=False, server_default='0'), UniqueConstraint('collection_uid', 'name', name='uix_collection_name')) - parameters_table=
Table(TABLENAME_PARAMETERS, metadata, Column('id', Integer, primary_key=True, autoincrement=True), Column('simulation_id', Integer, ForeignKey(f'{TABLENAME_SIMULATIONS}.id', ondelete='CASCADE'), nullable=False), Column('key', String, nullable=False), Column('value', JSON, nullable=False), UniqueConstraint('simulation_id', 'key', name='uix_simulation_key'))
Functions
create_all
(engine) -> NoneCreate all tables defined in this module.
Arguments:
- engine
Classes
ParameterRecord
ParameterRecord
(self, id, simulation_id, key, value) -> NoneArguments:
- id:
int - simulation_id:
int - key:
str - value:
typing.Any
Attributes:
- id:
int - simulation_id:
int - key:
str - value:
typing.Any
SimulationRecord
SimulationRecord
(self, id, collection_uid, name, created_at, modified_at, description, status, submitted, parameters=list()) -> NoneArguments:
- id:
int - collection_uid:
str - name:
str - created_at:
datetime.datetime - modified_at:
datetime.datetime - description:
str | None - status:
str - submitted:
bool
Attributes:
- id:
int - collection_uid:
str - name:
str - created_at:
datetime.datetime - modified_at:
datetime.datetime - description:
str | None - status:
str - submitted:
bool - parameter_dict:
dict[str, typing.Any]
SimulationRecord.as_dict_metadata
(self) -> dict[str, Any]SimulationRecord.as_dict
(self, standalone=True) -> dict[str, Any]Arguments:
- standalone:
bool=True
CollectionMetadata
CollectionMetadata
(self, uid, created_at=None, tags=list(), aliases=list(), author=None, description=None) -> NoneCollection metadata container. Can load/save from/to dicts, storing unknown fields in an extras dictionary.
Arguments:
- uid:
str - created_at:
datetime.datetime | None=None - tags:
list[str]=list() - aliases:
list[str]=list() - author:
str | dict | None=None - description:
str | None=None
Attributes:
- uid:
strUnique identifier of the collection.
- created_at:
datetime.datetime | None=field(default=None)Creation timestamp.
- aliases:
list[str]=field(default_factory=list)List of aliases for the collection.
- description:
str | None=field(default=None)Completely optional description of the collection.
- _extras:
dict[str, typing.Any]=field(default_factory=dict, init=False, repr=False)
CollectionMetadata.to_dict
(self) -> dict[str, Any]CollectionMetadata.from_dict
(cls, data, *_) -> SelfCreate an instance from a dictionary, storing unknown fields in the extras dictionary.
Arguments:
- cls
- data:
dict[str, typing.Any]The input dictionary.
- _=
()
CollectionRecord
CollectionRecord
(self, uid, created_at=None, tags=list(), aliases=list(), author=None, description=None, path='', simulations=list()) -> NoneCollection record, including metadata and associated simulations. Used for exposing (read only) a record in the collection table in the sql database.
Arguments:
- uid:
str - created_at:
datetime.datetime | None=None - tags:
list[str]=list() - aliases:
list[str]=list() - author:
str | dict | None=None - description:
str | None=None - path:
str=''
Attributes:
- path:
str=field(default='')Path to the collection on disk. Guaranteed to be not null.
List of simulations associated with the collection.
- parameters:
list[ParameterRecord]
Bases
CollectionRecord.get_parameter_keys
(self) -> tuple[list[str], list[int]]CollectionRecord.to_pandas
(self, flatten=True) -> 'DataFrame'Arguments:
- flatten:
bool=True
CollectionRecord.filtered
(self, filter, sorter) -> Self
Bamboost