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: object

A public operation that writes a table, and the schemas of its columns.

Parameters:
output_key#

The producer’s class name; also its file stem under deliverables/measurements_by_feature/.

Type:

str

producer#

The operation class (a MeasureFeatures or SetAnalyzer subclass).

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).

Type:

tuple[type[phenotypic.schema._base._measurement_info.MeasurementInfo], …]

shared_infos#

Schemas every producer of its kind writes alongside its own (MODEL_METRICS for growth models, QUALITY_CHECK for quality checks).

Type:

tuple[type[phenotypic.schema._base._measurement_info.MeasurementInfo], …]

Methods

__init__

output_header

Return the column header the producer writes for member.

Attributes

output_key: str#
producer: type[_TableProducer]#
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 write member.value or an enum helper (TEXTURE.header) directly, so for them agreement is not structural: tests/unit/util/test_output_headers.py runs 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; None renders a placeholder such as <metric>.

Returns:

The emitted header.

Return type:

str