upxo.material.provenance module
provenance.py
Generic record of how a value stored in a MaterialRegistry was
derived – what produced it, with what parameters, and when. Attached
uniformly by MaterialRegistry.ingest() to whatever is stored, rather
than each data category declaring its own source/method/timestamp fields.
- class upxo.material.provenance.Provenance(source: str | None = None, method: str | None = None, params: Dict[str, ~typing.Any]=<factory>, timestamp: datetime = <factory>)[source]
Bases:
objectWhere an ingested value came from.
- Parameters:
source (str, optional) – Where the data originated – a file path, a dataset identifier, “user input”, etc.
method (str, optional) – The function/module/algorithm that produced the value, e.g.
"tcVf_twinned_fcc.fit_components".params (dict) – Whatever parameters that method was called with, e.g.
{"misori_tol_deg": 5.0, "n_grains": 340}.timestamp (datetime) – When the value was ingested. Defaults to the moment the
Provenanceinstance is constructed.