# opencr.data.provenance

*module*

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.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L1-L1)

## opencr.data.provenance.DERIVED

*attribute* · *module attribute*

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

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L158-L162)

## opencr.data.provenance.LICENCES_REDISTRIBUTABLE

*attribute* · *module attribute*

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

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L21-L27)

## opencr.data.provenance.Provenance

*class* · *dataclass*

```python
class Provenance
```

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

**Attributes**

- `reference` (`Reference`) — The source.
- `version` (`str`) — The version of the database or dataset, if it has one.
- `retrieved` (`str`) — The date the data were obtained, ISO 8601 (``"2026-10-27"``).
- `units` (`str`) — The units of the data as stored, e.g. ``"m^2 against eV"``.
- `conversions` (`tuple[str, ...]`) — The conversions applied to the source, in order, e.g. ``("1e-16 cm^2 -> m^2",)``.
- `validity` (`tuple[Validity, ...]`) — The ranges of validity.
- `interpolation` (`str`) — How values between data points are obtained.
- `extrapolation` (`str`) — What happens outside the data or the validity.
- `uncertainty` (`float | None`) — The relative uncertainty (a fraction, e.g. 0.2), or ``None`` if unknown.
- `uncertainty_note` (`str`) — The uncertainty as the source states it.
- `licence` (`str`) — The licence of the data; one of `LICENCES_REDISTRIBUTABLE` for data OpenCR may ship, otherwise its name or ``"unknown"``.
- `notes` (`str`) — Anything else, e.g. a correction of a misprint.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L82-L154)

### opencr.data.provenance.Provenance.conversions

*attribute* · *class attribute* · *instance attribute*

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

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L108-L108)

### opencr.data.provenance.Provenance.extrapolation

*attribute* · *class attribute* · *instance attribute*

```python
extrapolation: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L111-L111)

### opencr.data.provenance.Provenance.interpolation

*attribute* · *class attribute* · *instance attribute*

```python
interpolation: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L110-L110)

### opencr.data.provenance.Provenance.licence

*attribute* · *class attribute* · *instance attribute*

```python
licence: str = 'unknown'
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L114-L114)

### opencr.data.provenance.Provenance.notes

*attribute* · *class attribute* · *instance attribute*

```python
notes: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L115-L115)

### opencr.data.provenance.Provenance.reference

*attribute* · *instance attribute*

```python
reference: Reference
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L104-L104)

### opencr.data.provenance.Provenance.retrieved

*attribute* · *class attribute* · *instance attribute*

```python
retrieved: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L106-L106)

### opencr.data.provenance.Provenance.uncertainty

*attribute* · *class attribute* · *instance attribute*

```python
uncertainty: float | None = None
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L112-L112)

### opencr.data.provenance.Provenance.uncertainty_note

*attribute* · *class attribute* · *instance attribute*

```python
uncertainty_note: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L113-L113)

### opencr.data.provenance.Provenance.units

*attribute* · *class attribute* · *instance attribute*

```python
units: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L107-L107)

### opencr.data.provenance.Provenance.validity

*attribute* · *class attribute* · *instance attribute*

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

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L109-L109)

### opencr.data.provenance.Provenance.version

*attribute* · *class attribute* · *instance attribute*

```python
version: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L105-L105)

### opencr.data.provenance.Provenance.redistributable

*property*

```python
redistributable: bool
```

Whether the licence allows OpenCR to ship the data.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L125-L127)

### opencr.data.provenance.Provenance.from_dict

*method* · *classmethod*

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

Return the provenance of `to_dict`'s output.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L137-L154)

### opencr.data.provenance.Provenance.to_dict

*method*

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

Return the provenance as plain JSON-compatible data.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L129-L135)

## opencr.data.provenance.Reference

*class* · *dataclass*

```python
class Reference
```

A publication or database.

**Attributes**

- `citation` (`str`) — The full citation, e.g. ``"L. C. Johnson, Astrophys. J. 174, 227 (1972)"``.
- `doi` (`str | None`) — The DOI without the ``https://doi.org/`` prefix, if any.
- `url` (`str | None`) — A URL where the source is openly available, if any.
- `detail` (`str`) — The equation, table or section used, e.g. ``"eq. (14), table 3"``.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L30-L53)

### opencr.data.provenance.Reference.citation

*attribute* · *instance attribute*

```python
citation: str
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L41-L41)

### opencr.data.provenance.Reference.detail

*attribute* · *class attribute* · *instance attribute*

```python
detail: str = ''
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L44-L44)

### opencr.data.provenance.Reference.doi

*attribute* · *class attribute* · *instance attribute*

```python
doi: str | None = None
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L42-L42)

### opencr.data.provenance.Reference.url

*attribute* · *class attribute* · *instance attribute*

```python
url: str | None = None
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L43-L43)

## opencr.data.provenance.Validity

*class* · *dataclass*

```python
class Validity
```

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

**Attributes**

- `quantity` (`str`) — What the range is of, e.g. ``"electron_temperature"`` or ``"energy"``.
- `minimum` (`float`) — The lowest valid value, in ``unit``.
- `maximum` (`float`) — The highest valid value, in ``unit``.
- `unit` (`str`) — The unit of the bounds, e.g. ``"eV"``.

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L56-L79)

### opencr.data.provenance.Validity.maximum

*attribute* · *class attribute* · *instance attribute*

```python
maximum: float = float('inf')
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L69-L69)

### opencr.data.provenance.Validity.minimum

*attribute* · *class attribute* · *instance attribute*

```python
minimum: float = 0.0
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L68-L68)

### opencr.data.provenance.Validity.quantity

*attribute* · *instance attribute*

```python
quantity: str
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L67-L67)

### opencr.data.provenance.Validity.unit

*attribute* · *class attribute* · *instance attribute*

```python
unit: str = 'eV'
```

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L70-L70)

### opencr.data.provenance.Validity.contains

*method*

```python
def contains(value: float) -> bool
```

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

[View source](https://github.com/max-models/OpenCR/blob/devel/src/opencr/data/provenance.py#L77-L79)
