phenotypic.sdk_.PreparedImageTables#
- class phenotypic.sdk_.PreparedImageTables(measurements: pd.DataFrame, metadata: pd.DataFrame | None, measurement_columns: tuple[str, ...], join_status: JoinStatus, join_keys: tuple[str, ...], metadata_snapshot_sha256: str)[source]#
Bases:
objectOne image’s measurement rows and, separately, its user metadata rows.
Spec §7.1-7.2’s inversion.
measurementsis the pre-join baseline – intrinsic identity (Metadata_ImageFile,Metadata_Dataset, the object label) plus the measured columns, and nothing that came from--metadata.metadatais the projection of the run’s metadata snapshot onto the join keys this image actually carries, orNonewhen there is no such projection to make.The join provenance below describes the metadata table, not the measurements table. After the inversion the measurements table carries no join at all, so its own recorded triple is
not_requested/[]/""– which is whatmeasurements_payload()builds, and the one place that rule lives.- Parameters:
- measurements#
The unjoined baseline, exactly the projection
measurement_columnsalready named.- Type:
pandas.core.frame.DataFrame
- metadata#
User metadata rows for this image’s keys, or
Nonewhenjoin_statusisnot_requestedorno_common_keys.- Type:
pandas.core.frame.DataFrame | None
- join_status#
Whether a metadata join was requested, possible, or done.
- Type:
Literal[‘not_requested’, ‘joined’, ‘no_common_keys’]
- metadata_snapshot_sha256#
Digest of the
metadata.csvsnapshot this image was prepared against;""when none was supplied.- Type:
Methods
__init__Return the measurements table's own payload, carrying no join.
Return the metadata table's own join provenance as Arrow metadata.
Attributes
- measurements: DataFrame#
- measurements_payload() PreparedEmbeddedMeasurementTable[source]#
Return the measurements table’s own payload, carrying no join.
The triple is
not_requested/()/""unconditionally, because after the inversion the statement “this file is the result of a join” is false oftables/measurements/table.parqueton every store. That is also exactly the shape_valid_embedded_measurement_contract()already accepts, so the contract needs no change for this file.- Return type:
- metadata_parquet_metadata() dict[bytes, bytes][source]#
Return the metadata table’s own join provenance as Arrow metadata.
The same key spellings the measurement table uses – one home for the names – minus
measurement_columns, which says nothing about this file. This is what makespht-metadata.parquetself-describing to a reader who has only the Parquet: it names the keys it is joined on, the direction of the join, and the snapshot it came from.