CodeForPhilly / CodeForPhilly/chime

Missing 1 hospitalized

Aperta
#352 1 commento 0 reazioni 2 assegnatari Rivendicata da @PhilMiller Vedi su GitHub
bug python qa
Lingua principale
Python
Stelle
210
Fork
153
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Corey review, confirm, and suggest a solution.

There is an initial hospitalized patient because fitting was done for the date_first_hospitalized or date_first_hospitalized was estimated from doubling_time.

This likely causes an underestimate in growth rate for small marked share, because a single hospitalized patient represents a larger change from zero than in larger market shares.

This shows up later in test_model_cumulative_census:
```
# TODO: is 1.0 for ceil function?
diff = admits.hospitalized[1:-1] - (
0.05 * 0.05 * (raw_df.infected[1:-1] + raw_df.recovered[1:-1]) - 1.0
)
```

Missing a patient during in build_dispositions_df:
```
def build_dispositions_df(
raw_df: pd.DataFrame,
rates: Dict[str, float],
market_share: float,
current_date: datetime,
) -> pd.DataFrame:
"""Build dispositions dataframe of patients adjusted by rate and market_share."""
patients = raw_df.infected + raw_df.recovered
day = raw_df.day
return pd.DataFrame({
"day": day,
"date": day.astype('timedelta64[D]') + np.datetime64(current_date),
**{
key: patients * rate * market_share
for key, rate in rates.items()
}
})
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.