The attributes of the projection object to create. Should adhere to the ProjectionModel schema.
required
Returns
Name
Type
Description
IProjection
The projection object created from the attributes.
Raises
Name
Type
Description
ValueError
If the attributes do not adhere to the ProjectionModel schema.
delete_projection
api.projections.delete_projection(name)
Delete a projection from the database.
Parameters
Name
Type
Description
Default
name
str
The name of the projection to delete.
required
Raises
Name
Type
Description
ValueError
If the projection does not exist. If the projection is used in a scenario.
edit_projection
api.projections.edit_projection(projection)
Edit a projection object in the database.
Parameters
Name
Type
Description
Default
projection
IProjection
The projection object to edit.
required
Raises
Name
Type
Description
ValueError
If the projection object does not exist.
get_projection
api.projections.get_projection(name)
Get a projection from the database by name.
Parameters
Name
Type
Description
Default
name
str
The name of the projection to retrieve.
required
Returns
Name
Type
Description
IProjection
The projection object with the given name.
Raises
Name
Type
Description
ValueError
If the projection with the given name does not exist.
get_projections
api.projections.get_projections()
Get all projections from the database.
Returns
Name
Type
Description
dict[str, Any]
A dictionary containing all projections. Includes keys: ‘name’, ‘description’, ‘path’, ‘last_modification_date’, ‘objects’ Each value is a list of the corresponding attribute for each projection.
get_slr_scn_names
api.projections.get_slr_scn_names()
Get all sea level rise scenario names from the database.
Returns
Name
Type
Description
list
List of scenario names
interp_slr
api.projections.interp_slr(slr_scenario, year)
Interpolate sea level rise for a given scenario and year.
Parameters
Name
Type
Description
Default
slr_scenario
str
The name of the sea level rise scenario.
required
year
float
The year to interpolate sea level rise for.
required
Returns
Name
Type
Description
float
The interpolated sea level rise for the given scenario and year.
plot_slr_scenarios
api.projections.plot_slr_scenarios()
Plot sea level rise scenarios.
Returns
Name
Type
Description
str
The path to the html plot of the sea level rise scenarios.