Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/more-infra-refactoring'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptormene committed Jul 20, 2023
2 parents 6e682f9 + 12880c4 commit 46bf76c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
12 changes: 5 additions & 7 deletions doc/manual/risk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,11 @@ References
network structure, dynamics, and function using NetworkX, in Proceedings of
the 7th Python in Science Conference (SciPy2008), Gäel Varoquaux, Travis
Vaught, and Jarrod Millman (Eds), (Pasadena, CA USA), pp. 11–15
2. Poudel A, Pitilakis K, Silva V, Rao A (2023) Infrastructure Seismic Risk
Assessment: An Overview and Integration to Contemporary Open Tool Towards
Global Usage, Bulletin of Earthquake Engineering, Under Review
3. Poudel A, Pitilakis K (2023) Systemic Vulnerability and Risk Assessment of
Critical Infrastructures and Systems at Urban Scale: Prospect towards Global
Usage, Deliverable ESR 4.5, URBASIS-EU project, Under Review
4. Pitilakis, K, Franchin P, Khazai B, & Wenzel H, (Eds.) (2014) SYNER-G:
2. Poudel, A., Pitilakis, K., Silva, V. and Rao, A., (2023). Infrastructure
seismic risk assessment: an overview and integration to contemporary open
tool towards global usage. Bulletin of Earthquake Engineering.
DOI: https://doi.org/10.1007/s10518-023-01693-z
3. Pitilakis, K, Franchin P, Khazai B, & Wenzel H, (Eds.) (2014) SYNER-G:
systemic seismic vulnerability and risk assessment of complex urban,
utility, lifeline systems and critical facilities: methodology and
applications (Vol. 31), Springer,
Expand Down
16 changes: 1 addition & 15 deletions openquake/risklib/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_exposure_df(dstore):

def classify_nodes(exposure_df):
# Classifying the nodes accodingly to compute performance indicator in
# global and local scale
# global and local level

# TAZ is the acronym of "Traffic Analysis Zone"
# user can write both as well
Expand Down Expand Up @@ -304,13 +304,7 @@ def cleanup_graph(G_original, event_damage_df, g_type):
(u, v) for (u, v, data) in G.edges(data=True)
if data['id'] in nonfunctional_edges_df.index.to_list()]

# nonfunctional_edge_tuples = list(
# zip(nonfunctional_edges_df.start_node,
# nonfunctional_edges_df.end_node)
# )

G.remove_edges_from(edges_to_remove)
# G.remove_edges_from(nonfunctional_edge_tuples)
G.remove_nodes_from(nonfunctional_nodes_df.index.to_list())

return G
Expand Down Expand Up @@ -561,7 +555,6 @@ def ELWCLPCLloss_TAZ(exposure_df, G_original, TAZ_nodes,
# For example, traffic analysis zone in transportation network. This
# calculates, efficiency loss (EL),
# weighted connectivity loss (WCL),partial connectivity loss(PCL).
# Simple connectivity loss (SCL) doesnt make any sense in this case.

# To store the information of the performance indicators at connectivity
# level
Expand Down Expand Up @@ -594,13 +587,6 @@ def ELWCLPCLloss_TAZ(exposure_df, G_original, TAZ_nodes,
count = count + 1
pcl_table.at[i, 'NS0'] = count

# Code below is not giving correct answer because the path is checked from
# a TAZ to every other TAZ
# but this will include itself as well. in the above code it is done by
# specifying (if i !=j)
# pcl_table['NS0'] = [sum(nx.has_path(G_original, j, i) for j in TAZ_nodes)
# for i in TAZ_nodes]

att = nx.get_edge_attributes(G_original, 'weight')
wcl_table = calc_weighted_connectivity_loss(
G_original, att, TAZ_nodes, TAZ_nodes, wcl_table, pcl_table, 'WS0',
Expand Down

0 comments on commit 46bf76c

Please sign in to comment.