Dataset Model#

class backend.app.models.dataset.Dataset(*, id: int | None = None, site_id: int | None = None, sampling_period_begin: date | None = None, sampling_period_end: date | None = None, time_resolution_unit: TimeResolutionUnitEnum | None = None, time_resolution_interval: int | None = None, data_type: str | None = None, link_to_dataset: str | None = None)[source]#

Bases: SQLModel

Represents a dataset.

This class models a dataset and its various attributes.

Parameters:
  • id (int) – The unique identifier of the dataset.

  • site_id (int) – The ID of the associated site.

  • site (Site) – The site associated with the dataset.

  • sampling_period_begin (date) – The start date of the sampling period.

  • sampling_period_end (date) – The end date of the sampling period.

  • time_resolution_unit (TimeResolutionUnitEnum) – The unit of time resolution.

  • time_resolution_interval (int) – The interval of time resolution.

  • data_type (str) – The type of data in the dataset.

  • link_to_dataset (str) – The link to the dataset.

  • vocs (list[Voc]) – The VOCs associated with the dataset.

  • contacts (list[Contact]) – The contacts associated with the dataset.

  • publications (list[Publication]) – The publications associated with the dataset.

  • voc_subclasses (list[VocSubclass]) – The VOC subclasses associated with the dataset.

contacts: Mapped[list[Contact] | None]#
data_type: str | None#
id: int | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'read_from_attributes': True, 'read_with_orm_mode': True, 'registry': PydanticUndefined, 'table': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'link_to_dataset': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'sampling_period_begin': FieldInfo(annotation=Union[date, NoneType], required=False, default=None), 'sampling_period_end': FieldInfo(annotation=Union[date, NoneType], required=False, default=None), 'site_id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'time_resolution_interval': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'time_resolution_unit': FieldInfo(annotation=Union[TimeResolutionUnitEnum, NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

publications: Mapped[list[Publication] | None]#
sampling_period_begin: date | None#
sampling_period_end: date | None#
site: Mapped[Site]#
site_id: int | None#
time_resolution_interval: int | None#
time_resolution_unit: TimeResolutionUnitEnum | None#
voc_subclasses: Mapped[list[VocSubclass] | None]#
vocs: Mapped[list[Voc] | None]#