hydraflow 0.13.0__tar.gz → 0.14.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.
Files changed (95) hide show
  1. {hydraflow-0.13.0 → hydraflow-0.14.0}/PKG-INFO +3 -4
  2. {hydraflow-0.13.0 → hydraflow-0.14.0}/pyproject.toml +3 -4
  3. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/cli.py +13 -28
  4. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/executor/conf.py +1 -0
  5. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/hydraflow.yaml +1 -1
  6. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/test_run.py +2 -9
  7. {hydraflow-0.13.0 → hydraflow-0.14.0}/.devcontainer/devcontainer.json +0 -0
  8. {hydraflow-0.13.0 → hydraflow-0.14.0}/.devcontainer/postCreate.sh +0 -0
  9. {hydraflow-0.13.0 → hydraflow-0.14.0}/.devcontainer/starship.toml +0 -0
  10. {hydraflow-0.13.0 → hydraflow-0.14.0}/.gitattributes +0 -0
  11. {hydraflow-0.13.0 → hydraflow-0.14.0}/.github/workflows/ci.yaml +0 -0
  12. {hydraflow-0.13.0 → hydraflow-0.14.0}/.github/workflows/docs.yaml +0 -0
  13. {hydraflow-0.13.0 → hydraflow-0.14.0}/.github/workflows/publish.yaml +0 -0
  14. {hydraflow-0.13.0 → hydraflow-0.14.0}/.gitignore +0 -0
  15. {hydraflow-0.13.0 → hydraflow-0.14.0}/LICENSE +0 -0
  16. {hydraflow-0.13.0 → hydraflow-0.14.0}/README.md +0 -0
  17. {hydraflow-0.13.0 → hydraflow-0.14.0}/apps/quickstart.py +0 -0
  18. {hydraflow-0.13.0 → hydraflow-0.14.0}/docs/index.md +0 -0
  19. {hydraflow-0.13.0 → hydraflow-0.14.0}/docs/usage/quickstart.md +0 -0
  20. {hydraflow-0.13.0 → hydraflow-0.14.0}/mkdocs.yaml +0 -0
  21. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/__init__.py +0 -0
  22. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/__init__.py +0 -0
  23. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/config.py +0 -0
  24. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/context.py +0 -0
  25. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/io.py +0 -0
  26. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/main.py +0 -0
  27. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/mlflow.py +0 -0
  28. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/core/param.py +0 -0
  29. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/entities/__init__.py +0 -0
  30. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/entities/run_collection.py +0 -0
  31. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/entities/run_data.py +0 -0
  32. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/entities/run_info.py +0 -0
  33. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/executor/__init__.py +0 -0
  34. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/executor/io.py +0 -0
  35. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/executor/job.py +0 -0
  36. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/executor/parser.py +0 -0
  37. {hydraflow-0.13.0 → hydraflow-0.14.0}/src/hydraflow/py.typed +0 -0
  38. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/__init__.py +0 -0
  39. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/__init__.py +0 -0
  40. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/app.py +0 -0
  41. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/conftest.py +0 -0
  42. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/submit.py +0 -0
  43. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/test_setup.py +0 -0
  44. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/test_show.py +0 -0
  45. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/cli/test_version.py +0 -0
  46. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/conftest.py +0 -0
  47. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/__init__.py +0 -0
  48. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/config/__init__.py +0 -0
  49. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/config/test_config.py +0 -0
  50. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/config/test_params.py +0 -0
  51. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/__init__.py +0 -0
  52. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/chdir.py +0 -0
  53. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/log_run.py +0 -0
  54. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/start_run.py +0 -0
  55. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/test_chdir.py +0 -0
  56. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/test_log_run.py +0 -0
  57. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/context/test_start_run.py +0 -0
  58. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/io/__init__.py +0 -0
  59. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/io/hydra_dir.py +0 -0
  60. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/io/test_hydra_dir.py +0 -0
  61. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/io/test_iter_dirs.py +0 -0
  62. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/io/test_run.py +0 -0
  63. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/__init__.py +0 -0
  64. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/default.py +0 -0
  65. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/force_new_run.py +0 -0
  66. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/match_overrides.py +0 -0
  67. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/rerun_finished.py +0 -0
  68. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/skip_finished.py +0 -0
  69. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/test_default.py +0 -0
  70. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/test_force_new_run.py +0 -0
  71. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/test_match_overrides.py +0 -0
  72. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/test_rerun_finished.py +0 -0
  73. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/main/test_skip_finished.py +0 -0
  74. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/param/__init__.py +0 -0
  75. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/param/params.py +0 -0
  76. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/param/test_param.py +0 -0
  77. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/param/test_params.py +0 -0
  78. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/core/test_mlflow.py +0 -0
  79. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/__init__.py +0 -0
  80. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/filter.py +0 -0
  81. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/test_collection.py +0 -0
  82. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/test_data.py +0 -0
  83. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/test_filter.py +0 -0
  84. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/test_info.py +0 -0
  85. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/test_values.py +0 -0
  86. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/entities/values.py +0 -0
  87. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/__init__.py +0 -0
  88. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/conftest.py +0 -0
  89. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/echo.py +0 -0
  90. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/read.py +0 -0
  91. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/test_args.py +0 -0
  92. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/test_conf.py +0 -0
  93. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/test_io.py +0 -0
  94. {hydraflow-0.13.0 → hydraflow-0.14.0}/tests/executor/test_job.py +0 -0
  95. {hydraflow-0.13.0 → hydraflow-0.14.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.13.0
3
+ Version: 0.14.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
@@ -38,10 +38,9 @@ Classifier: Programming Language :: Python :: 3.13
38
38
  Requires-Python: >=3.10
39
39
  Requires-Dist: hydra-core>=1.3
40
40
  Requires-Dist: mlflow>=2.15
41
- Requires-Dist: omegaconf
41
+ Requires-Dist: omegaconf>=2.3
42
42
  Requires-Dist: python-ulid>=3.0.0
43
- Requires-Dist: rich
44
- Requires-Dist: typer
43
+ Requires-Dist: typer>=0.15
45
44
  Description-Content-Type: text/markdown
46
45
 
47
46
  # Hydraflow
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hydraflow"
7
- version = "0.13.0"
7
+ version = "0.14.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" }
@@ -22,10 +22,9 @@ requires-python = ">=3.10"
22
22
  dependencies = [
23
23
  "hydra-core>=1.3",
24
24
  "mlflow>=2.15",
25
- "omegaconf",
25
+ "omegaconf>=2.3",
26
26
  "python-ulid>=3.0.0",
27
- "rich",
28
- "typer",
27
+ "typer>=0.15",
29
28
  ]
30
29
 
31
30
  [project.urls]
@@ -3,14 +3,15 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import shlex
6
- from typing import Annotated
6
+ from typing import TYPE_CHECKING, Annotated
7
7
 
8
8
  import typer
9
- from rich.console import Console
10
- from typer import Argument, Option
9
+ from typer import Argument, Exit, Option
10
+
11
+ if TYPE_CHECKING:
12
+ from hydraflow.executor.conf import Job
11
13
 
12
14
  app = typer.Typer(add_completion=False)
13
- console = Console()
14
15
 
15
16
 
16
17
  @app.command(context_settings={"ignore_unknown_options": True})
@@ -33,6 +34,10 @@ def run(
33
34
  args = args or []
34
35
  job = get_job(name)
35
36
 
37
+ if job.submit:
38
+ submit(job, args, dry_run=dry_run)
39
+ raise Exit
40
+
36
41
  if job.run:
37
42
  args = [*shlex.split(job.run), *args]
38
43
  it = iter_runs(args, iter_batches(job), dry_run=dry_run)
@@ -41,7 +46,7 @@ def run(
41
46
  it = iter_calls(args, iter_batches(job), dry_run=dry_run)
42
47
  else:
43
48
  typer.echo(f"No command found in job: {job.name}.")
44
- raise typer.Exit(1)
49
+ raise Exit(1)
45
50
 
46
51
  if not dry_run:
47
52
  import mlflow
@@ -57,36 +62,16 @@ def run(
57
62
  typer.echo(f"{funcname}([{arg}])")
58
63
 
59
64
 
60
- @app.command(context_settings={"ignore_unknown_options": True})
61
- def submit(
62
- name: Annotated[str, Argument(help="Job name.", show_default=False)],
63
- *,
64
- args: Annotated[
65
- list[str] | None,
66
- Argument(help="Arguments to pass to the job.", show_default=False),
67
- ] = None,
68
- dry_run: Annotated[
69
- bool,
70
- Option("--dry-run", help="Perform a dry run."),
71
- ] = False,
72
- ) -> None:
65
+ def submit(job: Job, args: list[str], *, dry_run: bool) -> None:
73
66
  """Submit a job."""
74
- from hydraflow.executor.io import get_job
75
67
  from hydraflow.executor.job import iter_batches, submit
76
68
 
77
- args = args or []
78
- job = get_job(name)
79
-
80
- if not job.run:
81
- typer.echo(f"No run found in job: {job.name}.")
82
- raise typer.Exit(1)
83
-
84
69
  if not dry_run:
85
70
  import mlflow
86
71
 
87
72
  mlflow.set_experiment(job.name)
88
73
 
89
- args = [*shlex.split(job.run), *args]
74
+ args = [*shlex.split(job.submit), *args]
90
75
  result = submit(args, iter_batches(job), dry_run=dry_run)
91
76
 
92
77
  if dry_run and isinstance(result, tuple):
@@ -124,4 +109,4 @@ def callback(
124
109
  import importlib.metadata
125
110
 
126
111
  typer.echo(f"hydraflow {importlib.metadata.version('hydraflow')}")
127
- raise typer.Exit
112
+ raise Exit
@@ -15,6 +15,7 @@ class Job:
15
15
  name: str = ""
16
16
  run: str = ""
17
17
  call: str = ""
18
+ submit: str = ""
18
19
  with_: str = ""
19
20
  steps: list[Step] = field(default_factory=list)
20
21
 
@@ -28,7 +28,7 @@ jobs:
28
28
  - batch: name=c,d
29
29
  args: count=4:6
30
30
  submit:
31
- run: python submit.py
31
+ submit: python submit.py
32
32
  steps:
33
33
  - batch: name=a,b
34
34
  args: count=1
@@ -54,7 +54,7 @@ def test_run_echo_dry_run():
54
54
 
55
55
 
56
56
  def test_submit_dry_run():
57
- args = ["submit", "submit", "--dry-run", "a", "--b", "--", "--dry-run"]
57
+ args = ["run", "submit", "--dry-run", "a", "--b", "--", "--dry-run"]
58
58
  result = runner.invoke(app, args)
59
59
  assert result.exit_code == 0
60
60
  assert result.stdout.count("submit.py a --b --dry-run --multirun") == 4
@@ -99,7 +99,7 @@ def test_run_echo():
99
99
 
100
100
  @pytest.mark.xdist_group(name="group4")
101
101
  def test_submit():
102
- result = runner.invoke(app, ["submit", "submit"])
102
+ result = runner.invoke(app, ["run", "submit"])
103
103
  assert result.exit_code == 0
104
104
  out = result.stdout
105
105
  lines = out.splitlines()
@@ -113,10 +113,3 @@ def test_run_error():
113
113
  result = runner.invoke(app, ["run", "error"])
114
114
  assert result.exit_code == 1
115
115
  assert "No command found in job: error." in result.stdout
116
-
117
-
118
- @pytest.mark.xdist_group(name="group5")
119
- def test_submit_error():
120
- result = runner.invoke(app, ["submit", "error"])
121
- assert result.exit_code == 1
122
- assert "No run found in job: error." in result.stdout
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