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 2, 2024
1 parent f58cef7 commit c9dadd9
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 16 deletions.
4 changes: 1 addition & 3 deletions docs/source/_static/images/make_infectiousness_period.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,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",
")\n",
"dist_var = 2**2 * 0.12 + 4**2 * 0.29 + 6**2 * 0.47 + 10**2 * 0.12 - dist_mean**2\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
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: 1 addition & 0 deletions src/sid/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://github.com/covid-19-impact-lab/utilities/blob/master/utilities/colors.py.""
"""

import numpy as np
import seaborn as sns
from matplotlib.colors import LinearSegmentedColormap
Expand Down
1 change: 1 addition & 0 deletions src/sid/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains configuration values for sid."""

from pathlib import Path

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/sid/contacts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains everything related to contacts and matching."""

import itertools
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/sid/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code to calculate infections by events."""

import pandas as pd
from sid.config import DTYPE_VIRUS_STRAIN
from sid.virus_strains import combine_first_factorized_infections
Expand Down
7 changes: 4 additions & 3 deletions src/sid/initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
beginning of a simulation and can used to create patterns which match the real data.
"""

import itertools
import math
from typing import Any
Expand Down Expand Up @@ -456,9 +457,9 @@ def _sample_factorized_virus_strains_for_infections(
sampled_virus_strains = np.random.choice(
virus_strain_factors, p=probabilities, size=n_infected
)
spread_out_virus_strains.loc[
spread_out_infections[column], column
] = sampled_virus_strains
spread_out_virus_strains.loc[spread_out_infections[column], column] = (
sampled_virus_strains
)

return spread_out_virus_strains

Expand Down
1 change: 1 addition & 0 deletions src/sid/matching_probabilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to work with transition matrices for assortative matching."""

import string
import warnings
from typing import List
Expand Down
3 changes: 2 additions & 1 deletion src/sid/msm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
of Asset Prices. Econometrica, 61(4), 929-952.
"""

import functools

import numpy as np
Expand Down Expand Up @@ -156,7 +157,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
1 change: 1 addition & 0 deletions src/sid/parse_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code the parse input data."""

import copy
import pprint
import warnings
Expand Down
1 change: 1 addition & 0 deletions src/sid/pathogenesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
countdown lengths. Currently, most of it is deterministic.
"""

import numpy as np
import pandas as pd
from sid.config import DTYPE_DRAW_COURSE_OF_DISEASE
Expand Down
1 change: 1 addition & 0 deletions src/sid/policies.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code to for applying contact policies."""

import itertools
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/sid/seasonality.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code related to seasonality."""

import itertools
from typing import Any
from typing import Callable
Expand Down
1 change: 1 addition & 0 deletions src/sid/testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module holds the interface for the testing models."""

import itertools
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/sid/testing_demand.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the code for calculating the demand for tests."""

import itertools
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/sid/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
estimation to reduce memory consumption.
"""

from functools import partial

import pandas as pd
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
1 change: 1 addition & 0 deletions src/sid/vaccination.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code for vaccinating individuals."""

import itertools
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/sid/validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains routines to validate inputs to functions."""

import inspect
import warnings
from typing import Callable
Expand Down

0 comments on commit c9dadd9

Please sign in to comment.