Skip to content

Commit

Permalink
rename async opt file, remove old controller constructor from path
Browse files Browse the repository at this point in the history
  • Loading branch information
madeline-scyphers committed Sep 8, 2023
1 parent be98afc commit 74523b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions boa/async-opt.py → boa/_async_opt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# weird file name with dash in it because CLI conventions
import dataclasses
import os
import sys
Expand Down
15 changes: 0 additions & 15 deletions boa/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from boa.logger import get_logger
from boa.runner import WrappedJobRunner
from boa.scheduler import Scheduler
from boa.storage import scheduler_from_json_file
from boa.utils import yaml_dump
from boa.wrappers.base_wrapper import BaseWrapper
from boa.wrappers.wrapper_utils import get_dt_now_as_str, initialize_wrapper
Expand Down Expand Up @@ -89,20 +88,6 @@ def __init__(
self.experiment: Experiment = None
self.scheduler: Scheduler = None

@classmethod
def from_scheduler_path(cls, scheduler_path, working_dir=None, **kwargs):
scheduler = scheduler_from_json_file(scheduler_path, **kwargs)
wrapper = scheduler.experiment.runner.wrapper

inst = cls(wrapper=wrapper, working_dir=working_dir, **kwargs)
inst.logger.info(f"Resuming optimization from scheduler path: {scheduler_path}")
if inst.wrapper.config_path:
inst.logger.info(f"Config path: {inst.wrapper.config_path}")

inst.scheduler = scheduler
inst.experiment = scheduler.experiment
return inst

@classmethod
def from_scheduler(cls, scheduler, working_dir=None, **kwargs):
wrapper = scheduler.experiment.runner.wrapper
Expand Down
5 changes: 5 additions & 0 deletions tests/integration_tests/test_async-opt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from tests.conftest import TEST_CONFIG_DIR


def test_async_with_no_gen_strat():
config_path = TEST_CONFIG_DIR / "test_config_pass_through_metric.yaml"

4 comments on commit 74523b8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
__main__.py90495%134, 165, 210, 218
_async_opt.py90900%2–5, 7–11, 13–17, 20–21, 27, 34, 40, 61, 69–79, 81–84, 86–89, 92–93, 96–98, 100–101, 106–107, 109, 113–114, 117–118, 120–124, 139–140, 143–147, 149–156, 172–174, 180–181, 183–184, 186, 192–198, 201–202
ax_instantiation_utils.py47197%123
controller.py71297%73, 166
definitions.py80100% 
instantiation_base.py40197%39
metaclasses.py72395%50–51, 57
plot.py12120%15, 17–18, 20–21, 24, 27, 34, 40–41, 44–45
plotting.py1412880%51–52, 59, 94–95, 251–253, 301–305, 345, 429–432, 434–441, 443, 448
registry.py80100% 
runner.py45491%42, 76–78
scheduler.py781482%38, 125–128, 135–136, 150, 157–158, 165–166, 261–262
storage.py1241786%80, 83, 115–117, 177, 195, 273–281, 300
template.py200100% 
utils.py902077%175, 189–190, 215, 225–229, 231–233, 235, 237, 241–246
config
   __main__.py00100% 
   config.py3073887%33, 211, 217, 221, 223–224, 226, 282, 292, 409, 412, 420–421, 429, 603, 605, 607, 613–617, 619, 690, 723, 744, 751–752, 760, 773, 783–784, 796, 821, 824, 906–907, 909
   converters.py751382%14, 22, 25, 41, 46–48, 51–52, 65, 67, 71, 79
metrics
   metric_funcs.py34488%58, 80–81, 83
   metrics.py1011585%127, 304–305, 310–311, 314, 320, 331–333, 337–341
   modular_metric.py1202083%38–41, 43–50, 64, 131, 142, 184, 235–236, 255–256
   synthetic_funcs.py39489%31, 35, 58, 65
scripts
   moo.py30196%44
   run_branin.py34197%56
   script_wrappers.py31293%57–58
   synth_func_cli.py210100% 
wrappers
   base_wrapper.py1952686%63–64, 89–92, 94, 102, 110, 115, 147, 156, 215–216, 218, 269, 330, 402, 416, 589, 591–594, 602, 612
   script_wrapper.py83890%191, 202–203, 270, 313, 319, 324, 329
   synthetic_wrapper.py16160%1, 3, 5, 7, 10–13, 15–16, 18–19, 21, 27–28, 30
   wrapper_utils.py132993%147–148, 228, 277, 385–387, 395–396
TOTAL215435383% 

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
__main__.py90495%134, 165, 210, 218
_async_opt.py90900%2–5, 7–11, 13–17, 20–21, 27, 34, 40, 61, 69–79, 81–84, 86–89, 92–93, 96–98, 100–101, 106–107, 109, 113–114, 117–118, 120–124, 139–140, 143–147, 149–156, 172–174, 180–181, 183–184, 186, 192–198, 201–202
ax_instantiation_utils.py47197%123
controller.py71297%73, 166
definitions.py80100% 
instantiation_base.py40197%39
metaclasses.py72395%50–51, 57
plot.py12120%15, 17–18, 20–21, 24, 27, 34, 40–41, 44–45
plotting.py1412880%51–52, 59, 94–95, 251–253, 301–305, 345, 429–432, 434–441, 443, 448
registry.py80100% 
runner.py45491%42, 76–78
scheduler.py781482%38, 125–128, 135–136, 150, 157–158, 165–166, 261–262
storage.py1241786%80, 83, 115–117, 177, 195, 273–281, 300
template.py200100% 
utils.py902077%175, 189–190, 215, 225–229, 231–233, 235, 237, 241–246
config
   __main__.py00100% 
   config.py3073887%33, 211, 217, 221, 223–224, 226, 282, 292, 409, 412, 420–421, 429, 603, 605, 607, 613–617, 619, 690, 723, 744, 751–752, 760, 773, 783–784, 796, 821, 824, 906–907, 909
   converters.py751382%14, 22, 25, 41, 46–48, 51–52, 65, 67, 71, 79
metrics
   metric_funcs.py34488%58, 80–81, 83
   metrics.py1011585%127, 304–305, 310–311, 314, 320, 331–333, 337–341
   modular_metric.py1202083%38–41, 43–50, 64, 131, 142, 184, 235–236, 255–256
   synthetic_funcs.py39489%31, 35, 58, 65
scripts
   moo.py30196%44
   run_branin.py34197%56
   script_wrappers.py31293%57–58
   synth_func_cli.py210100% 
wrappers
   base_wrapper.py1952686%63–64, 89–92, 94, 102, 110, 115, 147, 156, 215–216, 218, 269, 330, 402, 416, 589, 591–594, 602, 612
   script_wrapper.py83890%191, 202–203, 270, 313, 319, 324, 329
   synthetic_wrapper.py16160%1, 3, 5, 7, 10–13, 15–16, 18–19, 21, 27–28, 30
   wrapper_utils.py132993%147–148, 228, 277, 385–387, 395–396
TOTAL215435383% 

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
__main__.py90495%134, 165, 210, 218
_async_opt.py90900%2–5, 7–11, 13–17, 20–21, 27, 34, 40, 61, 69–79, 81–84, 86–89, 92–93, 96–98, 100–101, 106–107, 109, 113–114, 117–118, 120–124, 139–140, 143–147, 149–156, 172–174, 180–181, 183–184, 186, 192–198, 201–202
ax_instantiation_utils.py47197%123
controller.py71297%73, 166
definitions.py80100% 
instantiation_base.py40197%39
metaclasses.py72395%50–51, 57
plot.py12120%15, 17–18, 20–21, 24, 27, 34, 40–41, 44–45
plotting.py1412880%51–52, 59, 94–95, 251–253, 301–305, 345, 429–432, 434–441, 443, 448
registry.py80100% 
runner.py45491%42, 76–78
scheduler.py781482%38, 125–128, 135–136, 150, 157–158, 165–166, 261–262
storage.py1241786%80, 83, 115–117, 177, 195, 273–281, 300
template.py200100% 
utils.py902077%175, 189–190, 215, 225–229, 231–233, 235, 237, 241–246
config
   __main__.py00100% 
   config.py3073887%33, 211, 217, 221, 223–224, 226, 282, 292, 409, 412, 420–421, 429, 603, 605, 607, 613–617, 619, 690, 723, 744, 751–752, 760, 773, 783–784, 796, 821, 824, 906–907, 909
   converters.py751382%14, 22, 25, 41, 46–48, 51–52, 65, 67, 71, 79
metrics
   metric_funcs.py34488%58, 80–81, 83
   metrics.py1011585%127, 304–305, 310–311, 314, 320, 331–333, 337–341
   modular_metric.py1202083%38–41, 43–50, 64, 131, 142, 184, 235–236, 255–256
   synthetic_funcs.py39489%31, 35, 58, 65
scripts
   moo.py30196%44
   run_branin.py34197%56
   script_wrappers.py31293%57–58
   synth_func_cli.py210100% 
wrappers
   base_wrapper.py1952686%63–64, 89–92, 94, 102, 110, 115, 147, 156, 215–216, 218, 269, 330, 402, 416, 589, 591–594, 602, 612
   script_wrapper.py83890%191, 202–203, 270, 313, 319, 324, 329
   synthetic_wrapper.py16160%1, 3, 5, 7, 10–13, 15–16, 18–19, 21, 27–28, 30
   wrapper_utils.py132993%147–148, 228, 277, 385–387, 395–396
TOTAL215435383% 

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
__main__.py90495%134, 165, 210, 218
_async_opt.py90900%2–5, 7–11, 13–17, 20–21, 27, 34, 40, 61, 69–79, 81–84, 86–89, 92–93, 96–98, 100–101, 106–107, 109, 113–114, 117–118, 120–124, 139–140, 143–147, 149–156, 172–174, 180–181, 183–184, 186, 192–198, 201–202
ax_instantiation_utils.py47197%123
controller.py71297%73, 166
definitions.py80100% 
instantiation_base.py40197%39
metaclasses.py72395%50–51, 57
plot.py12120%15, 17–18, 20–21, 24, 27, 34, 40–41, 44–45
plotting.py1412880%51–52, 59, 94–95, 251–253, 301–305, 345, 429–432, 434–441, 443, 448
registry.py80100% 
runner.py45491%42, 76–78
scheduler.py781482%38, 125–128, 135–136, 150, 157–158, 165–166, 261–262
storage.py1241786%80, 83, 115–117, 177, 195, 273–281, 300
template.py200100% 
utils.py902077%175, 189–190, 215, 225–229, 231–233, 235, 237, 241–246
config
   __main__.py00100% 
   config.py3073887%33, 211, 217, 221, 223–224, 226, 282, 292, 409, 412, 420–421, 429, 603, 605, 607, 613–617, 619, 690, 723, 744, 751–752, 760, 773, 783–784, 796, 821, 824, 906–907, 909
   converters.py751382%14, 22, 25, 41, 46–48, 51–52, 65, 67, 71, 79
metrics
   metric_funcs.py34488%58, 80–81, 83
   metrics.py1011585%127, 304–305, 310–311, 314, 320, 331–333, 337–341
   modular_metric.py1202083%38–41, 43–50, 64, 131, 142, 184, 235–236, 255–256
   synthetic_funcs.py39489%31, 35, 58, 65
scripts
   moo.py30196%44
   run_branin.py34197%56
   script_wrappers.py31293%57–58
   synth_func_cli.py210100% 
wrappers
   base_wrapper.py1952686%63–64, 89–92, 94, 102, 110, 115, 147, 156, 215–216, 218, 269, 330, 402, 416, 589, 591–594, 602, 612
   script_wrapper.py83890%191, 202–203, 270, 313, 319, 324, 329
   synthetic_wrapper.py16160%1, 3, 5, 7, 10–13, 15–16, 18–19, 21, 27–28, 30
   wrapper_utils.py132993%147–148, 228, 277, 385–387, 395–396
TOTAL215435383% 

Please sign in to comment.