calamari.measurement.row_families#

calamari.measurement.row_families(data, *, path=None)#

Classify each row of data as 'VSM', 'DC', 'AC', HOUSEKEEPING, or 'unknown'.

The rule is IO-4’s, applied one level down from measurement-type inference: prefer the evidence the file states outright, fall back to what the data shows, and let each check the other.

Transport Action decides where the instrument writes it, because that is the file’s per-row statement of what the transport was doing. Where it is absent, the populated columns decide instead, and the same holds per row for a blank cell, which states nothing. Where a code is present, the columns still get a say: a row whose code and columns name different families raises, because one of the two is wrong and calamari cannot tell which. A row that populates nothing contradicts nothing and is left as its code says.

Returns a Series aligned to data, so it can be used directly as a mask.

Raises:

MeasurementFamilyError – For an unrecognised Transport Action code, or a row whose code and columns disagree.

Return type:

Series