hydraflow 0.11.1__tar.gz → 0.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hydraflow-0.11.1 → hydraflow-0.12.0}/PKG-INFO +1 -1
- {hydraflow-0.11.1 → hydraflow-0.12.0}/pyproject.toml +4 -1
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/executor/conf.py +2 -2
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/executor/io.py +21 -2
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/executor/job.py +2 -2
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/executor/parser.py +1 -1
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/hydraflow.yaml +2 -2
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/test_conf.py +4 -3
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/test_io.py +13 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.cursorrules +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.devcontainer/devcontainer.json +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.devcontainer/postCreate.sh +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.devcontainer/starship.toml +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.gitattributes +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.github/workflows/ci.yaml +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.github/workflows/docs.yaml +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/.gitignore +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/LICENSE +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/README.md +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/apps/quickstart.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/docs/index.md +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/docs/usage/quickstart.md +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/mkdocs.yaml +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/cli.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/config.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/context.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/io.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/main.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/mlflow.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/core/param.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/entities/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/entities/run_collection.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/entities/run_data.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/entities/run_info.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/executor/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/src/hydraflow/py.typed +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/app.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/conftest.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/test_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/test_setup.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/test_show.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/cli/test_version.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/conftest.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/config/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/config/test_config.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/config/test_params.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/chdir.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/log_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/start_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/test_chdir.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/test_log_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/context/test_start_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/io/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/io/hydra_dir.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/io/test_hydra_dir.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/io/test_iter_dirs.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/io/test_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/default.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/force_new_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/match_overrides.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/rerun_finished.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/skip_finished.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/test_default.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/test_force_new_run.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/test_match_overrides.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/test_rerun_finished.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/main/test_skip_finished.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/param/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/param/params.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/param/test_param.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/param/test_params.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/core/test_mlflow.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/filter.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/test_collection.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/test_data.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/test_filter.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/test_info.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/test_values.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/entities/values.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/__init__.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/conftest.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/echo.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/test_args.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/test_job.py +0 -0
- {hydraflow-0.11.1 → hydraflow-0.12.0}/tests/executor/test_parser.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hydraflow
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.12.0
|
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
|
+
version = "0.12.0"
|
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" }
|
@@ -101,3 +101,6 @@ ignore = [
|
|
101
101
|
"src/hydraflow/core/main.py" = ["ANN201", "D401"]
|
102
102
|
"src/hydraflow/executor/conf.py" = ["ANN", "D"]
|
103
103
|
"tests/*" = ["A001", "ANN", "ARG", "D", "FBT", "PD", "PLR", "PT", "S", "SLF"]
|
104
|
+
|
105
|
+
[tool.pyright]
|
106
|
+
include = ["src", "tests"]
|
@@ -7,7 +7,7 @@ from dataclasses import dataclass, field
|
|
7
7
|
class Step:
|
8
8
|
batch: str = ""
|
9
9
|
args: str = ""
|
10
|
-
|
10
|
+
with_: str = ""
|
11
11
|
|
12
12
|
|
13
13
|
@dataclass
|
@@ -15,7 +15,7 @@ class Job:
|
|
15
15
|
name: str = ""
|
16
16
|
run: str = ""
|
17
17
|
call: str = ""
|
18
|
-
|
18
|
+
with_: str = ""
|
19
19
|
steps: list[Step] = field(default_factory=list)
|
20
20
|
|
21
21
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
5
5
|
from pathlib import Path
|
6
6
|
from typing import TYPE_CHECKING
|
7
7
|
|
8
|
-
from omegaconf import OmegaConf
|
8
|
+
from omegaconf import DictConfig, ListConfig, OmegaConf
|
9
9
|
|
10
10
|
from .conf import HydraflowConf
|
11
11
|
|
@@ -35,7 +35,26 @@ def load_config() -> HydraflowConf:
|
|
35
35
|
|
36
36
|
cfg = OmegaConf.load(path)
|
37
37
|
|
38
|
-
|
38
|
+
if not isinstance(cfg, DictConfig):
|
39
|
+
return schema
|
40
|
+
|
41
|
+
rename_with(cfg)
|
42
|
+
|
43
|
+
return OmegaConf.merge(schema, cfg) # type: ignore[return-value]
|
44
|
+
|
45
|
+
|
46
|
+
def rename_with(cfg: DictConfig) -> None:
|
47
|
+
"""Rename the `with` field to `with_`."""
|
48
|
+
if "with" in cfg:
|
49
|
+
cfg["with_"] = cfg.pop("with")
|
50
|
+
|
51
|
+
for key in list(cfg.keys()):
|
52
|
+
if isinstance(cfg[key], DictConfig):
|
53
|
+
rename_with(cfg[key])
|
54
|
+
elif isinstance(cfg[key], ListConfig):
|
55
|
+
for item in cfg[key]:
|
56
|
+
if isinstance(item, DictConfig):
|
57
|
+
rename_with(item)
|
39
58
|
|
40
59
|
|
41
60
|
def get_job(name: str) -> Job:
|
@@ -69,10 +69,10 @@ def iter_batches(job: Job) -> Iterator[list[str]]:
|
|
69
69
|
|
70
70
|
"""
|
71
71
|
job_name = f"hydra.job.name={job.name}"
|
72
|
-
job_configs = shlex.split(job.
|
72
|
+
job_configs = shlex.split(job.with_)
|
73
73
|
|
74
74
|
for step in job.steps:
|
75
|
-
configs = shlex.split(step.
|
75
|
+
configs = shlex.split(step.with_) or job_configs
|
76
76
|
|
77
77
|
for args in iter_args(step.batch, step.args):
|
78
78
|
sweep_dir = f"hydra.sweep.dir=multirun/{ulid.ULID()}"
|
@@ -13,10 +13,10 @@ jobs:
|
|
13
13
|
args: count=100
|
14
14
|
parallel:
|
15
15
|
run: python app.py
|
16
|
-
|
16
|
+
with: hydra/launcher=joblib hydra.launcher.n_jobs=2
|
17
17
|
steps:
|
18
18
|
- batch: name=a
|
19
19
|
args: count=1:4
|
20
20
|
- batch: name=b
|
21
21
|
args: count=11:14
|
22
|
-
|
22
|
+
with: hydra/launcher=joblib hydra.launcher.n_jobs=4
|
@@ -25,10 +25,11 @@ def test_none():
|
|
25
25
|
|
26
26
|
|
27
27
|
def test_job(config):
|
28
|
-
cfg = config("jobs:\n a:\n run: a.test\n")
|
28
|
+
cfg = config("jobs:\n a:\n run: a.test\n with: --opt1 --opt2\n")
|
29
29
|
assert cfg.jobs["a"].run == "a.test"
|
30
|
+
assert cfg.jobs["a"].with_ == "--opt1 --opt2"
|
30
31
|
|
31
32
|
|
32
33
|
def test_step(config):
|
33
|
-
cfg = config("jobs:\n a:\n steps:\n -
|
34
|
-
assert cfg.jobs["a"].steps[0].
|
34
|
+
cfg = config("jobs:\n a:\n steps:\n - with: --opt1 --opt2\n")
|
35
|
+
assert cfg.jobs["a"].steps[0].with_ == "--opt1 --opt2"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
|
3
3
|
import pytest
|
4
|
+
from omegaconf import DictConfig
|
4
5
|
|
5
6
|
|
6
7
|
@pytest.mark.parametrize("file", ["hydraflow.yaml", "hydraflow.yml"])
|
@@ -16,3 +17,15 @@ def test_find_config_none(chdir):
|
|
16
17
|
from hydraflow.executor.io import find_config_file
|
17
18
|
|
18
19
|
assert find_config_file() is None
|
20
|
+
|
21
|
+
|
22
|
+
def test_load_config_list(chdir):
|
23
|
+
from hydraflow.executor.io import load_config
|
24
|
+
|
25
|
+
Path("hydraflow.yaml").write_text("- a\n- b\n")
|
26
|
+
|
27
|
+
cfg = load_config()
|
28
|
+
assert isinstance(cfg, DictConfig)
|
29
|
+
assert cfg.jobs == {}
|
30
|
+
|
31
|
+
Path("hydraflow.yaml").unlink()
|
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
|
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
|