hydraflow 0.4.2__tar.gz → 0.4.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. {hydraflow-0.4.2 → hydraflow-0.4.4}/PKG-INFO +2 -2
  2. {hydraflow-0.4.2 → hydraflow-0.4.4}/pyproject.toml +2 -2
  3. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/context.py +4 -3
  4. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/run_collection.py +26 -0
  5. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_run_collection.py +14 -0
  6. {hydraflow-0.4.2 → hydraflow-0.4.4}/.devcontainer/devcontainer.json +0 -0
  7. {hydraflow-0.4.2 → hydraflow-0.4.4}/.devcontainer/postCreate.sh +0 -0
  8. {hydraflow-0.4.2 → hydraflow-0.4.4}/.devcontainer/starship.toml +0 -0
  9. {hydraflow-0.4.2 → hydraflow-0.4.4}/.gitattributes +0 -0
  10. {hydraflow-0.4.2 → hydraflow-0.4.4}/.gitignore +0 -0
  11. {hydraflow-0.4.2 → hydraflow-0.4.4}/LICENSE +0 -0
  12. {hydraflow-0.4.2 → hydraflow-0.4.4}/README.md +0 -0
  13. {hydraflow-0.4.2 → hydraflow-0.4.4}/apps/quickstart.py +0 -0
  14. {hydraflow-0.4.2 → hydraflow-0.4.4}/mkdocs.yml +0 -0
  15. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/__init__.py +0 -0
  16. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/asyncio.py +0 -0
  17. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/config.py +0 -0
  18. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/mlflow.py +0 -0
  19. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/param.py +0 -0
  20. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/progress.py +0 -0
  21. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/py.typed +0 -0
  22. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/run_data.py +0 -0
  23. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/run_info.py +0 -0
  24. {hydraflow-0.4.2 → hydraflow-0.4.4}/src/hydraflow/utils.py +0 -0
  25. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/__init__.py +0 -0
  26. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/integ/__init__.py +0 -0
  27. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/integ/app.py +0 -0
  28. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/scripts/__init__.py +0 -0
  29. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/scripts/app.py +0 -0
  30. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/scripts/progress.py +0 -0
  31. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/scripts/watch.py +0 -0
  32. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_app.py +0 -0
  33. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_asyncio.py +0 -0
  34. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_config.py +0 -0
  35. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_context.py +0 -0
  36. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_log_run.py +0 -0
  37. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_mlflow.py +0 -0
  38. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_param.py +0 -0
  39. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_progress.py +0 -0
  40. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_run_data.py +0 -0
  41. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_run_info.py +0 -0
  42. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_version.py +0 -0
  43. {hydraflow-0.4.2 → hydraflow-0.4.4}/tests/test_watch.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hydraflow
3
- Version: 0.4.2
3
+ Version: 0.4.4
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
7
7
  Project-URL: Issues, https://github.com/daizutabi/hydraflow/issues
8
8
  Author-email: daizutabi <daizutabi@gmail.com>
9
- License-Expression: MIT
9
+ License: MIT
10
10
  License-File: LICENSE
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Programming Language :: Python
@@ -4,10 +4,10 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hydraflow"
7
- version = "0.4.2"
7
+ version = "0.4.4"
8
8
  description = "Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments."
9
9
  readme = "README.md"
10
- license = "MIT"
10
+ license = { text = "MIT" }
11
11
  authors = [{ name = "daizutabi", email = "daizutabi@gmail.com" }]
12
12
  classifiers = [
13
13
  "Development Status :: 4 - Beta",
@@ -28,7 +28,7 @@ log = logging.getLogger(__name__)
28
28
 
29
29
  @contextmanager
30
30
  def log_run(
31
- config: object,
31
+ config: object | None,
32
32
  *,
33
33
  synchronous: bool | None = None,
34
34
  ) -> Iterator[None]:
@@ -54,7 +54,8 @@ def log_run(
54
54
  ```
55
55
 
56
56
  """
57
- log_params(config, synchronous=synchronous)
57
+ if config:
58
+ log_params(config, synchronous=synchronous)
58
59
 
59
60
  hc = HydraConfig.get()
60
61
  output_dir = Path(hc.runtime.output_dir)
@@ -139,7 +140,7 @@ def start_run( # noqa: PLR0913
139
140
  description=description,
140
141
  log_system_metrics=log_system_metrics,
141
142
  ) as run,
142
- log_run(config, synchronous=synchronous),
143
+ log_run(config if run_id is None else None, synchronous=synchronous),
143
144
  ):
144
145
  yield run
145
146
 
@@ -98,6 +98,32 @@ class RunCollection:
98
98
  def __bool__(self) -> bool:
99
99
  return bool(self._runs)
100
100
 
101
+ def __add__(self, other: RunCollection) -> RunCollection:
102
+ """Add another `RunCollection` to this one.
103
+
104
+ Args:
105
+ other (RunCollection): The `RunCollection` to add.
106
+
107
+ Returns:
108
+ A new `RunCollection` instance with the runs from both collections.
109
+
110
+ """
111
+ return self.__class__(self._runs + other._runs)
112
+
113
+ def __sub__(self, other: RunCollection) -> RunCollection:
114
+ """Subtract another `RunCollection` from this one.
115
+
116
+ Args:
117
+ other (RunCollection): The `RunCollection` to subtract.
118
+
119
+ Returns:
120
+ A new `RunCollection` instance with the runs that are in this collection
121
+ but not in the other.
122
+
123
+ """
124
+ runs = [run for run in self._runs if run not in other._runs] # noqa: SLF001
125
+ return self.__class__(runs)
126
+
101
127
  @classmethod
102
128
  def from_list(cls, runs: list[Run]) -> RunCollection:
103
129
  """Create a `RunCollection` instance from a list of MLflow `Run` instances."""
@@ -49,6 +49,20 @@ def test_from_list(run_list: list[Run]):
49
49
  assert all(run in rc for run in run_list)
50
50
 
51
51
 
52
+ def test_add(run_list: list[Run]):
53
+ rc1 = RunCollection.from_list(run_list[:3])
54
+ rc2 = RunCollection.from_list(run_list[3:])
55
+ rc = rc1 + rc2
56
+ assert rc._runs == run_list
57
+
58
+
59
+ def test_sub(run_list: list[Run]):
60
+ rc1 = RunCollection.from_list(run_list)
61
+ rc2 = RunCollection.from_list(run_list[3:])
62
+ rc = rc1 - rc2
63
+ assert rc._runs == run_list[:3]
64
+
65
+
52
66
  def test_search_runs_sorted(run_list: list[Run]):
53
67
  assert [run.data.params["p"] for run in run_list] == ["0", "1", "2", "3", "4", "5"]
54
68
 
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