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 Feb 27, 2024
1 parent cb92d1a commit d4e550a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions optimas/generators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
TrialParameter,
TrialStatus,
)

if TYPE_CHECKING:
from optimas.loggers.base import Logger

Expand Down
7 changes: 3 additions & 4 deletions tests/test_wandb_logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
# os.environ['WANDB_START_METHOD'] = 'thread'
# os.environ['WANDB_DISABLE_SERVICE'] = "1"
# API_KEY = "4b810c5f384e91c204b67371249db1a6b1e1aca4"
Expand All @@ -22,7 +21,7 @@ def eval_func(input_params, output_params):
result = -(x0 + 10 * np.cos(x0)) * (x1 + 5 * np.cos(x1))
output_params["f"] = result
output_params["p0"] = np.array([[1, 2, 3, 4], [2, 6, 7, 4]])

plt.figure()
plt.plot(output_params["p0"][0], output_params["p0"][1])
output_params["fig"] = deepcopy(plt.gcf())
Expand All @@ -31,7 +30,7 @@ def eval_func(input_params, output_params):
output_params["p1"] = deepcopy(plt.gcf())


def user_function(last_trial, generator: RandomSamplingGenerator):
def user_function(last_trial, generator: RandomSamplingGenerator):
all_trials = generator.completed_trials
n_trials = len(all_trials)
shape_1 = np.array(all_trials[0].data["p0"]).shape[1]
Expand Down Expand Up @@ -87,7 +86,7 @@ def test_wandb_logger():
{
"x0": [1.0],
"x1": [2.0],
"f": [0.],
"f": [0.0],
"p0": [np.array([[1, 2, 3, 4], [2, 6, 7, 4]])],
"p1": [plt.figure()],
"fig": [plt.figure()],
Expand Down

0 comments on commit d4e550a

Please sign in to comment.