|
16 | 16 | async def test_log_artifact(): |
17 | 17 | alpha.init(project_id=uuid.uuid4(), artifact_insecure=True, init_tables=True) |
18 | 18 |
|
19 | | - async with alpha.CraftExperiment.start( |
| 19 | + async with alpha.CraftExperiment.setup( |
20 | 20 | name="log_artifact_exp", |
21 | 21 | description="Context manager test", |
22 | 22 | meta={"key": "value"}, |
@@ -68,7 +68,7 @@ async def test_log_artifact(): |
68 | 68 | async def test_log_params(): |
69 | 69 | alpha.init(project_id=uuid.uuid4(), artifact_insecure=True, init_tables=True) |
70 | 70 |
|
71 | | - async with alpha.CraftExperiment.start(name="log_params_exp") as exp: |
| 71 | + async with alpha.CraftExperiment.setup(name="log_params_exp") as exp: |
72 | 72 | trial = exp.start_trial(name="first-trial", params={"param1": 0.1}) |
73 | 73 |
|
74 | 74 | new_trial = exp._runtime._metadb.get_trial(trial_id=trial.id) |
@@ -98,7 +98,7 @@ async def test_log_metrics(): |
98 | 98 | async def log_metric(metrics: dict): |
99 | 99 | await alpha.log_metrics(metrics) |
100 | 100 |
|
101 | | - async with alpha.CraftExperiment.start(name="log_metrics_exp") as exp: |
| 101 | + async with alpha.CraftExperiment.setup(name="log_metrics_exp") as exp: |
102 | 102 | trial = exp.start_trial(name="first-trial", params={"param1": 0.1}) |
103 | 103 |
|
104 | 104 | new_trial = exp._runtime._metadb.get_trial(trial_id=trial._id) |
@@ -145,7 +145,7 @@ async def test_log_metrics_with_save_on_max(): |
145 | 145 | async def log_metric(value: float): |
146 | 146 | await alpha.log_metrics({"accuracy": value}) |
147 | 147 |
|
148 | | - async with alpha.CraftExperiment.start( |
| 148 | + async with alpha.CraftExperiment.setup( |
149 | 149 | name="log_metrics_with_save_on_max", |
150 | 150 | description="Context manager test", |
151 | 151 | meta={"key": "value"}, |
@@ -211,7 +211,7 @@ async def test_log_metrics_with_save_on_min(): |
211 | 211 | async def log_metric(value: float): |
212 | 212 | await alpha.log_metrics({"accuracy": value}) |
213 | 213 |
|
214 | | - async with alpha.CraftExperiment.start( |
| 214 | + async with alpha.CraftExperiment.setup( |
215 | 215 | name="log_metrics_with_save_on_min", |
216 | 216 | description="Context manager test", |
217 | 217 | meta={"key": "value"}, |
@@ -280,7 +280,7 @@ async def fake_sleep(value: float): |
280 | 280 | await asyncio.sleep(100) |
281 | 281 | await alpha.log_metrics({"accuracy": value}) |
282 | 282 |
|
283 | | - async with alpha.CraftExperiment.start( |
| 283 | + async with alpha.CraftExperiment.setup( |
284 | 284 | name="log_metrics_with_early_stopping" |
285 | 285 | ) as exp: |
286 | 286 | async with exp.start_trial( |
@@ -317,7 +317,7 @@ async def fake_sleep(value: float): |
317 | 317 | await asyncio.sleep(value) |
318 | 318 | await alpha.log_metrics({"accuracy": value}) |
319 | 319 |
|
320 | | - async with alpha.CraftExperiment.start( |
| 320 | + async with alpha.CraftExperiment.setup( |
321 | 321 | name="log_metrics_with_both_early_stopping_and_timeout" |
322 | 322 | ) as exp: |
323 | 323 | async with exp.start_trial( |
@@ -346,7 +346,7 @@ async def test_log_metrics_with_max_run_number(): |
346 | 346 | async def fake_work(value: float): |
347 | 347 | await alpha.log_metrics({"accuracy": value}) |
348 | 348 |
|
349 | | - async with alpha.CraftExperiment.start( |
| 349 | + async with alpha.CraftExperiment.setup( |
350 | 350 | name="log_metrics_with_max_run_number" |
351 | 351 | ) as exp: |
352 | 352 | async with exp.start_trial( |
|
0 commit comments