Entry Types#
A molecule entry with typed properties and optional structure file. |
|
A reaction entry with typed properties and participant molecules. |
|
A molecular fragment entry with typed properties. |
|
A molecule's participation in a reaction step. |
|
Role of a molecule participating in a reaction. |
|
Container for data returned by a subset download. |
|
Type Parameters#
- Properties = TypeVar(Properties, bound=Mapping)#
Type:
TypeVarInvariant
TypeVarbound tocollections.abc.Mapping[str,object].Properties type parameter for
Molecule,Reaction, andFragment. Defaults todict[str, Value]; narrowed to aTypedDictwith per-subset stubs.
- FType = TypeVar(FType)#
Type:
TypeVarInvariant
TypeVar.Fragment type parameter for
Fragment. Defaults tostr | None; narrowed to aLiteralwith per-subset stubs.
- lcmd_db.types.Value: TypeAlias = str | int | float | bool | None#
Union of allowed property value types.
Molecule#
- class Molecule[source]#
Bases:
Generic[~Properties]A molecule entry with typed properties and optional structure file.
Access properties via subscript:
mol.properties["energy"]. Per-subset type stubs narrow property types; seelcmd-db stubs sync.
Reaction#
- class Reaction[source]#
Bases:
Generic[~Properties]A reaction entry with typed properties and participant molecules.
Access properties via subscript:
rxn.properties["barrier"]. Per-subset type stubs narrow property types; seelcmd-db stubs sync.
Fragment#
- class Fragment[source]#
Bases:
Generic[~Properties,~FType]A molecular fragment entry with typed properties.
Access properties via subscript:
frag.properties["charge"]. Per-subset type stubs narrow property types; seelcmd-db stubs sync.
Participants#
- class Participant[source]#
A molecule’s participation in a reaction step.
- role#
Role in the reaction (reactant, product, catalyst, …).
- Type:
- class ParticipantRole[source]#
Bases:
StrEnumRole of a molecule participating in a reaction.
- REACTANT = 'reactant'#
- PRODUCT = 'product'#
- CATALYST = 'catalyst'#
- CO_CATALYST = 'co_catalyst'#
- SUBSTRATE = 'substrate'#
- INTERMEDIATE = 'intermediate'#
- TRANSITION_STATE = 'transition_state'#
- SOLVENT = 'solvent'#
- ADDITIVE = 'additive'#
Container#
- class SubsetData[source]#
Bases:
Generic[~MProperties,~RProperties,~FProperties,~FType,~ATemplates]Container for data returned by a subset download.
Generic over molecule, reaction, and fragment property types. When returned by a generated
load_datasetoverload the type parameters are bound to per-subsetTypedDictclasses so thatdata.as_dataset("molecules")[0].properties["energy"]is fully typed.Without explicit type parameters, defaults to
dict[str, Value]for all three (backward-compatible).- property dataframes: dict[str, polars.DataFrame]#
Return a mapping of entity type names to their non-null DataFrames.
- as_dataset(entity_type)[source]#
Build a typed
Datasetfor the given entity type.- Parameters:
entity_type (
str) – One of"molecules","reactions", or"fragments".- Return type:
Dataset[Molecule[MProperties]] |Dataset[Reaction[RProperties]] |Dataset[Fragment[FProperties,FType]]- Returns:
A
MoleculeDataset,ReactionDataset, orFragmentDatasetdepending on the entity type.- Raises:
ValueError – If no data directory is available or the entity type is unknown.
Example:
molecules = data.as_dataset("molecules") # MoleculeDataset reactions = data.as_dataset("reactions") # ReactionDataset
- property assembly_templates: ATemplates#
Assembly templates available for this subset.
Each template can assemble fragment SMILES into a molecule via
template.assemble(core="...", sub1="...").
Metadata#
Enums#
- class DataFormat[source]#
Bases:
StrEnum- CSV = 'csv'#
- TSV = 'tsv'#
- XLSX = 'xlsx'#
- PARQUET = 'parquet'#
- JSON = 'json'#