Skip to content

Commit 10b022d

Browse files
committed
fix(test): set high LOS for stroke mortality in test_long_los, and add 1_in_n_delay to expected output in test_get_occupancy_freq (both of these are related to recent changes in the model, which altered the LOS param and output table)
1 parent c4a41b0 commit 10b022d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/test_functionaltest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def test_long_los(stroke_no_esd_mean):
9898
param = Param(
9999
asu_los=ASULOS(stroke_no_esd_mean=stroke_no_esd_mean,
100100
stroke_esd_mean=los,
101+
stroke_mortality_mean=los,
101102
tia_mean=los,
102103
neuro_mean=los,
103104
other_mean=los),

tests/test_unittest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def test_get_occupancy_freq():
231231
expected_pct = [0.4, 0.3, 0.2, 0.1]
232232
expected_c_pct = [0.4, 0.7, 0.9, 1.0]
233233
expected_prob_delay = [1.0, 0.3/0.7, 0.2/0.9, 0.1/1.0]
234+
expected_1_in_n_delay = [1, 2, 4, 10]
234235

235236
# Create a Runner instance
236237
runner = Runner(None)
@@ -240,16 +241,17 @@ def test_get_occupancy_freq():
240241

241242
# Check the structure of the DataFrame
242243
assert list(result_df.columns) == [
243-
"beds", "freq", "pct", "c_pct", "prob_delay"]
244+
"beds", "freq", "pct", "c_pct", "prob_delay", "1_in_n_delay"]
244245

245246
# Check the values
246247
assert list(result_df["beds"]) == expected_beds
247248
assert list(result_df["freq"]) == expected_freq
248249
assert np.allclose(result_df["pct"], expected_pct)
249250
assert np.allclose(result_df["c_pct"], expected_c_pct)
250251

251-
# Check prob_delay calculation
252+
# Check prob_delay and 1 in n delay calculations
252253
assert np.allclose(result_df["prob_delay"], expected_prob_delay)
254+
assert np.allclose(result_df["1_in_n_delay"], expected_1_in_n_delay)
253255

254256

255257
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)