# wntr.scenario.fragility_curve module¶

The wntr.scenario.fragility_curve module includes methods to define damage states and priority and return the probability of damage based on a control variable.

class wntr.scenario.fragility_curve.FragilityCurve[source]

Bases: object

Fragility Curve class.

Methods

 add_state(name[, priority, distribution]) Add a damage state distribution cdf_probability(x) Return the CDF probability for each state, based on the value of x get_priority_map() Returns a dictonary of state name and priority number. sample_damage_state(Pr) Sample the damage state using a uniform random variable states() A generator to iterate over all states, in order of priority
add_state(name, priority=0, distribution={})[source]

Parameters: name : string Name of the damage state priority : int Damage state priority distribution : dict, key = string, value = scipy.stats statistical function ‘Default’ can be used to specificy all location
states()[source]

A generator to iterate over all states, in order of priority

Returns: state_name, state
get_priority_map()[source]

Returns a dictonary of state name and priority number.

cdf_probability(x)[source]

Return the CDF probability for each state, based on the value of x

Parameters: x : pd.Series Control variable for each element Pr : pd.Dataframe Probability of exceeding a damage state
sample_damage_state(Pr)[source]

Sample the damage state using a uniform random variable

Parameters: Pr : pd.Dataframe Probability of exceeding a damage state damage_state : pd.Series The damage state of each element