hydraflow 0.7.2__tar.gz → 0.7.3__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {hydraflow-0.7.2 → hydraflow-0.7.3}/PKG-INFO +1 -1
- {hydraflow-0.7.2 → hydraflow-0.7.3}/pyproject.toml +1 -1
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/main.py +3 -4
- hydraflow-0.7.3/tests/main/base.py +27 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/force_new_run.py +1 -1
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/restart.py +1 -1
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/skip.py +1 -1
- hydraflow-0.7.3/tests/main/test_base.py +58 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/.devcontainer/devcontainer.json +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/.devcontainer/postCreate.sh +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/.devcontainer/starship.toml +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/.gitattributes +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/.gitignore +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/LICENSE +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/README.md +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/apps/quickstart.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/mkdocs.yml +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/config.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/context.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/mlflow.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/param.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/py.typed +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/run_collection.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/run_data.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/run_info.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/src/hydraflow/utils.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/config/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/config/overrides.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/config/test_config.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/config/test_overrides.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/config/test_params.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/conftest.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/chdir.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/context.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/logging.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/rerun.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/test_chdir.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/test_context.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/test_logging.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/context/test_rerun.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/test_force_new_run.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/test_restart.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/main/test_skip.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/param/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/param/params.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/param/test_param.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/param/test_params.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/filter.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/run.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/test_collection.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/test_data.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/test_filter.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/test_info.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/run/test_run.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/test_mlflow.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/utils/__init__.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/utils/test_run.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/utils/test_utils.py +0 -0
- {hydraflow-0.7.2 → hydraflow-0.7.3}/tests/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hydraflow
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.3
|
4
4
|
Summary: Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments.
|
5
5
|
Project-URL: Documentation, https://daizutabi.github.io/hydraflow/
|
6
6
|
Project-URL: Source, https://github.com/daizutabi/hydraflow
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "hydraflow"
|
7
|
-
version = "0.7.
|
7
|
+
version = "0.7.3"
|
8
8
|
description = "Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments."
|
9
9
|
readme = "README.md"
|
10
10
|
license = { file = "LICENSE" }
|
@@ -23,10 +23,9 @@ def main(
|
|
23
23
|
node: Any,
|
24
24
|
config_name: str = "config",
|
25
25
|
*,
|
26
|
-
chdir: bool =
|
27
|
-
skip_finished: bool = True,
|
26
|
+
chdir: bool = False,
|
28
27
|
force_new_run: bool = False,
|
29
|
-
|
28
|
+
skip_finished: bool = True,
|
30
29
|
):
|
31
30
|
"""Main decorator."""
|
32
31
|
|
@@ -42,7 +41,7 @@ def main(
|
|
42
41
|
run = None
|
43
42
|
else:
|
44
43
|
rc = hydraflow.search_runs()
|
45
|
-
run = rc.try_get(cfg, override=
|
44
|
+
run = rc.try_get(cfg, override=True)
|
46
45
|
|
47
46
|
if skip_finished and run and run.info.status == FINISHED:
|
48
47
|
return
|
@@ -0,0 +1,27 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from dataclasses import dataclass
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import TYPE_CHECKING
|
6
|
+
|
7
|
+
import hydraflow
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from mlflow.entities import Run
|
11
|
+
|
12
|
+
|
13
|
+
@dataclass
|
14
|
+
class Config:
|
15
|
+
count: int = 0
|
16
|
+
|
17
|
+
|
18
|
+
@hydraflow.main(Config)
|
19
|
+
def app(run: Run, cfg: Config):
|
20
|
+
path = hydraflow.get_artifact_dir() / "a.txt"
|
21
|
+
path.write_text(f"{run.info.run_id},{cfg.count}")
|
22
|
+
path = hydraflow.get_artifact_dir() / "b.txt"
|
23
|
+
path.write_text(f"{Path.cwd().absolute().as_posix()}")
|
24
|
+
|
25
|
+
|
26
|
+
if __name__ == "__main__":
|
27
|
+
app()
|
@@ -0,0 +1,58 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
from mlflow.entities import Run
|
5
|
+
|
6
|
+
from hydraflow.run_collection import RunCollection
|
7
|
+
|
8
|
+
pytestmark = pytest.mark.xdist_group(name="group5")
|
9
|
+
|
10
|
+
|
11
|
+
@pytest.fixture(scope="module")
|
12
|
+
def rc(collect):
|
13
|
+
filename = "main/base.py"
|
14
|
+
args = ["-m", "count=1,2,3"]
|
15
|
+
|
16
|
+
return collect(filename, args)
|
17
|
+
|
18
|
+
|
19
|
+
def test_rc_len(rc: RunCollection):
|
20
|
+
assert len(rc) == 3
|
21
|
+
|
22
|
+
|
23
|
+
@pytest.fixture(scope="module", params=[1, 2, 3])
|
24
|
+
def run(rc: RunCollection, request: pytest.FixtureRequest):
|
25
|
+
return rc.get(count=request.param)
|
26
|
+
|
27
|
+
|
28
|
+
@pytest.fixture(scope="module")
|
29
|
+
def count(run: Run):
|
30
|
+
return int(run.data.params["count"])
|
31
|
+
|
32
|
+
|
33
|
+
@pytest.fixture(scope="module")
|
34
|
+
def text(run: Run):
|
35
|
+
from hydraflow.utils import get_artifact_path
|
36
|
+
|
37
|
+
path = get_artifact_path(run, "a.txt")
|
38
|
+
return path.read_text()
|
39
|
+
|
40
|
+
|
41
|
+
def test_run_id(run: Run, text: str):
|
42
|
+
assert text.split(",")[0] == run.info.run_id
|
43
|
+
|
44
|
+
|
45
|
+
def test_count(text: str, count: int):
|
46
|
+
assert text.split(",")[1] == str(count)
|
47
|
+
|
48
|
+
|
49
|
+
@pytest.fixture(scope="module")
|
50
|
+
def cwd(run: Run):
|
51
|
+
from hydraflow.utils import get_artifact_path
|
52
|
+
|
53
|
+
path = get_artifact_path(run, "b.txt")
|
54
|
+
return Path(path.read_text())
|
55
|
+
|
56
|
+
|
57
|
+
def test_cwd(cwd: Path, experiment_name: str):
|
58
|
+
assert cwd.name == experiment_name
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|