7.1.1. infrarisk.src.hazards package
7.1.1.1. infrarisk.src.hazards.custom module
- class infrarisk.src.hazards.custom.CustomDisruption(affected_components, name='User defined disruptions', time_of_occurrence=6000)
Bases:
object- generate_disruption_file(location=None, folder_extra=None, minimum_data=0, maximum_data=None)
Generates the disruption file consisting of the list of failed components, time of occurrence, and failure percentage (damage extent).
- Parameters:
location (string) – The location of the file to be saved.
- get_fail_compon_dict()
Returns the dictionary of that could be failed due to a radial disaster.
- Returns:
dictionary of components that could be failed.
- Return type:
dictionary
- plot_disruptions(integrated_graph)
- set_affected_components(G, plot_components=True)
- set_fail_compon_dict()
Sets the dictionary of components that could be failed due to a radial disaster.
- set_time_of_occurrence(time_of_occurrence)
Sets the time of occurrence of the disruptive event.
- Parameters:
time_of_occurrence (integer) – Time in seconds and multiple of 60.
7.1.1.2. infrarisk.src.hazards.fragility_based module
Class of disruption based on fragility analysis
- class infrarisk.src.hazards.fragility_based.FragilityBasedDisruption(resilience_level='high', name='Fragility based disruption', fragility_df=None, time_of_occurrence=6000)
Bases:
object- ascertain_damage_probabilities(component, imt_type, imt_value, plotting=True)
Ascertains the damage of a component type
- Parameters:
component (str) – The component type
imt_value (float) – The intensity measure value
- ascertain_pipe_damage_probabilities(wn, pipe, gmf_gpd, method=1, plotting=True)
- assign_recovery_time(component, failure_state)
Assigns the recovery time of a component based on the failure state.
- Parameters:
component (str) – The component identifier
failure_state (str) – The failure state of the component
- Returns:
The recovery time of the component
- Return type:
float
- static calculate_state_probability(imt, median, beta)
Calculates the damage state cumulative probability from the fragility functions.
- Parameters:
imt (string) – The intensity measure used in the fragility curves.
median (float) – The median parameter of the fragility curve corresponding to the damage state.
beta (float) – The beta parameter of the fragility curve corresponding to the damage state.
- Returns:
The cumulative probability distribution value corresponding to the damage state.
- Return type:
float
- generate_bokeh_disruptions(integrated_graph, infra, map_extends)
- generate_disruption_file(location=None, folder_extra=None, minimum_data=0, maximum_data=None)
Generates the disruption file consisting of the list of failed components, time of occurrence, and failure percentage (damage extent).
- Parameters:
location (string) – The location of the file to be saved.
- get_affected_components()
Returns the disrupted infrastructure components.
- Returns:
The disrupted infrastructure components along with their disruption states probabilities.
- Return type:
pandas.DataFrame object
- get_fail_compon_dict()
Returns the dictionary of the component types that fail
- Returns:
The dictionary of the component types in each infrastructure system that must be considered for disruption
- Return type:
dict
- static get_imt_at_line(start_coords, end_coords, imt_type, gmf_gpd)
Returns the maximum intensity measure (PGA, PGV, or PGD) along a line if corresponding fragility curves are available.
- Parameters:
start_coords (list) – The coordinates of the start point (latitude, longitude) in UTM
end_coords (list) – The coordinates of the end point (latitude, longitude) in UTM
imt_type (str) – The intensity measure type (PGA, PGV, PGD)
gmf_gpd (geopandas.GeoDataFrame) – The ground motion field data
- Returns:
The maximum intensity measure along the line
- Return type:
float
- static get_imt_at_point(coords, imt_type, gmf_gpd)
Returns the intensity measure (PGA, PGV, or PGD) at a point if corresponding fragility curves are available.
- Parameters:
coords (list) – The coordinates of the point (latitude, longitude) in UTM
imt_type (str) – The intensity measure type (PGA, PGV, PGD)
gmf_gpd (geopandas.GeoDataFrame) – The ground motion field data
- Returns:
The intensity measure at the point
- Return type:
float
- get_imt_dict()
Returns the mapping between infrastructure components and corresponding imt measures as a dictionary.
- Returns:
The dictionary with component prefix as the keys and imt measure types as the values.
- Return type:
dictionary
- plot_disruptions(integrated_graph, map_extends)
- plot_failure_distributions()
- plot_imt(gmf_gpd, imt_column)
Plots the fragility curves based on intensity measure type (PGA, PGV, or PGD) on the map.
- Parameters:
gmf_gpd (geopandas.GeoDataFrame) – The ground motion field data
imt_column (str) – The intensity measure type (PGA, PGV, PGD)
- plot_state_probabilities(imt_type, imt_value, compon_type, state_cdf)
Plots the probabilities of a component being in different damage states for a given intensity measure value
- Parameters:
imt_type (str) – The intensity measure type (PGA, PGV, PGD)
imt_value (float) – The intensity measure value
compon_type (str) – The component type
state_cdf (list) – The cumulative probabilities of the component being in different damage states
- set_affected_components(integrated_network, gmf_gpd, disruption_time, plot_components=True)
Determines the dirupted infrastructure components using the calculated damage state probabilities.
- Parameters:
G (IntegratedNetwork.integrated_graph object) – The networkx integrated graph object
gmf_gpd (geopandas.GeoDataFrame object) – The geopandas GeoDataFrame that consists of the ground motion fields at available geographic points.
disruption_time (integer) – The time of disruption in seconds
plot_components (bool, optional) – boolean to determine whether to generate the diruption plots, defaults to True
- set_all_fragility_and_recovery_curves()
Creates a dictionary of all fragility curves that will be used in generating the disruptions.
- set_compon_fragility_curves(compon_prefix, imt, list_of_states, list_of_ds_median, list_of_ds_beta)
Sets the fragility curves for a component type
- Parameters:
compon_prefix (str) – The prefix of the component type
imt (str) – The intensity measure type
list_of_states (list) – The list of states
list_of_ds_median (list) – The list of median values of the fragility curves in the order of states
list_of_ds_beta (list) – The list of beta values of the fragility curves in the order of states
- set_compon_recovery_curves(compon_prefix, list_of_states, list_of_recov_mean, list_of_recov_sigma)
Sets the recovery curves for a component type
- Parameters:
compon_prefix (str) – The prefix of the component type
list_of_states (list) – The list of states
list_of_recov_mean (list) – The list of mean values of the recovery curves in the order of states
list_of_recov_sigma (list) – The list of sigma values of the recovery curves in the order of states
- set_fail_compon_dict(fail_compon_dict)
Sets the dictionary of the component types that fail
- Parameters:
fail_compon_dict (dict) – The dictionary of the component types in each infrastructure system that must be considered for disruption.
- set_gmfs(G, gmf_gpd)
Calculates the ground motion field values of all components that must be considered for disruptions.
- Parameters:
G (IntegratedNetwork.integrated_graph object) – The integrated graph object
gmf_gpd (geopandas.GeoDataFrame object) – The geopandas GeoDataFrame that consists of the ground motion fields at available geographic points.
- set_imt_dict()
Sets the mapping between infrastructure components and corresponding imt measures used in fragility curves, if available.
- set_link_gmfs(G, gmf_gpd)
Calculates the ground motion field values of all link (edge) components that must be considered for disruptions.
- Parameters:
G (IntegratedNetwork.integrated_graph object) – The integrated graph object
gmf_gpd (geopandas.GeoDataFrame object) – The geopandas GeoDataFrame that consists of the ground motion fields at available geographic points.
- set_node_gmfs(G, gmf_gpd)
Calculates the ground motion field values of all node components that must be considered for disruptions.
- Parameters:
G (IntegratedNetwork.integrated_graph object) – The integrated graph object
gmf_gpd (geopandas.GeoDataFrame object) – The geopandas GeoDataFrame that consists of the ground motion fields at available geographic points.
7.1.1.3. infrarisk.src.hazards.radial module
- class infrarisk.src.hazards.radial.RadialDisruption(name='Radial disruption', point_of_occurrence=None, radius_of_impact=100, time_of_occurrence=6000, intensity='high')
Bases:
objectClass of disaster where the probability of failure of components reduces with distance from the point of occurrence of the event.
- assign_link_failure(p_occ, start_coords, end_coords)
Assigns the link failure status.
- Parameters:
p_occ (shapely Point object) – The point of occurrence of the disruptive event.
start_coords (tuple) – The coordinates of the start node of the link.
end_coords (tuple) – The coordinates of the end node of the link.
- Returns:
The failure status of the link
- Return type:
bool
- assign_node_failure(p_occ, node_point)
Assigns node failure status.
- Parameters:
p_occ (shapely Point object) – The point of occurrence of the disruptive event.
node_point (shapely Point object) – The node for which the failure status is to be assigned.
- Returns:
The failure status of the node.
- Return type:
bool
- generate_disruption_file(location=None, folder_extra=None, minimum_data=0, maximum_data=None)
Generates the disruption file consisting of the list of failed components, time of occurrence, and failure percentage (damage extent).
- Parameters:
location (string) – The location of the file to be saved.
- get_fail_compon_dict()
Returns the dictionary of that could be failed due to a radial disaster.
- Returns:
dictionary of components that could be failed.
- Return type:
dictionary
- plot_disruptions(integrated_graph)
- set_affected_components(G, plot_components=True)
Set the affected components (nodes and link)
- Parameters:
G (Networkx object) – The infrastructure network as a networkx graph.
plot_components (bool, optional) – plots affected components, defaults to True
- set_fail_compon_dict(fail_compon_dict={'power': ['L'], 'transport': ['L'], 'water': ['PMA', 'WP']})
Sets the dictionary of components that could be failed due to a radial disaster.
- Parameters:
fail_compon_dict (_type_) – A dictionary of the prefixes of different infrastructure components that must be considered for failing
- set_intensity_failure_probability()
Sets the vulnerability (probability of failure) based on the intensity of the disaster event (currently arbitrary values are used).
- set_point_of_occurrence(point_of_occurrence)
Sets the point of occurrence of the radial disruption.
- Parameters:
point_of_occurrence (tuple, optional) – The central point (represented by a tuple of longitude and latitude) of the disruptive event, defaults to None
- set_radius_of_impact(radius_of_impact)
Sets the radius of the radial disruption.
- Parameters:
radius_of_impact (float or integer, optional) – The radius of the impact (he probability of failure at the curcumferance reacher zero) in metres., defaults to None
- set_time_of_occurrence(time_of_occurrence)
Stes the time of occurrence of the disruptive event.
- Parameters:
time_of_occurrence (integer) – Time in seconds and multiple of 60.
7.1.1.4. infrarisk.src.hazards.random module
A class for radom network disruptions
- class infrarisk.src.hazards.random.RandomDisruption(failure_count={'power': 1, 'transpo': 1, 'water': 1}, compon_scope=None, time_of_occurrence=6000, name='Random disruption')
Bases:
object- generate_disruption_file(location=None, folder_extra=None, minimum_data=0, maximum_data=None)
Generates the disruption file consisting of the list of failed components, time of occurrence, and failure percentage (damage extent).
- Parameters:
location (string) – The location of the file to be saved.
- get_fail_compon_dict()
Returns the dictionary of that could be failed due to a radial disaster.
- Returns:
dictionary of components that could be failed.
- Return type:
dictionary
- plot_disruptions(integrated_graph)
- set_affected_components(G, plot_components=True)
- set_fail_compon_dict(fail_compon_dict={'power': ['L'], 'transport': ['L'], 'water': ['PMA', 'WP']})
Sets the dictionary of components that could be failed due to a radial disaster.
- Parameters:
fail_compon_dict (_type_) – A dictionary of the prefixes of different infrastructure components that must be considered for failing
- set_time_of_occurrence(time_of_occurrence)
Sets the time of occurrence of the disruptive event.
- Parameters:
time_of_occurrence (integer) – Time in seconds and multiple of 60.
7.1.1.5. infrarisk.src.hazards.track module
- class infrarisk.src.hazards.track.TrackDisruption(hazard_tracks=None, buffer_of_impact=25, time_of_occurrence=6000, intensity='high', name='Track disruption')
Bases:
objectClass of flood disaster where the probability of failure of components reduces with the longitudinal distance from the track of the event.
- assign_link_failure(track, link_line)
Assigns the link failure status.
- Parameters:
track (shapely LineString object) – The track of the disruptive event.
link_line (shapely LineString object) – The link for which the failure status is to be assigned.
- Returns:
The failure status of the link.
- Return type:
bool
- assign_node_failure(track, node_point)
Assigns node failure status.
- Parameters:
track (shapely LineString object) – The track of the disruptive event.
node_point (shapely Point object.) – The node for which the failure status is to be assigned.
- Returns:
The failure status of the node.
- Return type:
bool
- generate_disruption_file(location=None, folder_extra=None, minimum_data=0, maximum_data=None)
Generates the disruption file consisting of the list of failed components, time of occurrence, and failure percentage (damage extent).
- Parameters:
location (string) – The location of the file to be saved.
- generate_random_track(loc_extents, shape='spline')
Generates a random track using a spline connecting three points on the map. :param loc_extents: The [(xmin, ymin), (xmax, ymax)] coordinates from the map denoting the occurrence of the event. :type loc_extents: list of tutples :param shape: The method of generating the track. If “line”, generates a straight line, if “spline”, generates a smooth curve. :type shape: string :return: The disaster track. :rtype: shapely LineString object
- get_fail_compon_dict()
Returns the dictionary of that could be failed due to a radial disaster.
- Returns:
dictionary of components that could be failed.
- Return type:
dictionary
- plot_disruptions(integrated_graph)
- set_affected_components(G, plot_components=True)
Set the affected components (nodes and link)
- Parameters:
G (Networkx object) – The infrastructure network as a networkx graph.
plot_components (bool, optional) – plots affected components, defaults to True
- set_buffer_of_impact(buffer_of_impact)
Sets the impact buffer distance in meters.
- Parameters:
buffer_of_impact (interger or float) – Impact buffer distance in meters.
- set_fail_compon_dict(fail_compon_dict={'power': ['L'], 'transport': ['L'], 'water': ['PMA', 'WP']})
Sets the dictionary of components that could be failed due to a radial disaster.
- Parameters:
fail_compon_dict (_type_) – A dictionary of the prefixes of different infrastructure components that must be considered for failing
- set_hazard_tracks_from_linestring(linestring_track)
Sets a hazard track from a LineString object.
- Parameters:
linestring_track (LineString object) – A shapely LineString object denoting the track of the hazard.
- set_hazard_tracks_from_shapefile(hazard_tracks)
Sets the tracks of the track-based hazard from a shapefile.
- Parameters:
hazard_tracks (shapefile) – A shapefile that has tracks of the event as LineString objects.
- set_intensity_failure_probability()
Sets the vulnerability (probability of failure) based on the intensity of the disaster event (currently arbitrary values are used).
- set_time_of_occurrence(time_of_occurrence)
Sets the time of occurrence of the disruptive event.
- Parameters:
time_of_occurrence (integer) – Time in seconds and multiple of 60.