Skip to content

Commit

Permalink
simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
marufr committed Dec 9, 2024
1 parent 62567bb commit c6459d3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions sira/infrastructure_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,18 +720,7 @@ def write_system_response(response_list, infrastructure, scenario, hazards):

# -------------------------------------------------------------------------------------

@njit
def _calculate_class_failures(response_array, comp_indices, threshold=2):
"""Vectorised calculation of class failures"""
mask = response_array[:, :, comp_indices] >= threshold
return np.sum(mask, axis=2) / len(comp_indices)

@njit
def _calculate_exceedance_probs(frag_array, num_samples):
"""Calculate exceedance probabilities for damage states"""
return np.sum(frag_array >= 0, axis=0) / float(num_samples)

@njit
# @njit
def _pe2pb(pe):
"""Numba-optimized version of pe2pb"""
pex = np.sort(pe)[::-1]
Expand Down

0 comments on commit c6459d3

Please sign in to comment.