Skip to content

Commit 9a4c2d3

Browse files
[pre-commit.ci] pre-commit autoupdate (#673)
1 parent 9f66a87 commit 9a4c2d3

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ repos:
8989
- --blank
9090
exclude: src/optimagic/optimization/algo_options.py
9191
- repo: https://github.com/astral-sh/ruff-pre-commit
92-
rev: v0.14.14
92+
rev: v0.15.4
9393
hooks:
9494
# Run the linter.
9595
- id: ruff
@@ -130,7 +130,7 @@ repos:
130130
files: (docs/.)
131131
exclude: docs/source/how_to/how_to_specify_algorithm_and_algo_options.md
132132
- repo: https://github.com/kynan/nbstripout
133-
rev: 0.9.0
133+
rev: 0.9.1
134134
hooks:
135135
- id: nbstripout
136136
exclude: |

src/optimagic/optimization/internal_optimization_problem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ def __init__(
898898
_fun_dict = {
899899
AggregationLevel.SCALAR: lambda x: ScalarFunctionValue(x @ x),
900900
AggregationLevel.LIKELIHOOD: lambda x: LikelihoodFunctionValue(x**2),
901-
AggregationLevel.LEAST_SQUARES: lambda x: LeastSquaresFunctionValue(x),
901+
AggregationLevel.LEAST_SQUARES: lambda x: LeastSquaresFunctionValue(x), # noqa: PLW0108
902902
}
903903

904904
_jac_dict = {

tests/optimagic/optimization/test_scipy_aliases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_exception_for_callback():
127127
fun=lambda x: x @ x,
128128
x0=np.arange(3),
129129
algorithm="scipy_lbfgsb",
130-
callback=lambda x: print(x),
130+
callback=print,
131131
)
132132

133133

tests/optimagic/optimization/test_with_nonlinear_constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def test_documentation_example(algorithm):
157157
params=np.ones(6),
158158
algorithm=algorithm,
159159
constraints=om.NonlinearConstraint(
160-
func=lambda x: np.prod(x),
160+
func=np.prod,
161161
selector=lambda x: x[:-1],
162162
value=1.0,
163163
),

tests/optimagic/parameters/test_nonlinear_constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def test_check_validity_nonlinear_constraint(constraint, params):
157157
def test_check_validity_nonlinear_constraint_correct_example():
158158
constr = {
159159
"func": lambda x: x,
160-
"derivative": lambda x: np.ones_like(x),
160+
"derivative": np.ones_like,
161161
"lower_bounds": np.arange(4),
162162
"selector": lambda x: x[:1],
163163
}

0 commit comments

Comments
 (0)