Skip to content

Commit 9a40583

Browse files
[pre-commit.ci] pre-commit autoupdate (#555)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tim Mensinger <[email protected]>
1 parent 15ac4c2 commit 9a40583

21 files changed

+53
-49
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ repos:
8080
- --blank
8181
exclude: src/optimagic/optimization/algo_options.py
8282
- repo: https://github.com/astral-sh/ruff-pre-commit
83-
rev: v0.7.2
83+
rev: v0.9.2
8484
hooks:
8585
# Run the linter.
8686
- id: ruff
@@ -97,7 +97,7 @@ repos:
9797
- pyi
9898
- jupyter
9999
- repo: https://github.com/executablebooks/mdformat
100-
rev: 0.7.18
100+
rev: 0.7.21
101101
hooks:
102102
- id: mdformat
103103
additional_dependencies:
@@ -109,7 +109,7 @@ repos:
109109
- '88'
110110
files: (README\.md)
111111
- repo: https://github.com/executablebooks/mdformat
112-
rev: 0.7.18
112+
rev: 0.7.21
113113
hooks:
114114
- id: mdformat
115115
additional_dependencies:
@@ -121,7 +121,7 @@ repos:
121121
files: (docs/.)
122122
exclude: docs/source/how_to/how_to_specify_algorithm_and_algo_options.md
123123
- repo: https://github.com/kynan/nbstripout
124-
rev: 0.8.0
124+
rev: 0.8.1
125125
hooks:
126126
- id: nbstripout
127127
exclude: |
@@ -132,7 +132,7 @@ repos:
132132
args:
133133
- --drop-empty-cells
134134
- repo: https://github.com/pre-commit/mirrors-mypy
135-
rev: v1.13.0
135+
rev: v1.14.1
136136
hooks:
137137
- id: mypy
138138
files: src|tests

.tools/envs/testenv-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies:
2323
- scipy>=1.2.1 # run, tests
2424
- sqlalchemy # run, tests
2525
- seaborn # dev, tests
26-
- mypy=1.13 # dev, tests
26+
- mypy=1.14.1 # dev, tests
2727
- pyyaml # dev, tests
2828
- jinja2 # dev, tests
2929
- annotated-types # dev, tests

.tools/envs/testenv-numpy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
2323
- seaborn # dev, tests
24-
- mypy=1.13 # dev, tests
24+
- mypy=1.14.1 # dev, tests
2525
- pyyaml # dev, tests
2626
- jinja2 # dev, tests
2727
- annotated-types # dev, tests

.tools/envs/testenv-others.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
2323
- seaborn # dev, tests
24-
- mypy=1.13 # dev, tests
24+
- mypy=1.14.1 # dev, tests
2525
- pyyaml # dev, tests
2626
- jinja2 # dev, tests
2727
- annotated-types # dev, tests

.tools/envs/testenv-pandas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- scipy>=1.2.1 # run, tests
2222
- sqlalchemy # run, tests
2323
- seaborn # dev, tests
24-
- mypy=1.13 # dev, tests
24+
- mypy=1.14.1 # dev, tests
2525
- pyyaml # dev, tests
2626
- jinja2 # dev, tests
2727
- annotated-types # dev, tests

docs/source/development/ep-01-pytrees.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ much complexity by avoiding complex pytrees as inputs and outputs at the same ti
384384
To see this in action, let's look at an example. We repeat the example from the JAX
385385
interface above with the following changes:
386386

387-
1. The 1d numpy array in x\["a"\] is replaced by a DataFrame with `"value"` column
387+
1. The 1d numpy array in x["a"] is replaced by a DataFrame with `"value"` column
388388
1. The "d" entry in the output becomes a Series instead of a 1d numpy array.
389389

390390
```python
@@ -460,7 +460,7 @@ very first jacobian:
460460
+--------+----------+----------+----------+----------+----------+----------+----------+
461461
```
462462

463-
The indices \["j", "k", "l", "m"\] unfortunately never made it into the result because
463+
The indices ["j", "k", "l", "m"] unfortunately never made it into the result because
464464
they were only applied to elements that already came from a 2d array and thus always
465465
have a 3d Jacobian, i.e. the result entry `["c"][b"]` is a reshaped version of the upper
466466
right 2 by 4 array and the result entry `["d"]["b"]` is a reshaped version of the lower

docs/source/how_to/how_to_scaling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ these considerations are typically tighter than for parameters that have a small
9090
on the objective function.
9191

9292
Thus, a natural approach to improve the scaling of the optimization problem is to re-map
93-
all parameters such that the bounds are \[0, 1\] for all parameters. This has the
93+
all parameters such that the bounds are [0, 1] for all parameters. This has the
9494
additional advantage that absolute and relative convergence criteria on parameter
9595
changes become the same.
9696

@@ -164,7 +164,7 @@ to a strictly non-zero number for the `"start_values"` and `"gradient"` approach
164164
`"bounds"` approach avoids division by exact zeros by construction. The
165165
`"clipping_value"` can still be used to avoid extreme upscaling of parameters with very
166166
tight bounds. However, this means that the bounds of the re-scaled problem are not
167-
exactly \[0, 1\] for all parameters.
167+
exactly [0, 1] for all parameters.
168168

169169
(scaling-default-values)=
170170

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies:
3131
- sphinx-panels # docs
3232
- sphinxcontrib-bibtex # docs
3333
- seaborn # dev, tests
34-
- mypy=1.13 # dev, tests
34+
- mypy=1.14.1 # dev, tests
3535
- pyyaml # dev, tests
3636
- jinja2 # dev, tests
3737
- furo # dev, docs

src/optimagic/differentiation/derivatives.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def first_derivative(
328328
f0 = np.array(f0, dtype=np.float64)
329329

330330
# convert the raw evaluations to numpy arrays
331-
raw_evals = _convert_evals_to_numpy(
331+
raw_evals_arr = _convert_evals_to_numpy(
332332
raw_evals=raw_evals,
333333
unpacker=unpacker,
334334
registry=registry,
@@ -337,9 +337,9 @@ def first_derivative(
337337
)
338338

339339
# apply finite difference formulae
340-
evals_data = np.array(raw_evals).reshape(2, n_steps, len(x), -1)
341-
evals_data = np.transpose(evals_data, axes=(0, 1, 3, 2))
342-
evals = Evals(pos=evals_data[0], neg=evals_data[1])
340+
evals_data = np.array(raw_evals_arr).reshape(2, n_steps, len(x), -1)
341+
evals_data_transposed = np.transpose(evals_data, axes=(0, 1, 3, 2))
342+
evals = Evals(pos=evals_data_transposed[0], neg=evals_data_transposed[1])
343343

344344
jac_candidates = {}
345345
for m in ["forward", "backward", "central"]:

src/optimagic/differentiation/generate_steps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def generate_steps(
9090
)
9191
min_steps = base_steps if min_steps is None else min_steps
9292

93-
assert (
94-
bounds.upper - bounds.lower >= 2 * min_steps
95-
).all(), "min_steps is too large to fit into bounds."
93+
assert (bounds.upper - bounds.lower >= 2 * min_steps).all(), (
94+
"min_steps is too large to fit into bounds."
95+
)
9696

9797
upper_step_bounds = bounds.upper - x
9898
lower_step_bounds = bounds.lower - x

0 commit comments

Comments
 (0)