phenotypic.util.MeasurementProducer#
- class phenotypic.util.MeasurementProducer(output_key: str, producer: type[_TableProducer], primary_infos: tuple[type[MeasurementInfo], ...], shared_infos: tuple[type[MeasurementInfo], ...] = ())[source]#
Bases:
objectA public operation that writes a table, and the schemas of its columns.
- Parameters:
output_key (str)
producer (type[_TableProducer])
primary_infos (tuple[type[MeasurementInfo], ...])
shared_infos (tuple[type[MeasurementInfo], ...])
- output_key#
The producer’s class name; also its file stem under
deliverables/measurements_by_feature/.- Type:
- producer#
The operation class (a
MeasureFeaturesorSetAnalyzersubclass).- Type:
type[phenotypic.util._measurement_outputs._TableProducer]
- primary_infos#
Schemas this producer owns, in declaration order, including any a parameter switches on (
MeasureColor’s XYZ).
Schemas every producer of its kind writes alongside its own (
MODEL_METRICSfor growth models,QUALITY_CHECKfor quality checks).
Methods
__init__Return the column header the producer writes for member.
Attributes
- primary_infos: tuple[type[MeasurementInfo], ...]#
- shared_infos: tuple[type[MeasurementInfo], ...] = ()#
- output_header(member: MeasurementInfo, on: str | None = None) str[source]#
Return the column header the producer writes for member.
Delegates to the producer class’s
output_header. Analyzers whose headers differ from the enum value (quality checks, growth models, edge correction) call that same method when they write their columns. Measurement operations writemember.valueor an enum helper (TEXTURE.header) directly, so for them agreement is not structural:tests/unit/util/test_output_headers.pyruns every producer and checks the documented names against the columns written.- Parameters:
member (MeasurementInfo) – A member of one of this producer’s schemas.
on (str | None) – The analyzed column, for producers whose headers embed it;
Nonerenders a placeholder such as<metric>.
- Returns:
The emitted header.
- Return type: