-
Notifications
You must be signed in to change notification settings - Fork 552
Conversation
Create a new Space instance from an existing one.
@MechCoder do you have an idea where I should go and check for this failure: (Pdb) p space_result.x_iters
[[1.2553300705386103, 10.804867401632373], [-4.9982843777398269, 4.5349885894775968], [-2.798661637743304, 1.3850789215319672], [-2.2060968293349363, 5.1834109056457169], [1.266321887020273, 10.806829307463431], [-2.2779669130728766, 5.1862295242560386], [-2.0526999728871478, 5.1772280358548404]]
(Pdb) p result.x_iters
[[1.2553300705386103, 10.804867401632373], [-4.9982843777398269, 4.5349885894775968], [-2.798661637743304, 1.3850789215319672], [-2.2060968293349363, 5.1834109056457169], [1.2631908785389683, 10.79850547188739], [-1.9719421658503988, 5.3208778886226966], [-1.8862238180288384, 7.3176360832275558]] The test in |
Could you please add a common test for reproducibility? |
Will add a test. Thanks for finding this. |
Codecov Report
@@ Coverage Diff @@
## master #373 +/- ##
=========================================
+ Coverage 85.18% 85.2% +0.02%
=========================================
Files 22 22
Lines 1377 1379 +2
=========================================
+ Hits 1173 1175 +2
Misses 204 204
Continue to review full report at Codecov.
|
skopt/tests/test_common.py
Outdated
result2 = minimizer(branin, dimensions, n_calls=n_calls, | ||
n_random_starts=n_random_starts, random_state=1) | ||
|
||
assert np.allclose(result1.x_iters, result2.x_iters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use assert_array_almost_equal
over here.
skopt/tests/test_space.py
Outdated
|
||
space2 = Space(space) | ||
|
||
assert space == space2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a good idea to use assert_equal
over here.
LGTM |
Switched both of the assert statements. Do you know what the advantage/disadvantages are? Seems like in pytest everything (or most things) are written with simple assert statements (based on looking around what others do). |
I do it just for prettier error messages. |
Fixes #371
Create a new Space instance from an existing one. The goal of this PR is to allow people to pass a
Space
instance everywhere we accept a list of dimensions as argument.