Skip to content

Commit 3d944f9

Browse files
committed
use result class in converter tests
1 parent 686af9e commit 3d944f9

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tests/test_converter.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pandas as pd
44

55
from gradient_free_optimizers.optimizers.core_optimizer import Converter
6+
from gradient_free_optimizers._result import Result
67

78

89
def equal_arraysInList(list1, list2):
@@ -471,9 +472,9 @@ def test_positions2values_1(test_input, expected):
471472

472473

473474
memory_dict_0 = {
474-
(0, 10): 0.1,
475-
(20, 10): 0.2,
476-
(10, 0): 0.3,
475+
(0, 10): Result(0.1, {}),
476+
(20, 10): Result(0.2, {}),
477+
(10, 0): Result(0.3, {}),
477478
}
478479

479480
positions_scores2memory_dict_test_para_0 = [
@@ -512,9 +513,9 @@ def test_positions_scores2memory_dict_0(test_input, expected):
512513

513514

514515
memory_dict_0 = {
515-
(0, 10): 0.1,
516-
(20, 10): 0.2,
517-
(10, 0): 0.3,
516+
(0, 10): Result(0.1, {}),
517+
(20, 10): Result(0.2, {}),
518+
(10, 0): Result(0.3, {}),
518519
}
519520

520521
memory_dict2positions_scores_test_para_0 = [
@@ -556,9 +557,9 @@ def test_memory_dict2positions_scores_0(test_input, expected):
556557
)
557558

558559
memory_dict_0 = {
559-
(0, 10): 0.1,
560-
(20, 10): 0.2,
561-
(10, 0): 0.3,
560+
(0, 10): Result(0.1, {}),
561+
(20, 10): Result(0.2, {}),
562+
(10, 0): Result(0.3, {}),
562563
}
563564

564565
dataframe2memory_dict_test_para_0 = [
@@ -593,9 +594,9 @@ def test_dataframe2memory_dict_0(test_input, expected):
593594

594595

595596
memory_dict_0 = {
596-
(0, 10): 0.1,
597-
(20, 10): 0.2,
598-
(10, 0): 0.3,
597+
(0, 10): Result(0.1, {}),
598+
(20, 10): Result(0.2, {}),
599+
(10, 0): Result(0.3, {}),
599600
}
600601

601602
memory_dict2dataframe_test_para_0 = [

0 commit comments

Comments
 (0)