hydraflow 0.4.2__tar.gz → 0.4.3__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.3}/PKG-INFO +1 -1
  2. {hydraflow-0.4.2 → hydraflow-0.4.3}/pyproject.toml +1 -1
  3. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/run_collection.py +26 -0
  4. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_run_collection.py +14 -0
  5. {hydraflow-0.4.2 → hydraflow-0.4.3}/.devcontainer/devcontainer.json +0 -0
  6. {hydraflow-0.4.2 → hydraflow-0.4.3}/.devcontainer/postCreate.sh +0 -0
  7. {hydraflow-0.4.2 → hydraflow-0.4.3}/.devcontainer/starship.toml +0 -0
  8. {hydraflow-0.4.2 → hydraflow-0.4.3}/.gitattributes +0 -0
  9. {hydraflow-0.4.2 → hydraflow-0.4.3}/.gitignore +0 -0
  10. {hydraflow-0.4.2 → hydraflow-0.4.3}/LICENSE +0 -0
  11. {hydraflow-0.4.2 → hydraflow-0.4.3}/README.md +0 -0
  12. {hydraflow-0.4.2 → hydraflow-0.4.3}/apps/quickstart.py +0 -0
  13. {hydraflow-0.4.2 → hydraflow-0.4.3}/mkdocs.yml +0 -0
  14. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/__init__.py +0 -0
  15. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/asyncio.py +0 -0
  16. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/config.py +0 -0
  17. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/context.py +0 -0
  18. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/mlflow.py +0 -0
  19. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/param.py +0 -0
  20. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/progress.py +0 -0
  21. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/py.typed +0 -0
  22. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/run_data.py +0 -0
  23. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/run_info.py +0 -0
  24. {hydraflow-0.4.2 → hydraflow-0.4.3}/src/hydraflow/utils.py +0 -0
  25. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/__init__.py +0 -0
  26. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/integ/__init__.py +0 -0
  27. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/integ/app.py +0 -0
  28. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/scripts/__init__.py +0 -0
  29. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/scripts/app.py +0 -0
  30. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/scripts/progress.py +0 -0
  31. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/scripts/watch.py +0 -0
  32. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_app.py +0 -0
  33. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_asyncio.py +0 -0
  34. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_config.py +0 -0
  35. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_context.py +0 -0
  36. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_log_run.py +0 -0
  37. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_mlflow.py +0 -0
  38. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_param.py +0 -0
  39. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_progress.py +0 -0
  40. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_run_data.py +0 -0
  41. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_run_info.py +0 -0
  42. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_version.py +0 -0
  43. {hydraflow-0.4.2 → hydraflow-0.4.3}/tests/test_watch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hydraflow
3
- Version: 0.4.2
3
+ Version: 0.4.3
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hydraflow"
7
- version = "0.4.2"
7
+ version = "0.4.3"
8
8
  description = "Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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