Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 26, 2023
1 parent 1c8658c commit 0fe497e
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"source": [
"dist_mean = 2 * 0.12 + 4 * 0.29 + 6 * 0.47 + 10 * 0.12\n",
"dist_var = (\n",
" 2 ** 2 * 0.12 + 4 ** 2 * 0.29 + 6 ** 2 * 0.47 + 10 ** 2 * 0.12 - dist_mean ** 2\n",
" 2**2 * 0.12 + 4**2 * 0.29 + 6**2 * 0.47 + 10**2 * 0.12 - dist_mean**2\n",
")\n",
"dist_std = np.sqrt(dist_var)\n",
"dist_mean, dist_std"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/images/make_time_until_death.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"source": [
"mean = 11.74\n",
"std = 8.79\n",
"var = 8.79 ** 2\n",
"var = 8.79**2\n",
"\n",
"print(mean, std)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"source": [
"mean = 18.8\n",
"std = 12.21\n",
"var = std ** 2\n",
"var = std**2\n",
"\n",
"print(mean, std)"
]
Expand Down
1 change: 0 additions & 1 deletion docs/source/explanations/assortative_matching.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@
"\n",
"data = {}\n",
"for value in assortative_matching_params:\n",
"\n",
" # Change assortative matching in params.\n",
" params.loc[(\"assortative_matching\", \"meet_people\", \"group\"), \"value\"] = value\n",
"\n",
Expand Down
1 change: 0 additions & 1 deletion docs/source/reference_guides/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ day from contacts and multiple events are merged with a logical OR.
newly_infected = pd.Series(data=False, index=states.index)
if date == date_of_carnival_session:
adults_in_heinsberg = states.query(
"county == 'Kreis Heinsberg' and age_group >= '10 - 19'"
).index
Expand Down
2 changes: 0 additions & 2 deletions docs/source/tutorials/how_to_model_immunity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@
"\n",
"df_dict = {}\n",
"for value in resistance_factors:\n",
"\n",
" # update the immunity resistance factor\n",
" params.loc[(\"virus_strain\", \"b117\", \"immunity_resistance_factor\"), \"value\"] = value\n",
"\n",
Expand Down Expand Up @@ -636,7 +635,6 @@
"value_to_ax = {0: 5, 0.5: 6, 1: 7}\n",
"\n",
"for value, color in [(0, \"tab:blue\"), (0.5, \"tab:green\"), (1, \"tab:orange\")]:\n",
"\n",
" df_dict[value].resample(\"D\", on=\"date\")[\"ever_infected\"].mean().plot(\n",
" ax=axs[0], color=color, label=value\n",
" )\n",
Expand Down
8 changes: 2 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/covid-19-impact-lab/sid
author = Janos Gabler, Tobias Raabe, Klara Roehrl
author_email = [email protected]
license = MIT
license_file = LICENSE
license_files = LICENSE
platforms = any
classifiers =
Development Status :: 3 - Alpha
Expand All @@ -16,10 +16,6 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering
project_urls =
Changelog = https://sid-dev.readthedocs.io/en/latest/changes.html
Expand All @@ -41,7 +37,7 @@ install_requires =
python-snappy
seaborn
tqdm
python_requires = >=3.6
python_requires = >=3.8
include_package_data = True
package_dir =
=src
Expand Down
1 change: 0 additions & 1 deletion src/sid/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ def _sum_preserving_round(arr):
deviation = 0

for i in range(len(arr)):

floor_value = int(arr[i])
deviation += arr[i] - floor_value

Expand Down
1 change: 0 additions & 1 deletion src/sid/initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ def sample_initial_distribution_of_infections_and_immunity(
states = update_derived_state_variables(states, derived_state_variables)

for burn_in_date in initial_conditions["burn_in_periods"]:

states["date"] = burn_in_date
states["period"] = timestamp_to_sid_period(burn_in_date)

Expand Down
2 changes: 1 addition & 1 deletion src/sid/msm.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _msm(
moment_errors = flat_simulated_moments - flat_empirical_moments

root_contribs = np.sqrt(np.diagonal(weighting_matrix)) * moment_errors
value = np.sum(root_contribs ** 2)
value = np.sum(root_contribs**2)

out = {
"value": value,
Expand Down
2 changes: 1 addition & 1 deletion src/sid/update_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _get_waning_immunity_coefficients(
("immunity", "immunity_waning", f"slope_after_maximum_{event}"), "value"
]

slope_before_maximum = maximum_immunity / (time_to_reach_maximum ** 3)
slope_before_maximum = maximum_immunity / (time_to_reach_maximum**3)
intercept_after_maximum = (
maximum_immunity - slope_after_maximum * time_to_reach_maximum
)
Expand Down

0 comments on commit 0fe497e

Please sign in to comment.