def _get_intervention_type(intervention_type, state, state_interventions_df):
    if intervention_type == Intervention.SELECTED_MITIGATION.value:
        state_intervention_results = state_interventions_df.loc[
            state_interventions_df["state"] == state]["intervention"]
        if not state_intervention_results.empty:
            intervention_string = state_intervention_results.values[0]
            return Intervention.from_str(intervention_string).value
    return intervention_type
示例#2
0
def get_intervention_for_state(state) -> Intervention:
    return Intervention.from_str(get_interventions()[state])
def get_intervention_for_state(state):
    # TODO: read this from a dataset class
    interventions_url = "https://raw.githubusercontent.com/covid-projections/covid-projections/master/src/assets/data/interventions.json"
    interventions = requests.get(interventions_url).json()
    return Intervention.from_str(interventions[state])