Skip to content

Commit f67fa88

Browse files
Merge branch 'develop' into issue_90
2 parents fabfc13 + f0d0461 commit f67fa88

File tree

5 files changed

+190
-112
lines changed

5 files changed

+190
-112
lines changed

e2e/cypress/integration/tests/actions.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
context('Actions', () => {
44
beforeEach(() => {
55
cy.visit('http://localhost:8000')
6-
})
6+
});
77

88
it('All + elements are clickable', () => {
9-
cy.get('.step-up').click( { multiple: true } )
9+
cy.get('.step-up').click( { multiple: true } );
1010

1111
// This gets the "first" input from the sidebar. From clicking step up,
12-
// the number of days to project should increase from default 60 to 70.
12+
// the Regional Population should increase from default 4119405 to 4219405.
1313
cy.get('input.st-al')
14-
.should('has.value', '70')
14+
.should('has.value', '4219405')
1515
})
16-
})
16+
});

src/app.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@
5555
draw_projected_admissions_table(st, m.admits_df, p.labels, 1, as_date=p.as_date)
5656
else:
5757
admissions_day_range = st.slider(
58-
'Interval of Days for Projected Admissions',
59-
1, 10, 7
58+
label="Interval of Days",
59+
key="admissions_day_range_slider",
60+
min_value=1,
61+
max_value=10,
62+
value=7
6063
)
6164
draw_projected_admissions_table(st, m.admits_df, p.labels, admissions_day_range, as_date=p.as_date)
6265
build_download_link(st,
@@ -79,8 +82,11 @@
7982
draw_census_table(st, m.census_df, p.labels, 1, as_date=p.as_date)
8083
else:
8184
census_day_range = st.slider(
82-
'Interval of Days for Projected Census',
83-
1, 10, 7
85+
label='Interval of Days',
86+
key="census_day_range_slider",
87+
min_value=1,
88+
max_value=10,
89+
value=7
8490
)
8591
draw_census_table(st, m.census_df, p.labels, census_day_range, as_date=p.as_date)
8692
build_download_link(st,

src/penn_chime/charts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from altair import Chart # type: ignore
66
import pandas as pd # type: ignore
7+
import numpy as np
78

89
from .parameters import Parameters
910
from .utils import add_date_column
@@ -31,8 +32,15 @@ def new_admissions_chart(
3132
x_kwargs = {"shorthand": "day", "title": "Days from today"}
3233

3334
# TODO fix the fold to allow any number of dispositions
35+
36+
ceiled_admits = projection_admits.copy()
37+
38+
ceiled_admits.hospitalized = np.ceil(ceiled_admits.hospitalized)
39+
ceiled_admits.icu = np.ceil(ceiled_admits.icu)
40+
ceiled_admits.ventilated = np.ceil(ceiled_admits.ventilated)
41+
3442
return (
35-
alt.Chart(projection_admits.head(plot_projection_days))
43+
alt.Chart(ceiled_admits.head(plot_projection_days))
3644
.transform_fold(fold=["hospitalized", "icu", "ventilated"])
3745
.mark_line(point=True)
3846
.encode(

0 commit comments

Comments
 (0)