Skip to content

Commit 48a61c7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1586dec commit 48a61c7

11 files changed

+7
-17
lines changed

docs/source/_static/images/make_infectiousness_period.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"source": [
127127
"dist_mean = 2 * 0.12 + 4 * 0.29 + 6 * 0.47 + 10 * 0.12\n",
128128
"dist_var = (\n",
129-
" 2 ** 2 * 0.12 + 4 ** 2 * 0.29 + 6 ** 2 * 0.47 + 10 ** 2 * 0.12 - dist_mean ** 2\n",
129+
" 2**2 * 0.12 + 4**2 * 0.29 + 6**2 * 0.47 + 10**2 * 0.12 - dist_mean**2\n",
130130
")\n",
131131
"dist_std = np.sqrt(dist_var)\n",
132132
"dist_mean, dist_std"

docs/source/_static/images/make_time_until_death.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"source": [
4242
"mean = 11.74\n",
4343
"std = 8.79\n",
44-
"var = 8.79 ** 2\n",
44+
"var = 8.79**2\n",
4545
"\n",
4646
"print(mean, std)"
4747
]

docs/source/_static/images/make_time_until_icu_recovery.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"source": [
4242
"mean = 18.8\n",
4343
"std = 12.21\n",
44-
"var = std ** 2\n",
44+
"var = std**2\n",
4545
"\n",
4646
"print(mean, std)"
4747
]

docs/source/explanations/assortative_matching.ipynb

-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@
331331
"\n",
332332
"data = {}\n",
333333
"for value in assortative_matching_params:\n",
334-
"\n",
335334
" # Change assortative matching in params.\n",
336335
" params.loc[(\"assortative_matching\", \"meet_people\", \"group\"), \"value\"] = value\n",
337336
"\n",

docs/source/reference_guides/events.rst

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ day from contacts and multiple events are merged with a logical OR.
6666
newly_infected = pd.Series(data=False, index=states.index)
6767
6868
if date == date_of_carnival_session:
69-
7069
adults_in_heinsberg = states.query(
7170
"county == 'Kreis Heinsberg' and age_group >= '10 - 19'"
7271
).index

docs/source/tutorials/how_to_model_immunity.ipynb

-2
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@
583583
"\n",
584584
"df_dict = {}\n",
585585
"for value in resistance_factors:\n",
586-
"\n",
587586
" # update the immunity resistance factor\n",
588587
" params.loc[(\"virus_strain\", \"b117\", \"immunity_resistance_factor\"), \"value\"] = value\n",
589588
"\n",
@@ -636,7 +635,6 @@
636635
"value_to_ax = {0: 5, 0.5: 6, 1: 7}\n",
637636
"\n",
638637
"for value, color in [(0, \"tab:blue\"), (0.5, \"tab:green\"), (1, \"tab:orange\")]:\n",
639-
"\n",
640638
" df_dict[value].resample(\"D\", on=\"date\")[\"ever_infected\"].mean().plot(\n",
641639
" ax=axs[0], color=color, label=value\n",
642640
" )\n",

setup.cfg

+2-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ url = https://github.com/covid-19-impact-lab/sid
77
author = Janos Gabler, Tobias Raabe, Klara Roehrl
88
author_email = [email protected]
99
license = MIT
10-
license_file = LICENSE
10+
license_files = LICENSE
1111
platforms = any
1212
classifiers =
1313
Development Status :: 3 - Alpha
@@ -16,10 +16,6 @@ classifiers =
1616
Operating System :: OS Independent
1717
Programming Language :: Python :: 3
1818
Programming Language :: Python :: 3 :: Only
19-
Programming Language :: Python :: 3.6
20-
Programming Language :: Python :: 3.7
21-
Programming Language :: Python :: 3.8
22-
Programming Language :: Python :: 3.9
2319
Topic :: Scientific/Engineering
2420
project_urls =
2521
Changelog = https://sid-dev.readthedocs.io/en/latest/changes.html
@@ -41,7 +37,7 @@ install_requires =
4137
python-snappy
4238
seaborn
4339
tqdm
44-
python_requires = >=3.6
40+
python_requires = >=3.8
4541
include_package_data = True
4642
package_dir =
4743
=src

src/sid/contacts.py

-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ def _sum_preserving_round(arr):
740740
deviation = 0
741741

742742
for i in range(len(arr)):
743-
744743
floor_value = int(arr[i])
745744
deviation += arr[i] - floor_value
746745

src/sid/initial_conditions.py

-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def sample_initial_distribution_of_infections_and_immunity(
255255
states = update_derived_state_variables(states, derived_state_variables)
256256

257257
for burn_in_date in initial_conditions["burn_in_periods"]:
258-
259258
states["date"] = burn_in_date
260259
states["period"] = timestamp_to_sid_period(burn_in_date)
261260

src/sid/msm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _msm(
156156
moment_errors = flat_simulated_moments - flat_empirical_moments
157157

158158
root_contribs = np.sqrt(np.diagonal(weighting_matrix)) * moment_errors
159-
value = np.sum(root_contribs ** 2)
159+
value = np.sum(root_contribs**2)
160160

161161
out = {
162162
"value": value,

src/sid/update_states.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _get_waning_immunity_coefficients(
289289
("immunity", "immunity_waning", f"slope_after_maximum_{event}"), "value"
290290
]
291291

292-
slope_before_maximum = maximum_immunity / (time_to_reach_maximum ** 3)
292+
slope_before_maximum = maximum_immunity / (time_to_reach_maximum**3)
293293
intercept_after_maximum = (
294294
maximum_immunity - slope_after_maximum * time_to_reach_maximum
295295
)

0 commit comments

Comments
 (0)