diff --git a/e2e/cypress/integration/tests/actions.spec.js b/e2e/cypress/integration/tests/actions.spec.js index 89d4a788..5df7a558 100644 --- a/e2e/cypress/integration/tests/actions.spec.js +++ b/e2e/cypress/integration/tests/actions.spec.js @@ -10,7 +10,8 @@ context('Actions', () => { // This gets the "first" input from the sidebar. From clicking step up, // the Regional Population should increase from default 4119405 to 4219405. + // Updated to 3600000 cy.get('input.st-al').eq(0) - .should('has.value', '4119406') + .should('has.value', '3600000') }) }); diff --git a/src/penn_chime/models.py b/src/penn_chime/models.py index 19d1fe1e..457f4df2 100644 --- a/src/penn_chime/models.py +++ b/src/penn_chime/models.py @@ -182,7 +182,10 @@ def get_loss(self) -> float: def get_argmin_ds(census_df: pd.DataFrame, current_hospitalized: float) -> float: - losses_df = (census_df.hospitalized - current_hospitalized) ** 2.0 + # By design, this forbids choosing a day after the peak + # If that's a problem, see #381 + peak_day = census_df.hospitalized.argmax() + losses_df = (census_df.hospitalized[:peak_day] - current_hospitalized) ** 2.0 return losses_df.argmin()