Skip to content
Projects

opencr.data.provenance

Where a piece of data comes from, how it was changed and what it may be used for.

Every reaction, and every dataset of a model, carries a Provenance: the reference, the persistent identifier, the version and the retrieval date, the units and the conversions applied, the range of validity, the interpolation and extrapolation, the uncertainty and the licence under which it may be redistributed. opencr.data.checks.check_provenance tells what is missing.

Attributes

NameDescription
DERIVEDNo description.
LICENCES_REDISTRIBUTABLENo description.

Classes

NameDescription
ProvenanceThe origin and the conditions of use of one piece of data.
ReferenceA publication or database.
ValidityThe range of a quantity in which data may be used.

DERIVEDattributemodule attribute#

DERIVED = Provenance(
  Reference('derived in OpenCR'),
  licence='MIT',
  notes='computed from other data of the model'
)

LICENCES_REDISTRIBUTABLEattributemodule attribute#

LICENCES_REDISTRIBUTABLE = ('CC0-1.0', 'CC-BY-4.0', 'MIT', 'public-domain', 'published-fit')

Provenanceclassdataclass#

class Provenance(reference: Reference, version: str = '', retrieved: str = '', units: str = '', conversions: tuple[str, ...] = (), validity: tuple[Validity, ...] = (), interpolation: str = '', extrapolation: str = '', uncertainty: float | None = None, uncertainty_note: str = '', licence: str = 'unknown', notes: str = '')

The origin and the conditions of use of one piece of data.

Attributes

NameTypeDescription
referenceReferenceThe source.
versionstrThe version of the database or dataset, if it has one.
retrievedstrThe date the data were obtained, ISO 8601 ("2026-10-27").
unitsstrThe units of the data as stored, e.g. "m^2 against eV".
conversionstuple[str, ...]The conversions applied to the source, in order, e.g. ("1e-16 cm^2 -> m^2",).
validitytuple[Validity, ...]The ranges of validity.
interpolationstrHow values between data points are obtained.
extrapolationstrWhat happens outside the data or the validity.
uncertaintyfloat | NoneThe relative uncertainty (a fraction, e.g. 0.2), or None if unknown.
uncertainty_notestrThe uncertainty as the source states it.
licencestrThe licence of the data; one of LICENCES_REDISTRIBUTABLE for data OpenCR may ship, otherwise its name or "unknown".
notesstrAnything else, e.g. a correction of a misprint.

conversionsattributeclass attributeinstance attribute#

conversions: tuple[str, ...] = ()

extrapolationattributeclass attributeinstance attribute#

extrapolation: str = ''

interpolationattributeclass attributeinstance attribute#

interpolation: str = ''

licenceattributeclass attributeinstance attribute#

licence: str = 'unknown'

notesattributeclass attributeinstance attribute#

notes: str = ''

referenceattributeinstance attribute#

reference: Reference

retrievedattributeclass attributeinstance attribute#

retrieved: str = ''

uncertaintyattributeclass attributeinstance attribute#

uncertainty: float | None = None

uncertainty_noteattributeclass attributeinstance attribute#

uncertainty_note: str = ''

unitsattributeclass attributeinstance attribute#

units: str = ''

validityattributeclass attributeinstance attribute#

validity: tuple[Validity, ...] = ()

versionattributeclass attributeinstance attribute#

version: str = ''

redistributableproperty#

redistributable: bool

Whether the licence allows OpenCR to ship the data.

from_dictmethodclassmethod#

def from_dict(data: Mapping[str, Any]) -> Provenance

Return the provenance of to_dict’s output.

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the provenance as plain JSON-compatible data.

Referenceclassdataclass#

class Reference(citation: str, doi: str | None = None, url: str | None = None, detail: str = '')

A publication or database.

Attributes

NameTypeDescription
citationstrThe full citation, e.g. "L. C. Johnson, Astrophys. J. 174, 227 (1972)".
doistr | NoneThe DOI without the https://doi.org/ prefix, if any.
urlstr | NoneA URL where the source is openly available, if any.
detailstrThe equation, table or section used, e.g. "eq. (14), table 3".

citationattributeinstance attribute#

citation: str

detailattributeclass attributeinstance attribute#

detail: str = ''

doiattributeclass attributeinstance attribute#

doi: str | None = None

urlattributeclass attributeinstance attribute#

url: str | None = None

Validityclassdataclass#

class Validity(quantity: str, minimum: float = 0.0, maximum: float = float('inf'), unit: str = 'eV')

The range of a quantity in which data may be used.

Attributes

NameTypeDescription
quantitystrWhat the range is of, e.g. "electron_temperature" or "energy".
minimumfloatThe lowest valid value, in unit.
maximumfloatThe highest valid value, in unit.
unitstrThe unit of the bounds, e.g. "eV".

maximumattributeclass attributeinstance attribute#

maximum: float = float('inf')

minimumattributeclass attributeinstance attribute#

minimum: float = 0.0

quantityattributeinstance attribute#

quantity: str

unitattributeclass attributeinstance attribute#

unit: str = 'eV'

containsmethod#

def contains(value: float) -> bool

Return whether value (in unit) is inside the range.