_generation
Module Contents
Classes
Generic SQLAlchemy model for a generation. |
Attributes
- TPopulation
- class Generation
Bases:
experimentation.database.HasId
,sqlalchemy.orm.MappedAsDataclass
,Generic
[TPopulation
]Generic SQLAlchemy model for a generation.
Inherit from this to create your own generation type and table.
The generic parameter TPopulation refers to the user-defined population type. This parameter cannot be a forward reference.
For example:
class MyGeneration(Base, Generation[MyPopulation]): __tablename__ = "my_generation"
- classmethod __init_subclass__(/, **kwargs: dict[str, Any]) None
Initialize a version of this class when it is subclassed.
Gets the actual type of TPopulation and stores it for later use. :param kwargs: Remaining arguments passed to super.