hydraflow 0.2.14__tar.gz → 0.2.15__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {hydraflow-0.2.14 → hydraflow-0.2.15}/PKG-INFO +1 -1
- {hydraflow-0.2.14 → hydraflow-0.2.15}/pyproject.toml +1 -1
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/run_collection.py +17 -1
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_run_collection.py +10 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/.devcontainer/devcontainer.json +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/.devcontainer/postCreate.sh +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/.devcontainer/starship.toml +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/.gitattributes +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/.gitignore +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/LICENSE +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/README.md +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/mkdocs.yml +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/__init__.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/asyncio.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/config.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/context.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/info.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/mlflow.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/src/hydraflow/progress.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/scripts/__init__.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/scripts/app.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/scripts/progress.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/scripts/watch.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_app.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_asyncio.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_config.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_context.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_info.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_log_run.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_mlflow.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_progress.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_version.py +0 -0
- {hydraflow-0.2.14 → hydraflow-0.2.15}/tests/test_watch.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: hydraflow
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.15
|
4
4
|
Summary: Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments.
|
5
5
|
Project-URL: Documentation, https://github.com/daizutabi/hydraflow
|
6
6
|
Project-URL: Source, https://github.com/daizutabi/hydraflow
|
@@ -601,7 +601,13 @@ def _param_matches(run: Run, key: str, value: Any) -> bool:
|
|
601
601
|
return type(value)(param) == value
|
602
602
|
|
603
603
|
|
604
|
-
def filter_runs(
|
604
|
+
def filter_runs(
|
605
|
+
runs: list[Run],
|
606
|
+
config: object | None = None,
|
607
|
+
*,
|
608
|
+
status: str | list[str] | None = None,
|
609
|
+
**kwargs,
|
610
|
+
) -> list[Run]:
|
605
611
|
"""
|
606
612
|
Filter the runs based on the provided configuration.
|
607
613
|
|
@@ -623,6 +629,7 @@ def filter_runs(runs: list[Run], config: object | None = None, **kwargs) -> list
|
|
623
629
|
config (object | None): The configuration object to filter the runs.
|
624
630
|
This can be any object that provides key-value pairs through the
|
625
631
|
`iter_params` function.
|
632
|
+
status (str | list[str] | None): The status of the runs to filter.
|
626
633
|
**kwargs: Additional key-value pairs to filter the runs.
|
627
634
|
|
628
635
|
Returns:
|
@@ -634,6 +641,15 @@ def filter_runs(runs: list[Run], config: object | None = None, **kwargs) -> list
|
|
634
641
|
if len(runs) == 0:
|
635
642
|
return []
|
636
643
|
|
644
|
+
if isinstance(status, str) and status.startswith("!"):
|
645
|
+
status = status[1:].lower()
|
646
|
+
return [run for run in runs if run.info.status.lower() != status]
|
647
|
+
|
648
|
+
if status:
|
649
|
+
status = [status] if isinstance(status, str) else status
|
650
|
+
status = [s.lower() for s in status]
|
651
|
+
return [run for run in runs if run.info.status.lower() in status]
|
652
|
+
|
637
653
|
return runs
|
638
654
|
|
639
655
|
|
@@ -90,6 +90,16 @@ def test_filter_invalid_param(run_list: list[Run]):
|
|
90
90
|
assert len(x) == 6
|
91
91
|
|
92
92
|
|
93
|
+
def test_filter_status(run_list: list[Run]):
|
94
|
+
from hydraflow.run_collection import filter_runs
|
95
|
+
|
96
|
+
assert not filter_runs(run_list, status="RUNNING")
|
97
|
+
assert filter_runs(run_list, status="finished") == run_list
|
98
|
+
assert filter_runs(run_list, status=["finished", "running"]) == run_list
|
99
|
+
assert filter_runs(run_list, status="!RUNNING") == run_list
|
100
|
+
assert not filter_runs(run_list, status="!finished")
|
101
|
+
|
102
|
+
|
93
103
|
def test_get_params(run_list: list[Run]):
|
94
104
|
from hydraflow.run_collection import get_params
|
95
105
|
|
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
|