Skip to content

Commit

Permalink
apply formats.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nzw0301 committed Aug 15, 2024
1 parent c2817f9 commit 2fe9a95
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions optuna_integration/_imports.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import importlib
import types
from types import TracebackType
Expand Down
1 change: 1 addition & 0 deletions optuna_integration/_lightgbm_tuner/sklearn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from typing import Any
import warnings

Expand Down
1 change: 1 addition & 0 deletions optuna_integration/allennlp/_dump_best_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import json

import optuna
Expand Down
1 change: 1 addition & 0 deletions optuna_integration/allennlp/_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import json
import os
from typing import Any
Expand Down
10 changes: 5 additions & 5 deletions optuna_integration/botorch/botorch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from typing import Any
from collections.abc import Callable
from collections.abc import Sequence
from typing import Any
import warnings

import numpy
Expand Down Expand Up @@ -974,15 +974,15 @@ def infer_relative_search_space(
self,
study: Study,
trial: FrozenTrial,
) -> Dict[str, BaseDistribution]:
) -> dict[str, BaseDistribution]:
if self._study_id is None:
self._study_id = study._study_id
if self._study_id != study._study_id:
# Note that the check below is meaningless when `InMemoryStorage` is used
# because `InMemoryStorage.create_new_study` always returns the same study ID.
raise RuntimeError("BoTorchSampler cannot handle multiple studies.")

search_space: Dict[str, BaseDistribution] = {}
search_space: dict[str, BaseDistribution] = {}
for name, distribution in self._search_space.calculate(study).items():
if distribution.single():
# built-in `candidates_func` cannot handle distributions that contain just a
Expand All @@ -997,8 +997,8 @@ def sample_relative(
self,
study: Study,
trial: FrozenTrial,
search_space: Dict[str, BaseDistribution],
) -> Dict[str, Any]:
search_space: dict[str, BaseDistribution],
) -> dict[str, Any]:
assert isinstance(search_space, dict)

if len(search_space) == 0:
Expand Down
6 changes: 3 additions & 3 deletions optuna_integration/cma/cma.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

from __future__ import annotations

from collections.abc import Container
from collections.abc import Sequence
import math
import random
from typing import Any
from collections.abc import Container
from collections.abc import Sequence

import numpy
import optuna
Expand Down
1 change: 1 addition & 0 deletions optuna_integration/fastaiv2/fastaiv2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

import optuna
from packaging import version

Expand Down
1 change: 1 addition & 0 deletions optuna_integration/tfkeras/tfkeras.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from typing import Any
import warnings

Expand Down

0 comments on commit 2fe9a95

Please sign in to comment.