torchcell.datamodels.schema.Environment

class Environment(*, provenance_gaps: list[~torchcell.verification.sourced.ProvenanceGap] = <factory>, media: ~torchcell.datamodels.schema.Media, temperature: ~torchcell.datamodels.schema.Temperature | None = None, perturbations: list[~torchcell.datamodels.schema.SmallMoleculePerturbation | ~torchcell.datamodels.schema.EnvironmentPhysicalPerturbation | ~torchcell.datamodels.schema.BiologicPerturbation | ~torchcell.datamodels.schema.PhagePerturbation | ~torchcell.datamodels.schema.PhysicalExposurePerturbation] = <factory>, aerobicity: str | None = 'aerobic', duration_hours: float | None = None, duration_generations: float | None = None, dilution_rate_per_hour: float | None = None, growth_phase: ~torchcell.datamodels.schema.CultureGrowthPhase | None = None)[source]

Bases: ProvenanceGapMixin

Experimental environment: base medium + temperature + optional perturbations.

perturbations mirror Genotype.perturbations on the environment axis: the added compounds / physical stresses applied on top of the base media. It defaults to an empty list, so an unperturbed environment (every dataset predating the environment-perturbation ontology) is unchanged. aerobicity records the oxygen regime (anaerobic fermentation is standard for biofuel screens); duration_hours is the optional treatment time. temperature is optional: a secondary curation layer (YeastPhenome) may not carry it, in which case it is a ProvenanceGap (field='temperature'), NOT a guessed value. aerobicity is a value or a typed ProvenanceGap (#1045): None only beside a gap naming it, when the source states no oxygen regime (Lamoureux 2023’s blank Electron Acceptor and aerobicity cells), never a guessed aerobic; transition is a regime that changes during the culture (Public K-12’s anaerobic-aerobic transition series), which no single regime states. A dissolved-oxygen setpoint is an EnvironmentPhysicalPerturbation of PhysicalFactor.dissolved_oxygen carrying the released value and unit, beside the regime it sets. growth_phase is the phase a culture is held in as the condition (Schmidt 2016’s stationary arms), None when the source states none.

The culture protocol (#507) lives on the subclass CultureEnvironment, not here: this class is in the schema closure of every served dataset.

classmethod validate_aerobicity(v: str | None) → str | None[source]

Aerobicity is one of the four oxygen regimes, or None beside a gap.

classmethod validate_dilution_rate(v: float | None) → float | None[source]

A dilution rate is finite and strictly positive, or absent.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].