Skip to content

Commit a63ecbb

Browse files
committed
added raytune validity pytest
1 parent dd42f66 commit a63ecbb

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

deepcave/runs/converters/raytune.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def from_path(cls, path: Path) -> "RayTuneRun":
8686
configspace_new: dict
8787
hp_names = {}
8888
analysis = None
89-
analysis = ExperimentAnalysis(str(path)).results
89+
analysis = ExperimentAnalysis(path.resolve().as_uri()).results
9090

9191
# RayTune does not provide a configspace.json
9292
if not os.path.isfile(str(path) + "/configspace.json"):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name": null, "hyperparameters": [{"type": "uniform_float", "name": "alpha", "lower": 0.2, "upper": 0.4, "default_value": 0.30000000000000004}, {"type": "uniform_float", "name": "beta", "lower": 0.1, "upper": 0.6, "default_value": 0.35}, {"type": "uniform_float", "name": "gamma", "lower": 0.7, "upper": 0.9, "default_value": 0.8}], "conditions": [], "forbiddens": [], "python_module_version": "1.2.0", "format_version": 0.4, "comment": "The configspace.json file has been auto extracted. For more reliable results please provide your own configspace.json file or adjust the one provided. Numeric values will be treated as uniform values."}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name": null, "hyperparameters": [{"type": "uniform_float", "name": "alpha", "lower": 0.20580836121681995, "upper": 0.25986584841970367, "default_value": 0.2328371048182618}, {"type": "uniform_float", "name": "beta", "lower": 0.1624074561769746, "upper": 0.4802857225639665, "default_value": 0.32134658937047056}, {"type": "uniform_float", "name": "gamma", "lower": 0.7155994520336202, "upper": 0.7731993941811405, "default_value": 0.7443994231073803}], "conditions": [], "forbiddens": [], "python_module_version": "1.2.0", "format_version": 0.4, "comment": "The configspace.json file has been auto extracted. For more reliable results please provide your own configspace.json file or adjust the one provided. Numeric values will be treated as uniform values."}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import unittest
2+
from pathlib import Path
3+
4+
import pandas as pd
5+
6+
from deepcave.runs.converters.raytune import RayTuneRun
7+
8+
9+
class TestRaytuneConverter(unittest.TestCase):
10+
def setUp(self) -> None:
11+
self.run_path = Path("logs/RayTune/run_1")
12+
return pd.set_option("display.max_columns", None)
13+
14+
def testValidRun(self):
15+
RayTuneRun.is_valid_run(self.run_path)
16+
17+
def testReadRun(self):
18+
RayTuneRun.from_path(self.run_path)

0 commit comments

Comments
 (0)