Skip to content

Commit

Permalink
Fix old python typing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
khurram-ghani committed Nov 29, 2023
1 parent 505631a commit b90d3a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions tests/integration/test_ask_tell_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import copy
import pickle
import tempfile
from typing import Callable, Tuple
from typing import Callable, Tuple, Union

import numpy.testing as npt
import pytest
Expand Down Expand Up @@ -124,17 +124,17 @@
)


AcquisitionRuleFunction = (
Callable[[], AcquisitionRule[TensorType, SearchSpace, TrainableProbabilisticModel]]
| Callable[
AcquisitionRuleFunction = Union[
Callable[[], AcquisitionRule[TensorType, SearchSpace, TrainableProbabilisticModel]],
Callable[
[],
AcquisitionRule[
State[TensorType, AsynchronousRuleState | BatchTrustRegionBox.State],
State[TensorType, Union[AsynchronousRuleState, BatchTrustRegionBox.State]],
Box,
TrainableProbabilisticModel,
],
]
)
],
]


@random_seed
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/test_bayesian_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import tempfile
from functools import partial
from pathlib import Path
from typing import Any, List, Mapping, Optional, Tuple, Type, cast
from typing import Any, List, Mapping, Optional, Tuple, Type, Union, cast

import dill
import gpflow
Expand Down Expand Up @@ -280,14 +280,14 @@ def GPR_OPTIMIZER_PARAMS() -> Tuple[str, List[ParameterSet]]:
)


AcquisitionRuleType = (
AcquisitionRule[TensorType, SearchSpace, TrainableProbabilisticModelType]
| AcquisitionRule[
State[TensorType, AsynchronousRuleState | BatchTrustRegion.State],
AcquisitionRuleType = Union[
AcquisitionRule[TensorType, SearchSpace, TrainableProbabilisticModelType],
AcquisitionRule[
State[TensorType, Union[AsynchronousRuleState, BatchTrustRegion.State]],
Box,
TrainableProbabilisticModelType,
]
)
],
]


@random_seed
Expand Down

0 comments on commit b90d3a1

Please sign in to comment.