Skip to content

Commit 55154f1

Browse files
committed
style(lint): linting
1 parent 7281d65 commit 55154f1

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

notebooks/analysis.ipynb

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
"\n",
2121
"# pylint: disable=wrong-import-position\n",
2222
"import os\n",
23+
"\n",
24+
"from IPython.display import display\n",
2325
"import plotly.express as px\n",
2426
"\n",
2527
"from simulation.parameters import Param\n",
28+
"from simulation.model import Model\n",
2629
"from simulation.runner import Runner"
2730
]
2831
},
@@ -47,6 +50,32 @@
4750
"cell_type": "code",
4851
"execution_count": 3,
4952
"metadata": {},
53+
"outputs": [
54+
{
55+
"data": {
56+
"text/plain": [
57+
"[{'time': 1095, 'asu_occupancy': 7, 'rehab_occupancy': 12},\n",
58+
" {'time': 1096, 'asu_occupancy': 5, 'rehab_occupancy': 11},\n",
59+
" {'time': 1097, 'asu_occupancy': 5, 'rehab_occupancy': 10},\n",
60+
" {'time': 1098, 'asu_occupancy': 4, 'rehab_occupancy': 10},\n",
61+
" {'time': 1099, 'asu_occupancy': 5, 'rehab_occupancy': 10}]"
62+
]
63+
},
64+
"metadata": {},
65+
"output_type": "display_data"
66+
}
67+
],
68+
"source": [
69+
"# View the raw model run and output\n",
70+
"model = Model(Param(), run_number=0)\n",
71+
"model.run()\n",
72+
"display(model.audit_list[0:5])"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": 4,
78+
"metadata": {},
5079
"outputs": [],
5180
"source": [
5281
"# Set up runner\n",
@@ -55,7 +84,7 @@
5584
},
5685
{
5786
"cell_type": "code",
58-
"execution_count": 4,
87+
"execution_count": 5,
5988
"metadata": {},
6089
"outputs": [
6190
{
@@ -140,7 +169,7 @@
140169
"4 5 134 0.073425 0.143562 0.511450"
141170
]
142171
},
143-
"execution_count": 4,
172+
"execution_count": 5,
144173
"metadata": {},
145174
"output_type": "execute_result"
146175
}
@@ -153,7 +182,7 @@
153182
},
154183
{
155184
"cell_type": "code",
156-
"execution_count": 5,
185+
"execution_count": 6,
157186
"metadata": {},
158187
"outputs": [],
159188
"source": [
@@ -172,7 +201,7 @@
172201
},
173202
{
174203
"cell_type": "code",
175-
"execution_count": 6,
204+
"execution_count": 7,
176205
"metadata": {},
177206
"outputs": [],
178207
"source": [
@@ -233,7 +262,7 @@
233262
},
234263
{
235264
"cell_type": "code",
236-
"execution_count": 7,
265+
"execution_count": 8,
237266
"metadata": {},
238267
"outputs": [
239268
{
@@ -1964,7 +1993,7 @@
19641993
},
19651994
{
19661995
"cell_type": "code",
1967-
"execution_count": 8,
1996+
"execution_count": 9,
19681997
"metadata": {},
19691998
"outputs": [
19701999
{
@@ -2049,7 +2078,7 @@
20492078
"4 5 134 0.073425 0.143562 0.511450"
20502079
]
20512080
},
2052-
"execution_count": 8,
2081+
"execution_count": 9,
20532082
"metadata": {},
20542083
"output_type": "execute_result"
20552084
}
@@ -2093,7 +2122,7 @@
20932122
},
20942123
{
20952124
"cell_type": "code",
2096-
"execution_count": 9,
2125+
"execution_count": 10,
20972126
"metadata": {},
20982127
"outputs": [],
20992128
"source": [
@@ -2148,7 +2177,7 @@
21482177
},
21492178
{
21502179
"cell_type": "code",
2151-
"execution_count": 10,
2180+
"execution_count": 11,
21522181
"metadata": {},
21532182
"outputs": [
21542183
{

notebooks/generate_exp_results.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"\n",
2323
"# pylint: disable=wrong-import-position\n",
2424
"import os\n",
25+
"\n",
26+
"from IPython.display import display\n",
2527
"import pandas as pd\n",
2628
"\n",
2729
"from simulation.parameters import Param\n",

tests/test_backtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_model():
2121
Notes
2222
-----
2323
This is adapted from `test_reproduction` in
24-
pythonhealthdatascience/rap_template_python_des.
24+
github.com/pythonhealthdatascience/rap_template_python_des.
2525
"""
2626
# Run model and get audit list as a dataframe
2727
model = Model(param=Param(), run_number=0)
@@ -49,7 +49,7 @@ def test_runner(unit):
4949
Notes
5050
-----
5151
This is adapted from `test_reproduction` in
52-
pythonhealthdatascience/rap_template_python_des.
52+
github.com/pythonhealthdatascience/rap_template_python_des.
5353
"""
5454
# Run model and get occupancy dataframe
5555
runner = Runner(param=Param())

tests/test_functionaltest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ def test_long_los(stroke_no_esd_mean):
120120
assert len(model.patients) > total_occupancy
121121

122122

123-
# TODO: test_ev_5/6/7/8 - requires patient counts by unit and patient type
124-
125123
def test_warmup_only():
126124
"""
127125
Check that results are as expected if model is run with no data collection

tests/test_unittest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_param_valid():
5353
"""
5454
try:
5555
Param().check_param_validity()
56+
# pylint: disable=broad-exception-caught
5657
except Exception as exc:
5758
pytest.fail(
5859
f"check_param_validity() raised an unexpected exception: {exc}")

0 commit comments

Comments
 (0)