oh-my-batch 0.5.3__tar.gz → 0.5.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oh-my-batch
3
- Version: 0.5.3
3
+ Version: 0.5.5
4
4
  Summary:
5
5
  License: GPL
6
6
  Author: weihong.xu
@@ -152,6 +152,19 @@ class ComboMaker:
152
152
  raise ValueError(f"Variable {key} not found")
153
153
  return self
154
154
 
155
+ def sort(self, *keys: str, reverse=False):
156
+ """
157
+ Sort variables
158
+ :param keys: Variable names to sort
159
+ :param reverse: If True, sort in descending order, default is False
160
+ """
161
+ for key in keys:
162
+ if key in self._vars:
163
+ self._vars[key].sort(reverse=reverse)
164
+ else:
165
+ raise ValueError(f"Variable {key} not found")
166
+ return self
167
+
155
168
  def set_broadcast(self, *keys: str):
156
169
  """
157
170
  Specify variables use broadcast strategy instead of cartesian product
@@ -93,7 +93,7 @@ class BaseJobManager:
93
93
  if not JobState.is_success(job['state']):
94
94
  logger.error('Job %s failed', job['script'])
95
95
  error = True
96
- if error and not wait:
96
+ if error and wait:
97
97
  raise RuntimeError('Some jobs failed')
98
98
 
99
99
  def wait(self, *job_ids, timeout=None, interval=10):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "oh-my-batch"
3
- version = "0.5.3"
3
+ version = "0.5.5"
4
4
  description = ""
5
5
  authors = ["weihong.xu <xuweihong.cn@gmail.com>"]
6
6
  license = "GPL"
File without changes
File without changes