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 Aug 1, 2023
1 parent eb2a333 commit 1eb5710
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 13 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
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
1 change: 0 additions & 1 deletion src/create_initial_states/create_initial_infections.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def _unbiased_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/exploration/estimation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"def parallelizable_msm_func(\n",
" params, initial_states, initial_conditions, prefix, share_known_cases\n",
"):\n",
"\n",
" params_hash = hash_array(params[\"value\"].to_numpy())\n",
" path = SRC / \"exploration\" / f\"{prefix}_{params_hash}_{os.getpid()}\"\n",
"\n",
Expand Down
1 change: 0 additions & 1 deletion src/manfred/direct_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _determine_strategies_from_x_history(current_x, state, direction_window):


def _get_direct_search_sample(current_x, step_size, search_strategies, bounds):

strategies = {
"two-sided": lambda x, step: [x - step, x, x + step],
"right": lambda x, step: [x, x + step],
Expand Down
1 change: 0 additions & 1 deletion src/manfred/linesearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def _get_linesearch_sample(current_x, direction, n_points, bounds, max_step_size


def _find_maximal_linesearch_step(x, direction, bounds, max_step_size):

upper_bounds = np.minimum(x + max_step_size, bounds["upper"])
lower_bounds = np.maximum(x - max_step_size, bounds["lower"])

Expand Down
1 change: 0 additions & 1 deletion tests/test_create_initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def testcreate_group_specific_share_known_cases_both_given(
group_weights,
group_share_known_cases,
):

res = create_group_specific_share_known_cases(
overall_share_known_cases=overall_share_known_cases,
group_share_known_cases=group_share_known_cases,
Expand Down

0 comments on commit 1eb5710

Please sign in to comment.