Dataset

This class is the main class of the dataset. It contains general information about the dataset.

Follow this guide to create a new dataset and learn how to provide the data of an energy system model.

The following attributes are available:

pydantic model ensysmod.schemas.DatasetCreate[source]

Attributes to receive via API on creation of a dataset.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

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

field name: str [Required]

Unique name of the dataset. Can be used to identify the dataset.

Constraints:
  • min_length = 1

  • max_length = 255

field description: str | None = None

Description of the dataset. Can be used for a detailed description about the dataset and the modelled data.

Constraints:
  • max_length = 1024

field hours_per_time_step: int | None = 1

Hours per time step in the dataset. Use 1 for hourly data, 24 for daily data. It is needed to calculate annual costs.

Constraints:
  • gt = 0

field number_of_time_steps: int | None = 8760

Number of time steps in the dataset. All provided time series must have the same length.

Constraints:
  • gt = 0

field cost_unit: str | None = '1e9 €'

Cost unit for the whole dataset. All provided costs must be in this unit.

Constraints:
  • min_length = 1

  • max_length = 255

field length_unit: str | None = 'km'

Length unit for the whole dataset. All provided distances must be in this unit.

Constraints:
  • min_length = 1

  • max_length = 255

Dataset permissions

After creating a dataset, you can set permissions for the dataset. You can grant (or revoke) permissions to other users to access and modify the dataset. By default only you can access and modify the dataset.

The following attributes are available:

pydantic model ensysmod.schemas.DatasetPermissionCreate[source]

Attributes to receive via API on creation of a DatasetPermission.

field ref_dataset: int [Required]

The ID of the dataset. You must have access to grant permissions to this dataset.

Constraints:
  • gt = 0

field ref_user: int [Required]

The ID of the user that receive the permissions.

Constraints:
  • gt = 0

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

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

field allow_usage: bool = True

Whether the user is allowed to use the dataset.

field allow_modification: bool = True

Whether the user is allowed to modify the dataset.

field allow_permission_grant: bool = True

Whether the user is allowed to grant permissions.

field allow_permission_revoke: bool = True

Whether the user is allowed to revoke permissions.

You can modify the permissions for the dataset by using the REST API:

GET /datasets/permissions/

Get All Dataset Permissions

Retrieve all dataset permissions.

If you provide a dataset_id, only the permissions for that dataset will be returned. Otherwise, all permissions for the current user will be returned.

Query Parameters:
  • dataset_id ({'null', 'integer'}) –

Status Codes:
POST /datasets/permissions/

Create Dataset Permission

Create a new dataset_permission.

Status Codes:
PUT /datasets/permissions/

Update Dataset Permission

Update a dataset-user permission.

You can not edit your own permissions. For editing other permissions, you need grant and revoke permissions. (Might change in future.)

Status Codes: