dbs_classes.dbs_scenario.DbsScenario

dbs_classes.dbs_scenario.DbsScenario(self, database)

Methods

Name Description
check_higher_level_usage Check if a scenario is used in a benefit.
delete Delete an already existing scenario in the database.
edit Edits an already existing scenario in the database.
list_objects Return a dictionary with info on the events that currently exist in the database.

check_higher_level_usage

dbs_classes.dbs_scenario.DbsScenario.check_higher_level_usage(name)

Check if a scenario is used in a benefit.

Parameters

Name Type Description Default
name str name of the scenario to be checked required

Returns

Name Type Description
list[str] list of benefits that use the scenario

delete

dbs_classes.dbs_scenario.DbsScenario.delete(name, toml_only=False)

Delete an already existing scenario in the database.

Parameters

Name Type Description Default
name str name of the scenario to be deleted required
toml_only bool whether to only delete the toml file or the entire folder. If the folder is empty after deleting the toml, it will always be deleted. By default False False

Raises

Name Type Description
ValueError Raise error if scenario to be deleted is already in use.

edit

dbs_classes.dbs_scenario.DbsScenario.edit(object_model)

Edits an already existing scenario in the database.

Parameters

Name Type Description Default
scenario Scenario scenario to be edited in the database required

Raises

Name Type Description
ValueError Raise error if name is already in use.

list_objects

dbs_classes.dbs_scenario.DbsScenario.list_objects()

Return a dictionary with info on the events that currently exist in the database.

Returns

Name Type Description
dict[str, Any] Includes ‘name’, ‘description’, ‘path’ and ‘last_modification_date’ info
Back to top