hydraflow 0.12.3__tar.gz → 0.12.4__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 (93) hide show
  1. hydraflow-0.12.4/.github/workflows/publish.yaml +38 -0
  2. {hydraflow-0.12.3 → hydraflow-0.12.4}/PKG-INFO +1 -1
  3. {hydraflow-0.12.3 → hydraflow-0.12.4}/docs/index.md +9 -9
  4. {hydraflow-0.12.3 → hydraflow-0.12.4}/pyproject.toml +1 -1
  5. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/io.py +28 -9
  6. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/io/test_iter_dirs.py +13 -0
  7. {hydraflow-0.12.3 → hydraflow-0.12.4}/.devcontainer/devcontainer.json +0 -0
  8. {hydraflow-0.12.3 → hydraflow-0.12.4}/.devcontainer/postCreate.sh +0 -0
  9. {hydraflow-0.12.3 → hydraflow-0.12.4}/.devcontainer/starship.toml +0 -0
  10. {hydraflow-0.12.3 → hydraflow-0.12.4}/.gitattributes +0 -0
  11. {hydraflow-0.12.3 → hydraflow-0.12.4}/.github/workflows/ci.yaml +0 -0
  12. {hydraflow-0.12.3 → hydraflow-0.12.4}/.github/workflows/docs.yaml +0 -0
  13. {hydraflow-0.12.3 → hydraflow-0.12.4}/.gitignore +0 -0
  14. {hydraflow-0.12.3 → hydraflow-0.12.4}/LICENSE +0 -0
  15. {hydraflow-0.12.3 → hydraflow-0.12.4}/README.md +0 -0
  16. {hydraflow-0.12.3 → hydraflow-0.12.4}/apps/quickstart.py +0 -0
  17. {hydraflow-0.12.3 → hydraflow-0.12.4}/docs/usage/quickstart.md +0 -0
  18. {hydraflow-0.12.3 → hydraflow-0.12.4}/mkdocs.yaml +0 -0
  19. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/__init__.py +0 -0
  20. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/cli.py +0 -0
  21. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/__init__.py +0 -0
  22. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/config.py +0 -0
  23. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/context.py +0 -0
  24. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/main.py +0 -0
  25. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/mlflow.py +0 -0
  26. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/core/param.py +0 -0
  27. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/entities/__init__.py +0 -0
  28. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/entities/run_collection.py +0 -0
  29. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/entities/run_data.py +0 -0
  30. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/entities/run_info.py +0 -0
  31. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/executor/__init__.py +0 -0
  32. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/executor/conf.py +0 -0
  33. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/executor/io.py +0 -0
  34. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/executor/job.py +0 -0
  35. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/executor/parser.py +0 -0
  36. {hydraflow-0.12.3 → hydraflow-0.12.4}/src/hydraflow/py.typed +0 -0
  37. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/__init__.py +0 -0
  38. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/__init__.py +0 -0
  39. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/app.py +0 -0
  40. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/conftest.py +0 -0
  41. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/hydraflow.yaml +0 -0
  42. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/test_run.py +0 -0
  43. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/test_setup.py +0 -0
  44. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/test_show.py +0 -0
  45. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/cli/test_version.py +0 -0
  46. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/conftest.py +0 -0
  47. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/__init__.py +0 -0
  48. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/config/__init__.py +0 -0
  49. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/config/test_config.py +0 -0
  50. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/config/test_params.py +0 -0
  51. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/__init__.py +0 -0
  52. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/chdir.py +0 -0
  53. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/log_run.py +0 -0
  54. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/start_run.py +0 -0
  55. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/test_chdir.py +0 -0
  56. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/test_log_run.py +0 -0
  57. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/context/test_start_run.py +0 -0
  58. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/io/__init__.py +0 -0
  59. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/io/hydra_dir.py +0 -0
  60. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/io/test_hydra_dir.py +0 -0
  61. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/io/test_run.py +0 -0
  62. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/__init__.py +0 -0
  63. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/default.py +0 -0
  64. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/force_new_run.py +0 -0
  65. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/match_overrides.py +0 -0
  66. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/rerun_finished.py +0 -0
  67. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/skip_finished.py +0 -0
  68. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/test_default.py +0 -0
  69. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/test_force_new_run.py +0 -0
  70. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/test_match_overrides.py +0 -0
  71. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/test_rerun_finished.py +0 -0
  72. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/main/test_skip_finished.py +0 -0
  73. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/param/__init__.py +0 -0
  74. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/param/params.py +0 -0
  75. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/param/test_param.py +0 -0
  76. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/param/test_params.py +0 -0
  77. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/core/test_mlflow.py +0 -0
  78. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/__init__.py +0 -0
  79. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/filter.py +0 -0
  80. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/test_collection.py +0 -0
  81. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/test_data.py +0 -0
  82. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/test_filter.py +0 -0
  83. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/test_info.py +0 -0
  84. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/test_values.py +0 -0
  85. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/entities/values.py +0 -0
  86. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/__init__.py +0 -0
  87. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/conftest.py +0 -0
  88. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/echo.py +0 -0
  89. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/test_args.py +0 -0
  90. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/test_conf.py +0 -0
  91. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/test_io.py +0 -0
  92. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/test_job.py +0 -0
  93. {hydraflow-0.12.3 → hydraflow-0.12.4}/tests/executor/test_parser.py +0 -0
@@ -0,0 +1,38 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "[0-9]+.[0-9]+.[0-9]+"
7
+
8
+ jobs:
9
+ publish:
10
+ name: Publish
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Verify version match
18
+ run: |
19
+ TAG=${GITHUB_REF#refs/tags/}
20
+ PYPROJECT_VERSION=$(grep -m 1 "version = " pyproject.toml | cut -d'"' -f2)
21
+ if [ "$TAG" != "$PYPROJECT_VERSION" ]; then
22
+ echo "Error: Git tag ($TAG) does not match pyproject.toml version ($PYPROJECT_VERSION)"
23
+ exit 1
24
+ fi
25
+ echo "Version verified: $TAG"
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: 3.13
31
+ - name: Install uv
32
+ run: pip install uv
33
+ - name: Install the project
34
+ run: uv sync
35
+ - name: Build the project
36
+ run: uv build --no-sources
37
+ - name: Upload the project to PyPI
38
+ run: uv publish
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hydraflow
3
- Version: 0.12.3
3
+ Version: 0.12.4
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
@@ -1,10 +1,10 @@
1
- # Hydraflow Documentation
2
-
3
- Hydraflow integrates [Hydra](https://hydra.cc/) and [MLflow](https://mlflow.org/)
4
- to manage and track machine learning experiments.
5
-
6
- ## Installation
7
-
8
- ```bash
9
- pip install hydraflow
1
+ # Hydraflow Documentation
2
+
3
+ Hydraflow integrates [Hydra](https://hydra.cc/) and [MLflow](https://mlflow.org/)
4
+ to manage and track machine learning experiments.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ pip install hydraflow
10
10
  ```
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hydraflow"
7
- version = "0.12.3"
7
+ version = "0.12.4"
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" }
@@ -12,7 +12,7 @@ from hydra.core.hydra_config import HydraConfig
12
12
  from omegaconf import DictConfig, ListConfig, OmegaConf
13
13
 
14
14
  if TYPE_CHECKING:
15
- from collections.abc import Iterable, Iterator
15
+ from collections.abc import Callable, Iterable, Iterator
16
16
 
17
17
  from mlflow.entities import Run
18
18
 
@@ -179,8 +179,29 @@ def get_experiment_name(path: Path) -> str | None:
179
179
  return None
180
180
 
181
181
 
182
+ def predicate_experiment_dir(
183
+ path: Path,
184
+ experiment_names: list[str] | Callable[[str], bool] | None = None,
185
+ ) -> bool:
186
+ """Predicate an experiment directory based on the path and experiment names."""
187
+ if not path.is_dir() or path.name in [".trash", "0"]:
188
+ return False
189
+
190
+ name = get_experiment_name(path)
191
+ if not name:
192
+ return False
193
+
194
+ if experiment_names is None:
195
+ return True
196
+
197
+ if isinstance(experiment_names, list):
198
+ return name in experiment_names
199
+
200
+ return experiment_names(name)
201
+
202
+
182
203
  def iter_experiment_dirs(
183
- experiment_names: str | list[str] | None = None,
204
+ experiment_names: str | list[str] | Callable[[str], bool] | None = None,
184
205
  root_dir: str | Path | None = None,
185
206
  ) -> Iterator[Path]:
186
207
  """Iterate over the experiment directories in the root directory."""
@@ -189,14 +210,12 @@ def iter_experiment_dirs(
189
210
 
190
211
  root_dir = get_root_dir(root_dir)
191
212
  for path in root_dir.iterdir():
192
- if path.is_dir() and path.name not in [".trash", "0"]:
193
- if name := get_experiment_name(path):
194
- if experiment_names is None or name in experiment_names:
195
- yield path
213
+ if predicate_experiment_dir(path, experiment_names):
214
+ yield path
196
215
 
197
216
 
198
217
  def iter_run_dirs(
199
- experiment_names: str | list[str] | None = None,
218
+ experiment_names: str | list[str] | Callable[[str], bool] | None = None,
200
219
  root_dir: str | Path | None = None,
201
220
  ) -> Iterator[Path]:
202
221
  """Iterate over the run directories in the root directory."""
@@ -207,7 +226,7 @@ def iter_run_dirs(
207
226
 
208
227
 
209
228
  def iter_artifacts_dirs(
210
- experiment_names: str | list[str] | None = None,
229
+ experiment_names: str | list[str] | Callable[[str], bool] | None = None,
211
230
  root_dir: str | Path | None = None,
212
231
  ) -> Iterator[Path]:
213
232
  """Iterate over the artifacts directories in the root directory."""
@@ -217,7 +236,7 @@ def iter_artifacts_dirs(
217
236
 
218
237
  def iter_artifact_paths(
219
238
  artifact_path: str | Path,
220
- experiment_names: str | list[str] | None = None,
239
+ experiment_names: str | list[str] | Callable[[str], bool] | None = None,
221
240
  root_dir: str | Path | None = None,
222
241
  ) -> Iterator[Path]:
223
242
  """Iterate over the artifact paths in the root directory."""
@@ -49,6 +49,19 @@ def test_iter_experiment_dirs_filter():
49
49
  assert [get_experiment_name(p) for p in it] == ["e1"]
50
50
 
51
51
 
52
+ def test_iter_experiment_dirs_filter_callable():
53
+ from hydraflow.core.io import get_experiment_name, iter_experiment_dirs
54
+
55
+ it = iter_experiment_dirs(lambda name: name == "e2")
56
+ assert [get_experiment_name(p) for p in it] == ["e2"]
57
+
58
+
59
+ def test_predicate_experiment_dir():
60
+ from hydraflow.core.io import predicate_experiment_dir
61
+
62
+ assert predicate_experiment_dir(Path()) is False
63
+
64
+
52
65
  def test_get_experiment_name_none(root_dir: Path):
53
66
  from hydraflow.core.io import get_experiment_name
54
67
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes