provenance#

Per-variable provenance sidecars for the curate stage.

Each reconciled/inferred canonical column gets a categorical {column}_source sidecar recording which data source, model, or decision determined the value. The token is a short string (e.g. parcel, nsi, imputed, geometry, keyword); steps that re-decide a value overwrite the earlier token.

Functions#

source_column(→ str)

Return the provenance sidecar name for column.

record_source(curated, column, mask, token)

Set the {column}_source sidecar to token for the mask rows.

Module Contents#

openplaces.io.curator.provenance.source_column(column: str) str#

Return the provenance sidecar name for column.

openplaces.io.curator.provenance.record_source(curated, column: str, mask, token: str)#

Set the {column}_source sidecar to token for the mask rows.

Creates the sidecar (object dtype) when absent; later calls overwrite earlier decisions for the rows they touch. mask may be a boolean Series aligned to curated.index or an index of rows. The sidecar is cast to Categorical by cast_categoricals at format time.