Skip to content

Commit

Permalink
Change type hints to Union for py3.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBlyth committed Aug 6, 2024
1 parent 90caf73 commit 759b826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pybop/optimisers/scipy_optimisers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Union

import numpy as np
from scipy.optimize import OptimizeResult, differential_evolution, minimize

Expand Down Expand Up @@ -175,7 +177,7 @@ def _run_optimiser(self):

# Add callback storing history of parameter values

def base_callback(intermediate_result: OptimizeResult | np.ndarray):
def base_callback(intermediate_result: Union[OptimizeResult, np.ndarray]):
"""
Log intermediate optimisation solutions. Depending on the
optimisation algorithm, intermediate_result may be either
Expand Down

0 comments on commit 759b826

Please sign in to comment.