Skip to content

Commit

Permalink
Fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
janosg committed May 20, 2023
1 parent 7341fe1 commit 79725ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
10 changes: 1 addition & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,11 @@ repos:
- --wrap-descriptions
- '88'
- --blank
exclude: src/estimagic/optimization/algo_options.py
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.263
hooks:
- id: ruff
# args:
# - --verbose
# - repo: https://github.com/kynan/nbstripout
# rev: 0.6.1
# hooks:
# - id: nbstripout
# args:
# - --extra-keys
# - metadata.kernelspec metadata.language_info.version metadata.vscode
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions src/estimagic/optimization/algo_options.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

"""
The order is the following:
Expand Down
6 changes: 3 additions & 3 deletions tests/optimization/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import pytest
from estimagic.examples.criterion_functions import sos_scalar_criterion
from estimagic.exceptions import InvalidKwargsError
from estimagic.exceptions import InvalidKwargsError, InvalidFunctionError
from estimagic.optimization.optimize import maximize, minimize


Expand All @@ -23,9 +23,9 @@ def test_scipy_lbfgsb_actually_calls_criterion_and_derivative():
params = pd.DataFrame(data=np.ones((10, 1)), columns=["value"])

def raising_crit_and_deriv(params): # noqa: ARG001
raise Exception()
raise NotImplementedError("This should not be called.")

with pytest.raises(Exception):
with pytest.raises(InvalidFunctionError, match="Error while evaluating"):
minimize(
criterion=sos_scalar_criterion,
params=params,
Expand Down

0 comments on commit 79725ba

Please sign in to comment.