Return a dataframe with the scenarios needed for this benefit assessment run.
Parameters
Name
Type
Description
Default
benefit
IBenefit
The benefit object to check.
required
Returns
Name
Type
Description
pd.DataFrame
A dataframe with the scenarios needed for this benefit assessment run.
create_benefit
api.benefits.create_benefit(attrs)
Create a new benefit object.
Parameters
Name
Type
Description
Default
attrs
dict[str, Any]
The attributes of the benefit object to create. Should adhere to the BenefitModel schema.
required
create_benefit_scenarios
api.benefits.create_benefit_scenarios(benefit)
Create the benefit scenarios.
Parameters
Name
Type
Description
Default
benefit
IBenefit
The benefit object to create scenarios for.
required
delete_benefit
api.benefits.delete_benefit(name)
Delete a benefit object from the database.
Parameters
Name
Type
Description
Default
name
str
The name of the benefit object to delete.
required
Raises
Name
Type
Description
ValueError
If the benefit object does not exist.
edit_benefit
api.benefits.edit_benefit(benefit)
Edit a benefit object in the database.
Parameters
Name
Type
Description
Default
benefit
IBenefit
The benefit object to edit.
required
Raises
Name
Type
Description
ValueError
If the benefit object does not exist.
get_aggregation_benefits
api.benefits.get_aggregation_benefits(name)
Get the aggregation benefits for a benefit assessment.
Parameters
Name
Type
Description
Default
name
str
The name of the benefit assessment.
required
Returns
Name
Type
Description
gpd.GeoDataFrame
The aggregation benefits for the benefit assessment.
get_benefit
api.benefits.get_benefit(name)
Get a benefit from the database by name.
Parameters
Name
Type
Description
Default
name
str
The name of the benefit to retrieve.
required
Returns
Name
Type
Description
IBenefit
The benefit object with the given name.
Raises
Name
Type
Description
ValueError
If the benefit with the given name does not exist.
get_benefits
api.benefits.get_benefits()
Get all benefits from the database.
Returns
Name
Type
Description
dict[str, Any]
A dictionary containing all benefits. Includes keys: ‘name’, ‘description’, ‘path’, ‘last_modification_date’, ‘objects’ Each value is a list of the corresponding attribute for each benefit.