ra2ce.analysis.damages.shape_to_integrate_object package#

Submodules#

ra2ce.analysis.damages.shape_to_integrate_object.hz_to_integrate_shaper module#

class HzToIntegrateShaper(gdf)[source]#

Bases: ToIntegrateShaperProtocol

Shapes hazard data for integration.

Attributes:

gdf (GeoDataFrame): Input GeoDataFrame containing hazard data.

Parameters:

gdf (GeoDataFrame)

gdf: GeoDataFrame#
get_return_periods()[source]#

Get the return periods available in the GeoDataFrame.

Return type:

list

Returns:

list[float]: Sorted list of return periods extracted from the columns.

shape_to_integrate_object(return_periods)[source]#

Shape the hazard data for integration based on selected return periods.

Return type:

dict[slice(<class ‘str’>, <class ‘geopandas.geodataframe.GeoDataFrame’>, None)]

Parameters:

return_periods (list)

Args:

return_periods: List of return period column names to extract.

Returns:

dict[str, GeoDataFrame]: Dictionary mapping the damage curve name to a GeoDataFrame containing the selected and sorted hazard data.

ra2ce.analysis.damages.shape_to_integrate_object.man_to_integrate_shaper module#

class ManToIntegrateShaper(gdf)[source]#

Bases: ToIntegrateShaperProtocol

Parameters:

gdf (GeoDataFrame)

gdf: GeoDataFrame#
get_return_periods()[source]#

Get the names of the columns containing damage data.

Return type:

list

Returns:

list[float]: Column names corresponding to calculated damages.

shape_to_integrate_object(return_periods)[source]#

Create objects for integration based on damage curves and return periods.

Return type:

dict[slice(<class ‘str’>, <class ‘geopandas.geodataframe.GeoDataFrame’>, None)]

Parameters:

return_periods (list)

Args:

return_periods: List of return periods to extract and prepare.

Returns:

dict[str, GeoDataFrame]: A dictionary mapping each vulnerability curve name to a GeoDataFrame containing the relevant columns for risk calculation.

ra2ce.analysis.damages.shape_to_integrate_object.osd_to_integrate_shaper module#

class OsdToIntegrateShaper(gdf)[source]#

Bases: ToIntegrateShaperProtocol

Shapes OSD (Origin-Destination) hazard data for integration.

Attributes:

gdf (GeoDataFrame): Input GeoDataFrame containing hazard data.

Parameters:

gdf (GeoDataFrame)

gdf: GeoDataFrame#
get_return_periods()[source]#

Extract all return periods (RP) from the GeoDataFrame columns.

Return type:

list

Returns:

list[float]: Sorted list of return periods.

Raises:

ValueError: If no columns matching the RP pattern are found.

shape_to_integrate_object(return_periods)[source]#

Shape the hazard data for integration based on selected return periods.

Return type:

dict[slice(<class ‘str’>, <class ‘geopandas.geodataframe.GeoDataFrame’>, None)]

Parameters:

return_periods (list)

Args:

return_periods: List of return period column names to extract.

Returns:

dict[str, GeoDataFrame]: Dictionary mapping vulnerability curve names to GeoDataFrames containing the selected and sorted hazard data.

ra2ce.analysis.damages.shape_to_integrate_object.to_Integrate_shaper_protocol module#

class ToIntegrateShaperProtocol(*args, **kwargs)[source]#

Bases: Protocol

Protocol for shaping hazard data into objects suitable for risk integration.

Attributes:

gdf (GeoDataFrame): Input GeoDataFrame containing hazard data.

gdf: GeoDataFrame#
get_return_periods()[source]#

Get the names of the columns containing damage data.

Return type:

list

Returns:

list[float]: Column names corresponding to calculated damages.

shape_to_integrate_object(return_periods)[source]#

Create objects for integration based on damage curves and return periods.

Return type:

dict[slice(<class ‘str’>, <class ‘geopandas.geodataframe.GeoDataFrame’>, None)]

Parameters:

return_periods (list)

Args:

return_periods: List of return periods to extract and prepare.

Returns:

dict[str, GeoDataFrame]: A dictionary mapping each vulnerability curve name to a GeoDataFrame containing the relevant columns for risk calculation.

ra2ce.analysis.damages.shape_to_integrate_object.to_integrate_shaper_factory module#

class ToIntegrateShaperFactory[source]#

Bases: object

static get_shaper(gdf, damage_function)[source]#
Return type:

ToIntegrateShaperProtocol

Parameters:

Module contents#