Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 8, 2023
1 parent ca78a92 commit 52b4614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions optimas/explorations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ def __init__(
history_save_period: Optional[int] = None,
exploration_dir_path: Optional[str] = "./exploration",
resume: Optional[bool] = False,
libe_comms: Optional[Literal["local", "local_threading", "mpi"]] = "local",
libe_comms: Optional[
Literal["local", "local_threading", "mpi"]
] = "local",
) -> None:
if libe_comms == "local_threading" and not isinstance(evaluator, FunctionEvaluator):
if libe_comms == "local_threading" and not isinstance(
evaluator, FunctionEvaluator
):
raise ValueError(
"'local_threading' mode is only supported when using a "
"`FunctionEvaluator`. Use 'local' mode instead."
Expand Down
3 changes: 1 addition & 2 deletions tests/test_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_libe_comms():
max_evals = 10

for comm in ["local", "local_threading"]:

# Create generator.
gen = RandomSamplingGenerator(
varying_parameters=[var1, var2], objectives=[obj]
Expand All @@ -40,7 +39,7 @@ def test_libe_comms():
max_evals=max_evals,
sim_workers=2,
exploration_dir_path=f"./tests_output/test_comms_{comm}",
libe_comms=comm
libe_comms=comm,
)

# Run exploration.
Expand Down

0 comments on commit 52b4614

Please sign in to comment.