oh-my-batch 0.4.1__tar.gz → 0.4.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.
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/PKG-INFO +1 -2
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/combo.py +10 -10
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/pyproject.toml +1 -1
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/LICENSE +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/README.md +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/__init__.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/__main__.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/assets/__init__.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/assets/functions.sh +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/batch.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/cli.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/job.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/misc.py +0 -0
- {oh_my_batch-0.4.1 → oh_my_batch-0.4.2}/oh_my_batch/util.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: oh-my-batch
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.2
|
4
4
|
Summary:
|
5
5
|
License: GPL
|
6
6
|
Author: weihong.xu
|
@@ -13,7 +13,6 @@ Classifier: Programming Language :: Python :: 3.9
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
17
16
|
Requires-Dist: fire (>=0.7.0,<0.8.0)
|
18
17
|
Description-Content-Type: text/markdown
|
19
18
|
|
@@ -85,13 +85,13 @@ class ComboMaker:
|
|
85
85
|
self.add_var(key, *args)
|
86
86
|
return self
|
87
87
|
|
88
|
-
def
|
88
|
+
def add_file_set(self, key: str, *path: str, format=None,
|
89
89
|
sep=' ', abs=False, raise_invalid=False):
|
90
90
|
"""
|
91
91
|
Add a variable with files by glob pattern as one string
|
92
92
|
Unlike add_files, this function joins the files with a delimiter.
|
93
93
|
For example, suppose there are 1.txt, 2.txt, 3.txt in data directory,
|
94
|
-
then calling
|
94
|
+
then calling add_file_set('DATA_FILE', 'data/*.txt') will add string "data/1.txt data/2.txt data/3.txt"
|
95
95
|
to the variable DATA_FILE.
|
96
96
|
|
97
97
|
:param key: Variable name
|
@@ -144,7 +144,7 @@ class ComboMaker:
|
|
144
144
|
else:
|
145
145
|
raise ValueError(f"Variable {key} not found")
|
146
146
|
return self
|
147
|
-
|
147
|
+
|
148
148
|
def set_broadcast(self, *keys: str):
|
149
149
|
"""
|
150
150
|
Specify variables use broadcast strategy instead of cartesian product
|
@@ -214,17 +214,17 @@ class ComboMaker:
|
|
214
214
|
else:
|
215
215
|
print(out)
|
216
216
|
return self
|
217
|
-
|
217
|
+
|
218
218
|
def run_cmd(self, cmd: str):
|
219
219
|
"""
|
220
220
|
Run command against each combo
|
221
221
|
|
222
|
-
For example,
|
223
|
-
|
222
|
+
For example,
|
223
|
+
|
224
224
|
run_cmd "cp {DATA_FIEL} ./path/to/workdir/{i}/data.txt"
|
225
225
|
|
226
226
|
will copy each file in DATA_FILE to ./path/to/workdir/{i}/data.txt
|
227
|
-
|
227
|
+
|
228
228
|
:param cmd: Command to run, can include format style variables, e.g. {i}, {i:03d}, {TEMP}
|
229
229
|
"""
|
230
230
|
combos = self._make_combos()
|
@@ -246,13 +246,13 @@ class ComboMaker:
|
|
246
246
|
def _make_combos(self):
|
247
247
|
if not self._vars:
|
248
248
|
return self._combos
|
249
|
-
|
249
|
+
|
250
250
|
broadcast_vars = {}
|
251
|
-
|
251
|
+
|
252
252
|
for k in self._broadcast_keys:
|
253
253
|
broadcast_vars[k] = self._vars[k]
|
254
254
|
del self._vars[k]
|
255
|
-
|
255
|
+
|
256
256
|
keys = self._vars.keys()
|
257
257
|
values_list = product(*self._vars.values())
|
258
258
|
|
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
|