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 Jul 29, 2024
1 parent eb73d95 commit cf87fb4
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 14 deletions.
9 changes: 2 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ long_description = file: README.rst
long_description_content_type = text/x-rst
author = Janos Gabler, Tobias Raabe, Klara Röhrl
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
License :: OSI Approved :: MIT License
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
Programming Language :: Python :: 3.10

[options]
packages = find:
python_requires = >=3.6.1
python_requires = >=3.8
include_package_data = True
package_dir =
= .
Expand Down
1 change: 1 addition & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
REMOVE EVERYTHING THAT IMPORTS THE VARIABLE YOU CHANGED.
"""

import warnings
from pathlib import Path

Expand Down
2 changes: 1 addition & 1 deletion src/contact_models/task_create_contact_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def measure_of_diff_btw_distributions(params, old_distribution, desired_total):
"""
assert (params.index == old_distribution.index).all()
params_deviation = params["value"].to_numpy() - old_distribution.to_numpy()
params_penalty = (params_deviation ** 2).sum()
params_penalty = (params_deviation**2).sum()
actual_total = params.index.to_numpy() @ params["value"].to_numpy()
total_contacts_penalty = (desired_total - actual_total) ** 2
cost = total_contacts_penalty + params_penalty
Expand Down
6 changes: 3 additions & 3 deletions src/create_initial_states/create_contact_model_group_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class with 23 individuals of the same age. Classes meet their peers and 3 pairs
df[educ_group_cols] = df[educ_group_cols].astype("category")

# the stays_home_when_schools_close variable is not used yet.
df[
"stays_home_when_schools_close"
] = _identify_adult_staying_home_when_schools_close(df)
df["stays_home_when_schools_close"] = (
_identify_adult_staying_home_when_schools_close(df)
)

df = df.drop(columns=["pos_in_group", "one", "group_size"])
return df
Expand Down
1 change: 1 addition & 0 deletions src/create_initial_states/create_group_transition_probs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module is copied from sid commit 206886a14eeb3257deb71db91aba4e7fb2385fc2.
"""

import string

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/create_initial_states/create_vaccination_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- shares of each group: https://bit.ly/3cb5uUQ
"""

import numpy as np
import pandas as pd

Expand Down
6 changes: 3 additions & 3 deletions src/create_initial_states/task_build_full_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ def _add_rapid_test_reaction_params(params):
"""
params = params.copy(deep=True)
params.loc[
("rapid_test_demand", "reaction", "hh_contacts_multiplier"), "value"
] = 0.7
params.loc[("rapid_test_demand", "reaction", "hh_contacts_multiplier"), "value"] = (
0.7
)
params.loc[
("rapid_test_demand", "reaction", "not_hh_contacts_multiplier"), "value"
] = 0.15
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create a synthetic population that is representative of Germany."""

from pathlib import Path

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/plotting/task_plot_decomposition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module holds the code to compute marginal contributions and shapley values."""

from typing import Dict

import matplotlib
Expand Down
1 change: 1 addition & 0 deletions src/plotting/task_plot_incidences_by_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""For each available scenario plot the incidences in each of the age groups."""

import matplotlib.pyplot as plt
import pandas as pd
import pytask
Expand Down
1 change: 1 addition & 0 deletions src/plotting/task_plot_share_known_cases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create plots, illustrating the share known cases over time."""

import matplotlib.pyplot as plt
import pandas as pd
import pytask
Expand Down
1 change: 1 addition & 0 deletions src/policies/domain_level_policy_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
The functions here expect that the domain names are part of contact model names.
"""

from functools import partial

from src.policies.single_policy_functions import mixed_educ_policy
Expand Down
1 change: 1 addition & 0 deletions src/policies/policy_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tools to work with policy dictionaries without accidentally modifying them."""

import itertools

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions src/policies/single_policy_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
All other arguments must be documented.
"""

import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
Expand Down
1 change: 1 addition & 0 deletions src/policies/task_create_work_multiplier_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
people still go to work.
"""

import warnings
from zipfile import ZipFile

Expand Down
1 change: 1 addition & 0 deletions src/prepare_data/task_prepare_rki_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- https://covid19-de-stats.sourceforge.io/rki-fall-tabelle.html
"""

from datetime import datetime
from datetime import timedelta

Expand Down
1 change: 1 addition & 0 deletions src/simulation/scenario_simulation_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- rapid_test_reaction_models
"""

from functools import partial

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions src/testing/rapid_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for rapid tests."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/testing/testing_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PCR testing model for sid."""

import warnings

import numpy as np
Expand Down

0 comments on commit cf87fb4

Please sign in to comment.