opendrift.models.openoil.adios.models.oil.oil
Main class that represents an oil record.
This maps to the JSON used in the DB
Having a Python class makes it easier to write importing, validating etc, code.
Module Contents
Classes
Attributes
- opendrift.models.openoil.adios.models.oil.oil.ADIOS_DATA_MODEL_VERSION
- class opendrift.models.openoil.adios.models.oil.oil.Oil[source]
- oil_id: str
- adios_data_model_version: opendrift.models.openoil.adios.models.oil.version.Version
- status: list
- permanent_warnings: list
- extra_data: dict
- __post_init__()[source]
Put any validation code here (__init__() is auto-generated by the dataclass decorator, and it will clobber any attempt to overload the __init__.)
- classmethod from_file(infile)[source]
load an Oil object from the passed in JSON file
it can be either a path or an open file object
- NOTE: this could be in the decorator – but we only really need it
for a full record.
- validate()
validation specific to the Oil object itself
validation of sub-objects is automatically applied