Skip to content

Commit 34fcd17

Browse files
committedJan 1, 2019
Add test for acqfuncs
1 parent 6c72383 commit 34fcd17

File tree

3 files changed

+51
-19
lines changed

3 files changed

+51
-19
lines changed
 

‎.coveragerc

+19-18
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ exclude_lines =
44
if __name__ == .__main__.:
55
ignore_errors=True
66
omit =
7-
*dev_scripts*
8-
*examples*
9-
*.cicleci*
10-
*site-packages*
11-
*tests*
12-
*versioneer.py
13-
*_version.py
14-
*.md
15-
*.gitignore
16-
*.txt
17-
*setup.py
18-
*__init__*
19-
*.egg-info*
20-
*docs*
21-
*docs_rst*
22-
tasks.py
23-
setup.py
24-
*.git*
7+
*/dev_scripts/*
8+
*/docs/*
9+
*/docs_rst/*
10+
*/examples/*
11+
*/.cicleci/*
12+
*/python?.?/*
13+
*/site-packages/*
14+
*tests/*
15+
*/versioneer.py
16+
*/_version.py
17+
*/*.md
18+
*/*.yaml
19+
*/*.cfg
20+
*/*.gitignore
21+
*/*.txt
22+
*/setup.py
23+
*/__init__.py
24+
*/rocketsled.egg-info/*
25+
*/.eggs/*

‎rocketsled/tests/test_task.py

+27
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,33 @@ def test_missioncontrol(self):
313313
plt.savefig(savepath)
314314
self.assertTrue(os.path.exists(savepath))
315315

316+
def test_acqfuncs(self):
317+
self.mc.configure(wf_creator=wf_creator_basic,
318+
dimensions=self.dims_basic,
319+
predictor="GaussianProcessRegressor",
320+
acq=None)
321+
launchpad.add_wf(wf_creator_basic([5, 11, 'blue']))
322+
rapidfire(launchpad, nlaunches=20, sleep_time=0)
323+
self.mc.reset(hard=False)
324+
self.mc.configure(wf_creator=wf_creator_basic,
325+
dimensions=self.dims_basic,
326+
predictor="GaussianProcessRegressor",
327+
acq="ei")
328+
rapidfire(launchpad, nlaunches=2, sleep_time=0)
329+
self.mc.reset(hard=False)
330+
self.mc.configure(wf_creator=wf_creator_basic,
331+
dimensions=self.dims_basic,
332+
predictor="GaussianProcessRegressor",
333+
acq="pi")
334+
rapidfire(launchpad, nlaunches=2, sleep_time=0)
335+
self.mc.reset(hard=False)
336+
self.mc.configure(wf_creator=wf_creator_basic,
337+
dimensions=self.dims_basic,
338+
predictor="GaussianProcessRegressor",
339+
acq="lcb")
340+
rapidfire(launchpad, nlaunches=2, sleep_time=0)
341+
342+
316343

317344
def test_parallel(self):
318345
n_procs = 10

‎rocketsled/utils.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ def split_xz(xz, x_dims, x_only=False, z_only=False):
219219
def get_default_opttask_kwargs():
220220
"""
221221
Get the default configuration kwargs for OptTask.
222+
223+
Args:
224+
None
225+
222226
Returns:
223227
conf_dict (dict): The default kwargs for OptTask
224228
@@ -248,7 +252,7 @@ def check_dims(dims):
248252
dims (list): The dimensions of the search space.
249253
250254
Returns:
251-
[str]: Types of the dimensions in the search space defined by dims.
255+
([str]): Types of the dimensions in the search space defined by dims.
252256
"""
253257
dims_types = [list, tuple]
254258
dim_spec = []

0 commit comments

Comments
 (0)
Please sign in to comment.