hydraflow 0.19.0__tar.gz → 0.19.2__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.19.0 → hydraflow-0.19.2}/PKG-INFO +32 -32
- {hydraflow-0.19.0 → hydraflow-0.19.2}/README.md +1 -1
- {hydraflow-0.19.0 → hydraflow-0.19.2}/pyproject.toml +21 -10
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/cli.py +1 -1
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/collection.py +12 -10
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/group_by.py +2 -2
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/io.py +1 -1
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/main.py +3 -3
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/run.py +12 -10
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/run_collection.py +2 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/aio.py +1 -1
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/io.py +2 -2
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/job.py +3 -3
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/parser.py +3 -3
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/utils/progress.py +4 -4
- hydraflow-0.19.0/.devcontainer/devcontainer.json +0 -19
- hydraflow-0.19.0/.devcontainer/postCreate.sh +0 -8
- hydraflow-0.19.0/.devcontainer/starship.toml +0 -29
- hydraflow-0.19.0/.gitattributes +0 -2
- hydraflow-0.19.0/.github/workflows/ci.yaml +0 -50
- hydraflow-0.19.0/.github/workflows/docs.yaml +0 -29
- hydraflow-0.19.0/.github/workflows/publish.yaml +0 -37
- hydraflow-0.19.0/.gitignore +0 -11
- hydraflow-0.19.0/docs/getting-started/concepts.md +0 -189
- hydraflow-0.19.0/docs/getting-started/index.md +0 -80
- hydraflow-0.19.0/docs/getting-started/installation.md +0 -83
- hydraflow-0.19.0/docs/index.md +0 -91
- hydraflow-0.19.0/docs/part1-applications/configuration.md +0 -130
- hydraflow-0.19.0/docs/part1-applications/execution.md +0 -194
- hydraflow-0.19.0/docs/part1-applications/index.md +0 -90
- hydraflow-0.19.0/docs/part1-applications/main-decorator.md +0 -301
- hydraflow-0.19.0/docs/part2-advanced/index.md +0 -103
- hydraflow-0.19.0/docs/part2-advanced/job-configuration.md +0 -268
- hydraflow-0.19.0/docs/part2-advanced/sweep-syntax.md +0 -285
- hydraflow-0.19.0/docs/part3-analysis/index.md +0 -166
- hydraflow-0.19.0/docs/part3-analysis/run-class.md +0 -296
- hydraflow-0.19.0/docs/part3-analysis/run-collection.md +0 -471
- hydraflow-0.19.0/docs/part3-analysis/updating-runs.md +0 -165
- hydraflow-0.19.0/docs/practical-tutorials/advanced.md +0 -252
- hydraflow-0.19.0/docs/practical-tutorials/analysis.md +0 -357
- hydraflow-0.19.0/docs/practical-tutorials/applications.md +0 -182
- hydraflow-0.19.0/docs/practical-tutorials/index.md +0 -54
- hydraflow-0.19.0/examples/example.py +0 -24
- hydraflow-0.19.0/examples/hydraflow.yaml +0 -19
- hydraflow-0.19.0/examples/submit.py +0 -19
- hydraflow-0.19.0/mkdocs.yaml +0 -91
- hydraflow-0.19.0/tests/__init__.py +0 -0
- hydraflow-0.19.0/tests/cli/__init__.py +0 -0
- hydraflow-0.19.0/tests/cli/app.py +0 -54
- hydraflow-0.19.0/tests/cli/conftest.py +0 -14
- hydraflow-0.19.0/tests/cli/hydraflow.yaml +0 -62
- hydraflow-0.19.0/tests/cli/submit.py +0 -17
- hydraflow-0.19.0/tests/cli/test_run.py +0 -131
- hydraflow-0.19.0/tests/cli/test_setup.py +0 -7
- hydraflow-0.19.0/tests/cli/test_show.py +0 -18
- hydraflow-0.19.0/tests/cli/test_version.py +0 -20
- hydraflow-0.19.0/tests/conftest.py +0 -67
- hydraflow-0.19.0/tests/core/__init__.py +0 -0
- hydraflow-0.19.0/tests/core/context/__init__.py +0 -0
- hydraflow-0.19.0/tests/core/context/chdir.py +0 -32
- hydraflow-0.19.0/tests/core/context/log_run.py +0 -43
- hydraflow-0.19.0/tests/core/context/start_run.py +0 -34
- hydraflow-0.19.0/tests/core/context/test_chdir.py +0 -24
- hydraflow-0.19.0/tests/core/context/test_log_run.py +0 -45
- hydraflow-0.19.0/tests/core/context/test_start_run.py +0 -29
- hydraflow-0.19.0/tests/core/main/__init__.py +0 -0
- hydraflow-0.19.0/tests/core/main/default.py +0 -28
- hydraflow-0.19.0/tests/core/main/force_new_run.py +0 -26
- hydraflow-0.19.0/tests/core/main/match_overrides.py +0 -24
- hydraflow-0.19.0/tests/core/main/rerun_finished.py +0 -33
- hydraflow-0.19.0/tests/core/main/skip_finished.py +0 -26
- hydraflow-0.19.0/tests/core/main/test_default.py +0 -60
- hydraflow-0.19.0/tests/core/main/test_dry_run.py +0 -26
- hydraflow-0.19.0/tests/core/main/test_force_new_run.py +0 -29
- hydraflow-0.19.0/tests/core/main/test_main.py +0 -13
- hydraflow-0.19.0/tests/core/main/test_match_overrides.py +0 -15
- hydraflow-0.19.0/tests/core/main/test_rerun_finished.py +0 -20
- hydraflow-0.19.0/tests/core/main/test_skip_finished.py +0 -71
- hydraflow-0.19.0/tests/core/main/test_update.py +0 -18
- hydraflow-0.19.0/tests/core/main/update.py +0 -35
- hydraflow-0.19.0/tests/core/run/__init__.py +0 -0
- hydraflow-0.19.0/tests/core/run/run.py +0 -31
- hydraflow-0.19.0/tests/core/run/test_run.py +0 -322
- hydraflow-0.19.0/tests/core/run/test_run_collection.py +0 -291
- hydraflow-0.19.0/tests/core/run/test_run_info.py +0 -16
- hydraflow-0.19.0/tests/core/test_collection.py +0 -421
- hydraflow-0.19.0/tests/core/test_group_by.py +0 -125
- hydraflow-0.19.0/tests/core/test_io.py +0 -120
- hydraflow-0.19.0/tests/executor/__init__.py +0 -0
- hydraflow-0.19.0/tests/executor/conftest.py +0 -30
- hydraflow-0.19.0/tests/executor/echo.py +0 -19
- hydraflow-0.19.0/tests/executor/read.py +0 -15
- hydraflow-0.19.0/tests/executor/test_aio.py +0 -22
- hydraflow-0.19.0/tests/executor/test_args.py +0 -19
- hydraflow-0.19.0/tests/executor/test_conf.py +0 -35
- hydraflow-0.19.0/tests/executor/test_io.py +0 -31
- hydraflow-0.19.0/tests/executor/test_job.py +0 -138
- hydraflow-0.19.0/tests/executor/test_parser.py +0 -344
- hydraflow-0.19.0/tests/utils/__init__.py +0 -0
- hydraflow-0.19.0/tests/utils/test_progress.py +0 -34
- {hydraflow-0.19.0 → hydraflow-0.19.2}/LICENSE +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/__init__.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/__init__.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/context.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/core/run_info.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/__init__.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/executor/conf.py +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/py.typed +0 -0
- {hydraflow-0.19.0 → hydraflow-0.19.2}/src/hydraflow/utils/__init__.py +0 -0
@@ -1,34 +1,31 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: hydraflow
|
3
|
-
Version: 0.19.
|
3
|
+
Version: 0.19.2
|
4
4
|
Summary: HydraFlow seamlessly integrates Hydra and MLflow to streamline ML experiment management, combining Hydra's configuration management with MLflow's tracking capabilities.
|
5
|
-
|
6
|
-
|
7
|
-
Project-URL: Issues, https://github.com/daizutabi/hydraflow/issues
|
5
|
+
Keywords: machine-learning,mlflow,hydra,experiment-tracking,mlops,ai,deep-learning,research,data-science
|
6
|
+
Author: daizutabi
|
8
7
|
Author-email: daizutabi <daizutabi@gmail.com>
|
9
8
|
License: MIT License
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
License-File: LICENSE
|
31
|
-
Keywords: ai,data-science,deep-learning,experiment-tracking,hydra,machine-learning,mlflow,mlops,research
|
9
|
+
|
10
|
+
Copyright (c) 2024 Daizu
|
11
|
+
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
14
|
+
in the Software without restriction, including without limitation the rights
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
17
|
+
furnished to do so, subject to the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
20
|
+
copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28
|
+
SOFTWARE.
|
32
29
|
Classifier: Development Status :: 4 - Beta
|
33
30
|
Classifier: Environment :: Console
|
34
31
|
Classifier: Intended Audience :: Developers
|
@@ -39,15 +36,18 @@ Classifier: Programming Language :: Python
|
|
39
36
|
Classifier: Programming Language :: Python :: 3.13
|
40
37
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
41
38
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
42
|
-
Requires-Python: >=3.13
|
43
39
|
Requires-Dist: hydra-core>=1.3
|
44
40
|
Requires-Dist: joblib>=1.4.0
|
45
|
-
Requires-Dist: mlflow>=
|
41
|
+
Requires-Dist: mlflow>=3
|
46
42
|
Requires-Dist: omegaconf>=2.3
|
47
43
|
Requires-Dist: polars>=1.26
|
48
44
|
Requires-Dist: python-ulid>=3.0.0
|
49
|
-
Requires-Dist: rich>=
|
50
|
-
Requires-Dist: typer>=0.
|
45
|
+
Requires-Dist: rich>=14
|
46
|
+
Requires-Dist: typer>=0.16
|
47
|
+
Requires-Python: >=3.13
|
48
|
+
Project-URL: Documentation, https://daizutabi.github.io/hydraflow/
|
49
|
+
Project-URL: Issues, https://github.com/daizutabi/hydraflow/issues
|
50
|
+
Project-URL: Source, https://github.com/daizutabi/hydraflow
|
51
51
|
Description-Content-Type: text/markdown
|
52
52
|
|
53
53
|
# HydraFlow
|
@@ -64,7 +64,7 @@ Description-Content-Type: text/markdown
|
|
64
64
|
[pypi-v-link]: https://pypi.org/project/hydraflow/
|
65
65
|
[GHAction-image]: https://github.com/daizutabi/hydraflow/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
|
66
66
|
[GHAction-link]: https://github.com/daizutabi/hydraflow/actions?query=event%3Apush+branch%3Amain
|
67
|
-
[codecov-image]: https://codecov.io/github/daizutabi/hydraflow/
|
67
|
+
[codecov-image]: https://codecov.io/github/daizutabi/hydraflow/graph/badge.svg?token=Yu6lAdVVnd
|
68
68
|
[codecov-link]: https://codecov.io/github/daizutabi/hydraflow?branch=main
|
69
69
|
[docs-image]: https://img.shields.io/badge/docs-latest-blue.svg
|
70
70
|
[docs-link]: https://daizutabi.github.io/hydraflow/
|
@@ -12,7 +12,7 @@
|
|
12
12
|
[pypi-v-link]: https://pypi.org/project/hydraflow/
|
13
13
|
[GHAction-image]: https://github.com/daizutabi/hydraflow/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
|
14
14
|
[GHAction-link]: https://github.com/daizutabi/hydraflow/actions?query=event%3Apush+branch%3Amain
|
15
|
-
[codecov-image]: https://codecov.io/github/daizutabi/hydraflow/
|
15
|
+
[codecov-image]: https://codecov.io/github/daizutabi/hydraflow/graph/badge.svg?token=Yu6lAdVVnd
|
16
16
|
[codecov-link]: https://codecov.io/github/daizutabi/hydraflow?branch=main
|
17
17
|
[docs-image]: https://img.shields.io/badge/docs-latest-blue.svg
|
18
18
|
[docs-link]: https://daizutabi.github.io/hydraflow/
|
@@ -1,10 +1,10 @@
|
|
1
1
|
[build-system]
|
2
|
-
requires = ["
|
3
|
-
build-backend = "
|
2
|
+
requires = ["uv_build"]
|
3
|
+
build-backend = "uv_build"
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "hydraflow"
|
7
|
-
version = "0.19.
|
7
|
+
version = "0.19.2"
|
8
8
|
description = "HydraFlow seamlessly integrates Hydra and MLflow to streamline ML experiment management, combining Hydra's configuration management with MLflow's tracking capabilities."
|
9
9
|
readme = "README.md"
|
10
10
|
license = { file = "LICENSE" }
|
@@ -36,12 +36,12 @@ keywords = [
|
|
36
36
|
dependencies = [
|
37
37
|
"hydra-core>=1.3",
|
38
38
|
"joblib>=1.4.0",
|
39
|
-
"mlflow>=
|
39
|
+
"mlflow>=3",
|
40
40
|
"omegaconf>=2.3",
|
41
41
|
"polars>=1.26",
|
42
42
|
"python-ulid>=3.0.0",
|
43
|
-
"rich>=
|
44
|
-
"typer>=0.
|
43
|
+
"rich>=14",
|
44
|
+
"typer>=0.16",
|
45
45
|
]
|
46
46
|
|
47
47
|
[project.urls]
|
@@ -60,7 +60,6 @@ dev = [
|
|
60
60
|
"pytest-order",
|
61
61
|
"pytest-randomly",
|
62
62
|
"pytest-xdist",
|
63
|
-
"ruff>=0.11",
|
64
63
|
]
|
65
64
|
docs = ["markdown-exec[ansi]", "mkapi>=4.4", "mkdocs-material"]
|
66
65
|
|
@@ -99,8 +98,8 @@ ignore = [
|
|
99
98
|
"EM101",
|
100
99
|
"FBT001",
|
101
100
|
"FBT002",
|
102
|
-
"PD",
|
103
101
|
"PGH003",
|
102
|
+
"PLC0415",
|
104
103
|
"PLR0911",
|
105
104
|
"PLR0913",
|
106
105
|
"PLR1704",
|
@@ -119,5 +118,17 @@ ignore = [
|
|
119
118
|
"src/hydraflow/executor/conf.py" = ["ANN", "D"]
|
120
119
|
"tests/*" = ["A001", "ANN", "ARG", "D", "FBT", "PD", "PLR", "PT", "S", "SLF"]
|
121
120
|
|
122
|
-
[tool.
|
123
|
-
include = ["src"
|
121
|
+
[tool.basedpyright]
|
122
|
+
include = ["src"]
|
123
|
+
exclude = ["notebooks", "tests"]
|
124
|
+
reportAny = false
|
125
|
+
reportExplicitAny = false
|
126
|
+
reportImplicitOverride = false
|
127
|
+
reportImportCycles = false
|
128
|
+
reportIncompatibleVariableOverride = false
|
129
|
+
reportMissingTypeStubs = false
|
130
|
+
reportUnusedCallResult = false
|
131
|
+
|
132
|
+
[tool.ty.rules]
|
133
|
+
unresolved-import = "ignore"
|
134
|
+
possibly-unbound-attribute = "ignore"
|
@@ -15,7 +15,7 @@ app = typer.Typer(add_completion=False)
|
|
15
15
|
|
16
16
|
|
17
17
|
@app.command("run", context_settings={"ignore_unknown_options": True})
|
18
|
-
def _run(
|
18
|
+
def _run( # pyright: ignore[reportUnusedFunction]
|
19
19
|
name: Annotated[str, Argument(help="Job name.", show_default=False)],
|
20
20
|
*,
|
21
21
|
args: Annotated[
|
@@ -17,11 +17,13 @@ from .group_by import GroupBy
|
|
17
17
|
|
18
18
|
if TYPE_CHECKING:
|
19
19
|
from collections.abc import Callable, Iterator
|
20
|
-
from re import Pattern, _FlagsType
|
20
|
+
from re import Pattern, _FlagsType # pyright: ignore[reportPrivateUsage]
|
21
21
|
from typing import Any, Self
|
22
22
|
|
23
23
|
from numpy.typing import NDArray
|
24
24
|
|
25
|
+
# pyright: reportUnknownVariableType=false
|
26
|
+
|
25
27
|
|
26
28
|
class Collection[I](Sequence[I]):
|
27
29
|
"""A collection of items that implements the Sequence protocol."""
|
@@ -280,7 +282,7 @@ class Collection[I](Sequence[I]):
|
|
280
282
|
self,
|
281
283
|
key: str,
|
282
284
|
default: Any | Callable[[I], Any] = MISSING,
|
283
|
-
) -> NDArray:
|
285
|
+
) -> NDArray[Any]:
|
284
286
|
"""Extract values for a specific key from all items as a NumPy array.
|
285
287
|
|
286
288
|
Args:
|
@@ -323,7 +325,7 @@ class Collection[I](Sequence[I]):
|
|
323
325
|
self,
|
324
326
|
key: str,
|
325
327
|
default: Any | Callable[[I], Any] = MISSING,
|
326
|
-
) -> NDArray:
|
328
|
+
) -> NDArray[Any]:
|
327
329
|
"""Get the unique values for a specific key across all items.
|
328
330
|
|
329
331
|
Args:
|
@@ -456,13 +458,13 @@ class Collection[I](Sequence[I]):
|
|
456
458
|
it = (delayed(function)(i, *args, **kwargs) for i in self)
|
457
459
|
|
458
460
|
if not progress:
|
459
|
-
return parallel(it) #
|
461
|
+
return parallel(it) # pyright: ignore[reportReturnType]
|
460
462
|
|
461
463
|
from hydraflow.utils.progress import Progress
|
462
464
|
|
463
465
|
with Progress(*Progress.get_default_columns()) as p:
|
464
466
|
p.add_task("", total=len(self))
|
465
|
-
return parallel(it) #
|
467
|
+
return parallel(it) # pyright: ignore[reportReturnType]
|
466
468
|
|
467
469
|
def to_frame(
|
468
470
|
self,
|
@@ -513,12 +515,12 @@ class Collection[I](Sequence[I]):
|
|
513
515
|
keys_ = []
|
514
516
|
for k in keys:
|
515
517
|
if isinstance(k, tuple):
|
516
|
-
keys_.append(k[0])
|
518
|
+
keys_.append(k[0]) # pyright: ignore[reportUnknownMemberType]
|
517
519
|
defaults[k[0]] = k[1]
|
518
520
|
else:
|
519
|
-
keys_.append(k)
|
521
|
+
keys_.append(k) # pyright: ignore[reportUnknownMemberType]
|
520
522
|
|
521
|
-
data = {k: self.to_list(k, defaults.get(k, MISSING)) for k in keys_}
|
523
|
+
data = {k: self.to_list(k, defaults.get(k, MISSING)) for k in keys_} # pyright: ignore[reportUnknownArgumentType]
|
522
524
|
df = DataFrame(data)
|
523
525
|
|
524
526
|
if not kwargs:
|
@@ -907,11 +909,11 @@ def matches(value: Any, criterion: Any) -> bool:
|
|
907
909
|
if isinstance(criterion, list | set) and not _is_iterable(value):
|
908
910
|
return value in criterion
|
909
911
|
|
910
|
-
if isinstance(criterion, tuple) and len(criterion) == 2 and not _is_iterable(value):
|
912
|
+
if isinstance(criterion, tuple) and len(criterion) == 2 and not _is_iterable(value): # pyright: ignore[reportUnknownArgumentType]
|
911
913
|
return criterion[0] <= value <= criterion[1]
|
912
914
|
|
913
915
|
if _is_iterable(criterion):
|
914
|
-
criterion = list(criterion)
|
916
|
+
criterion = list(criterion) # pyright: ignore[reportUnknownArgumentType]
|
915
917
|
|
916
918
|
if _is_iterable(value):
|
917
919
|
value = list(value)
|
@@ -193,10 +193,10 @@ class GroupBy[C: Collection[Any], I]:
|
|
193
193
|
else:
|
194
194
|
df = DataFrame(dict(zip(self.by, k, strict=True)) for k in gp)
|
195
195
|
|
196
|
-
columns = []
|
196
|
+
columns: list[Series] = []
|
197
197
|
|
198
198
|
for agg in aggs:
|
199
|
-
values = [[c._get(i, agg, MISSING) for i in c] for c in gp.values()] # noqa: SLF001
|
199
|
+
values = [[c._get(i, agg, MISSING) for i in c] for c in gp.values()] # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
|
200
200
|
columns.append(Series(agg, values))
|
201
201
|
|
202
202
|
for k, v in named_aggs.items():
|
@@ -38,7 +38,7 @@ def get_artifact_dir(run: Run) -> Path:
|
|
38
38
|
The local path to the directory where the artifacts are downloaded.
|
39
39
|
|
40
40
|
"""
|
41
|
-
uri = run.info.artifact_uri
|
41
|
+
uri = run.info.artifact_uri # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType]
|
42
42
|
|
43
43
|
if not isinstance(uri, str):
|
44
44
|
raise NotImplementedError
|
@@ -105,7 +105,7 @@ def main[C](
|
|
105
105
|
dry_run = True
|
106
106
|
sys.argv.remove("--dry-run")
|
107
107
|
|
108
|
-
finished = RunStatus.to_string(RunStatus.FINISHED)
|
108
|
+
finished = RunStatus.to_string(RunStatus.FINISHED) # pyright: ignore[reportUnknownMemberType]
|
109
109
|
|
110
110
|
def decorator(app: Callable[[Run, C], None]) -> Callable[[], None]:
|
111
111
|
ConfigStore.instance().store(config_name, node)
|
@@ -134,11 +134,11 @@ def main[C](
|
|
134
134
|
else:
|
135
135
|
uri = experiment.artifact_location
|
136
136
|
overrides = hc.overrides.task if match_overrides else None
|
137
|
-
run_id = get_run_id(uri, cfg, overrides)
|
137
|
+
run_id = get_run_id(uri, cfg, overrides) # pyright: ignore[reportUnknownArgumentType]
|
138
138
|
|
139
139
|
if run_id and not rerun_finished:
|
140
140
|
run = mlflow.get_run(run_id)
|
141
|
-
if run.info.status == finished:
|
141
|
+
if run.info.status == finished: # pyright: ignore[reportUnknownMemberType]
|
142
142
|
return
|
143
143
|
|
144
144
|
with start_run(run_id=run_id, chdir=chdir) as run:
|
@@ -45,6 +45,8 @@ if TYPE_CHECKING:
|
|
45
45
|
|
46
46
|
from .run_collection import RunCollection
|
47
47
|
|
48
|
+
# pyright: reportUnknownVariableType=false
|
49
|
+
|
48
50
|
|
49
51
|
class Run[C, I = None]:
|
50
52
|
"""Represent an MLflow Run in HydraFlow.
|
@@ -76,7 +78,7 @@ class Run[C, I = None]:
|
|
76
78
|
impl_factory: Callable[[Path], I] | Callable[[Path, C], I] | None = None,
|
77
79
|
) -> None:
|
78
80
|
self.info = RunInfo(run_dir)
|
79
|
-
self.impl_factory = impl_factory or (lambda _: None) #
|
81
|
+
self.impl_factory = impl_factory or (lambda _: None) # pyright: ignore[reportAttributeAccessIssue]
|
80
82
|
|
81
83
|
def __repr__(self) -> str:
|
82
84
|
"""Return a string representation of the Run."""
|
@@ -93,9 +95,9 @@ class Run[C, I = None]:
|
|
93
95
|
"""The configuration instance loaded from the Hydra configuration file."""
|
94
96
|
config_file = self.info.run_dir / "artifacts/.hydra/config.yaml"
|
95
97
|
if config_file.exists():
|
96
|
-
return OmegaConf.load(config_file) #
|
98
|
+
return OmegaConf.load(config_file) # pyright: ignore[reportReturnType]
|
97
99
|
|
98
|
-
return OmegaConf.create() #
|
100
|
+
return OmegaConf.create() # pyright: ignore[reportReturnType]
|
99
101
|
|
100
102
|
@cached_property
|
101
103
|
def impl(self) -> I:
|
@@ -176,13 +178,13 @@ class Run[C, I = None]:
|
|
176
178
|
|
177
179
|
if n_jobs == 0:
|
178
180
|
runs = (cls(Path(r), impl_factory) for r in run_dir)
|
179
|
-
return RunCollection(runs, cls.get)
|
181
|
+
return RunCollection(runs, cls.get)
|
180
182
|
|
181
183
|
from joblib import Parallel, delayed
|
182
184
|
|
183
185
|
parallel = Parallel(backend="threading", n_jobs=n_jobs)
|
184
186
|
runs = parallel(delayed(cls)(Path(r), impl_factory) for r in run_dir)
|
185
|
-
return RunCollection(runs, cls.get) #
|
187
|
+
return RunCollection(runs, cls.get) # pyright: ignore[reportArgumentType]
|
186
188
|
|
187
189
|
@overload
|
188
190
|
def update(
|
@@ -235,7 +237,7 @@ class Run[C, I = None]:
|
|
235
237
|
an iterable.
|
236
238
|
|
237
239
|
"""
|
238
|
-
cfg: DictConfig = self.cfg #
|
240
|
+
cfg: DictConfig = self.cfg # pyright: ignore[reportAssignmentType]
|
239
241
|
|
240
242
|
if isinstance(key, str):
|
241
243
|
key = key.replace("__", ".")
|
@@ -296,7 +298,7 @@ class Run[C, I = None]:
|
|
296
298
|
"""
|
297
299
|
key = key.replace("__", ".")
|
298
300
|
|
299
|
-
value = OmegaConf.select(self.cfg, key, default=MISSING) #
|
301
|
+
value = OmegaConf.select(self.cfg, key, default=MISSING) # pyright: ignore[reportArgumentType]
|
300
302
|
if value is not MISSING:
|
301
303
|
return value
|
302
304
|
|
@@ -377,7 +379,7 @@ class Run[C, I = None]:
|
|
377
379
|
if not isinstance(cfg, dict):
|
378
380
|
raise TypeError("Configuration must be a dictionary")
|
379
381
|
|
380
|
-
standard_dict: dict[str, Any] = {str(k): v for k, v in cfg.items()}
|
382
|
+
standard_dict: dict[str, Any] = {str(k): v for k, v in cfg.items()} # pyright: ignore[reportUnknownArgumentType]
|
381
383
|
|
382
384
|
if flatten:
|
383
385
|
return _flatten_dict(standard_dict)
|
@@ -450,12 +452,12 @@ class Run[C, I = None]:
|
|
450
452
|
|
451
453
|
|
452
454
|
def _flatten_dict(d: dict[str, Any], parent_key: str = "") -> dict[str, Any]:
|
453
|
-
items = []
|
455
|
+
items: list[tuple[str, Any]] = []
|
454
456
|
|
455
457
|
for k, v in d.items():
|
456
458
|
key = f"{parent_key}.{k}" if parent_key else k
|
457
459
|
if isinstance(v, dict):
|
458
|
-
items.extend(_flatten_dict(v, key).items())
|
460
|
+
items.extend(_flatten_dict(v, key).items()) # pyright: ignore[reportUnknownArgumentType]
|
459
461
|
else:
|
460
462
|
items.append((key, v))
|
461
463
|
|
@@ -68,7 +68,7 @@ async def arun(
|
|
68
68
|
) -> int | None:
|
69
69
|
"""Run a command asynchronously."""
|
70
70
|
process = await asyncio.create_subprocess_exec(*args, stdout=PIPE, stderr=PIPE)
|
71
|
-
coros = alog(process.stdout, stdout), alog(process.stderr, stderr) #
|
71
|
+
coros = alog(process.stdout, stdout), alog(process.stderr, stderr) # pyright: ignore[reportArgumentType]
|
72
72
|
await asyncio.gather(*coros)
|
73
73
|
await process.communicate()
|
74
74
|
|
@@ -10,7 +10,7 @@ from omegaconf import DictConfig, OmegaConf
|
|
10
10
|
from .conf import HydraflowConf
|
11
11
|
|
12
12
|
if TYPE_CHECKING:
|
13
|
-
from .
|
13
|
+
from .conf import Job
|
14
14
|
|
15
15
|
|
16
16
|
def find_config_file() -> Path | None:
|
@@ -38,7 +38,7 @@ def load_config() -> HydraflowConf:
|
|
38
38
|
if not isinstance(cfg, DictConfig):
|
39
39
|
return schema
|
40
40
|
|
41
|
-
return OmegaConf.merge(schema, cfg) #
|
41
|
+
return OmegaConf.merge(schema, cfg) # pyright: ignore[reportReturnType]
|
42
42
|
|
43
43
|
|
44
44
|
def get_job(name: str) -> Job:
|
@@ -99,7 +99,7 @@ def merge_args(first: list[str], second: list[str]) -> list[str]:
|
|
99
99
|
list[str]: A merged list of arguments.
|
100
100
|
|
101
101
|
"""
|
102
|
-
merged = {}
|
102
|
+
merged: dict[str, str | None] = {}
|
103
103
|
|
104
104
|
for item in [*first, *second]:
|
105
105
|
if "=" in item:
|
@@ -158,7 +158,7 @@ def submit(
|
|
158
158
|
iterable: Iterable[list[str]],
|
159
159
|
*,
|
160
160
|
dry_run: bool = False,
|
161
|
-
) -> CompletedProcess | tuple[list[str], str]:
|
161
|
+
) -> CompletedProcess[bytes] | tuple[list[str], str]:
|
162
162
|
"""Submit entire job using a shell command."""
|
163
163
|
executable, *args = args
|
164
164
|
if executable == "python" and sys.platform == "win32":
|
@@ -181,7 +181,7 @@ def submit(
|
|
181
181
|
file.unlink(missing_ok=True)
|
182
182
|
|
183
183
|
|
184
|
-
def get_callable(name: str) -> Callable:
|
184
|
+
def get_callable(name: str) -> Callable[[list[str]], Any]:
|
185
185
|
"""Get a callable from a function name."""
|
186
186
|
if "." not in name:
|
187
187
|
msg = f"Invalid function path: {name}."
|
@@ -205,7 +205,7 @@ def _arange(start: float, stop: float, step: float) -> list[float]:
|
|
205
205
|
|
206
206
|
epsilon = min(abs(start), abs(stop)) * 1e-5
|
207
207
|
|
208
|
-
result = []
|
208
|
+
result: list[float] = []
|
209
209
|
current = start
|
210
210
|
|
211
211
|
if step > 0:
|
@@ -412,8 +412,8 @@ def split(arg: str) -> list[str]:
|
|
412
412
|
['(a,b)m', '(1,2:4)k']
|
413
413
|
|
414
414
|
"""
|
415
|
-
result = []
|
416
|
-
current = []
|
415
|
+
result: list[str] = []
|
416
|
+
current: list[str] = []
|
417
417
|
bracket_count = 0
|
418
418
|
paren_count = 0
|
419
419
|
in_single_quote = False
|
@@ -57,12 +57,12 @@ class Progress(Super):
|
|
57
57
|
def _update(parallel: Parallel) -> None:
|
58
58
|
update(self, parallel)
|
59
59
|
|
60
|
-
Parallel.print_progress = _update #
|
60
|
+
Parallel.print_progress = _update # pyright: ignore[reportAttributeAccessIssue]
|
61
61
|
|
62
62
|
def stop(self) -> None:
|
63
63
|
"""Stop the progress display."""
|
64
64
|
if self._print_progress:
|
65
|
-
Parallel.print_progress = self._print_progress #
|
65
|
+
Parallel.print_progress = self._print_progress # pyright: ignore[reportAttributeAccessIssue]
|
66
66
|
|
67
67
|
super().stop()
|
68
68
|
|
@@ -86,5 +86,5 @@ def update(progress: Progress, parallel: Parallel) -> None:
|
|
86
86
|
|
87
87
|
progress.update(task_id, completed=parallel.n_completed_tasks, refresh=True)
|
88
88
|
|
89
|
-
if progress._print_progress: # noqa: SLF001
|
90
|
-
progress._print_progress(parallel) # noqa: SLF001
|
89
|
+
if progress._print_progress: # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
|
90
|
+
progress._print_progress(parallel) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
|
@@ -1,19 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu24.04",
|
3
|
-
"features": {
|
4
|
-
"ghcr.io/devcontainers-contrib/features/starship:1": {}
|
5
|
-
},
|
6
|
-
"customizations": {
|
7
|
-
"vscode": {
|
8
|
-
"extensions": [
|
9
|
-
"charliermarsh.ruff",
|
10
|
-
"fill-labs.dependi",
|
11
|
-
"markis.code-coverage",
|
12
|
-
"ms-python.python",
|
13
|
-
"ms-python.vscode-pylance",
|
14
|
-
"tamasfe.even-better-toml"
|
15
|
-
]
|
16
|
-
}
|
17
|
-
},
|
18
|
-
"postCreateCommand": ".devcontainer/postCreate.sh"
|
19
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"$schema" = 'https://starship.rs/config-schema.json'
|
2
|
-
|
3
|
-
add_newline = true
|
4
|
-
|
5
|
-
[username]
|
6
|
-
disabled = true
|
7
|
-
|
8
|
-
[hostname]
|
9
|
-
disabled = true
|
10
|
-
|
11
|
-
[package]
|
12
|
-
format = '[$symbol$version]($style) '
|
13
|
-
symbol = " "
|
14
|
-
style = 'bold blue'
|
15
|
-
|
16
|
-
[git_branch]
|
17
|
-
format = '[$symbol$branch(:$remote_branch)]($style)'
|
18
|
-
symbol = ' '
|
19
|
-
style = 'bold green'
|
20
|
-
|
21
|
-
[git_status]
|
22
|
-
style = 'red'
|
23
|
-
modified = '*'
|
24
|
-
format = '([$modified]($style)) '
|
25
|
-
|
26
|
-
[python]
|
27
|
-
format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'
|
28
|
-
symbol = ' '
|
29
|
-
style = 'yellow'
|
hydraflow-0.19.0/.gitattributes
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [main]
|
6
|
-
pull_request:
|
7
|
-
|
8
|
-
concurrency:
|
9
|
-
group: test-${{ github.head_ref }}
|
10
|
-
cancel-in-progress: true
|
11
|
-
|
12
|
-
env:
|
13
|
-
PYTHONUNBUFFERED: "1"
|
14
|
-
FORCE_COLOR: "1"
|
15
|
-
|
16
|
-
jobs:
|
17
|
-
ci:
|
18
|
-
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
|
19
|
-
runs-on: ${{ matrix.os }}
|
20
|
-
strategy:
|
21
|
-
fail-fast: false
|
22
|
-
matrix:
|
23
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
24
|
-
python-version: ["3.13"]
|
25
|
-
|
26
|
-
steps:
|
27
|
-
- uses: actions/checkout@v4
|
28
|
-
- name: Set up Python ${{ matrix.python-version }}
|
29
|
-
uses: actions/setup-python@v5
|
30
|
-
with:
|
31
|
-
python-version: ${{ matrix.python-version }}
|
32
|
-
- name: Install uv and ruff
|
33
|
-
run: pip install uv ruff
|
34
|
-
- name: Install the project
|
35
|
-
run: uv sync
|
36
|
-
- name: Ruff check
|
37
|
-
run: ruff check
|
38
|
-
- name: Run test
|
39
|
-
run: uv run pytest -v -n8 --junitxml=junit.xml
|
40
|
-
- name: Upload Codecov Results
|
41
|
-
if: success()
|
42
|
-
uses: codecov/codecov-action@v4
|
43
|
-
with:
|
44
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
45
|
-
file: lcov.info
|
46
|
-
- name: Upload test results to Codecov
|
47
|
-
if: ${{ !cancelled() }}
|
48
|
-
uses: codecov/test-results-action@v1
|
49
|
-
with:
|
50
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
name: Documentation
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [main]
|
6
|
-
tags:
|
7
|
-
- "[0-9]+.[0-9]+.[0-9]+"
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
docs:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
permissions:
|
13
|
-
contents: write
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v4
|
16
|
-
- name: Configure Git Credentials
|
17
|
-
run: |
|
18
|
-
git config user.name github-actions[bot]
|
19
|
-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
20
|
-
- name: Set up Python 3.13
|
21
|
-
uses: actions/setup-python@v5
|
22
|
-
with:
|
23
|
-
python-version: 3.13
|
24
|
-
- name: Install uv
|
25
|
-
run: pip install uv
|
26
|
-
- name: Install the project
|
27
|
-
run: uv sync --group docs
|
28
|
-
- name: Deploy documentation
|
29
|
-
run: uv run mkdocs gh-deploy --force
|