Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
Expand All @@ -18,7 +18,7 @@ repos:
args: [--branch, main]
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0 # Use the ref you want to point at
rev: v1.10.0 # Use the ref you want to point at
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
Expand All @@ -32,31 +32,31 @@ repos:
- id: text-unicode-replacement-char
exclude_types: [jupyter]
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.14.0
hooks:
- id: reorder-python-imports
types: [python]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
rev: v2.7.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 24.10.0
hooks:
- id: black
types: [python]
- repo: https://github.com/asottile/blacken-docs
rev: v1.11.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black]
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.1.1
hooks:
- id: flake8
types: [python]
Expand All @@ -76,29 +76,29 @@ repos:
Pygments,
]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.1.1
rev: 1.9.1
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
- id: nbqa-isort
- repo: https://github.com/PyCQA/doc8
rev: 0.9.1
rev: v1.1.2
hooks:
- id: doc8
- repo: https://github.com/econchick/interrogate
rev: 1.5.0
rev: 1.7.0
hooks:
- id: interrogate
args: [-v, --fail-under=78, src]
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.3.0
hooks:
- id: codespell
exclude: \.ipynb
args: [-L effekt, -L unparseable]
- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
rev: "0.50"
hooks:
- id: check-manifest
- repo: meta
Expand Down
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.9
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
Loading