oh-my-batch 0.4.3__tar.gz → 0.4.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.
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/PKG-INFO +2 -2
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/combo.py +8 -2
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/pyproject.toml +2 -2
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/LICENSE +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/README.md +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/__init__.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/__main__.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/assets/__init__.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/assets/functions.sh +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/batch.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/cli.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/job.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/oh_my_batch/misc.py +0 -0
- {oh_my_batch-0.4.3 → oh_my_batch-0.4.5}/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.5
|
4
4
|
Summary:
|
5
5
|
License: GPL
|
6
6
|
Author: weihong.xu
|
@@ -13,7 +13,7 @@ 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
|
-
Requires-Dist: fire (>=0.
|
16
|
+
Requires-Dist: fire (>=0.5.0,<0.6.0)
|
17
17
|
Description-Content-Type: text/markdown
|
18
18
|
|
19
19
|
# oh-my-batch
|
@@ -33,7 +33,7 @@ class ComboMaker:
|
|
33
33
|
self.add_var(key, *args)
|
34
34
|
return self
|
35
35
|
|
36
|
-
def add_randint(self, key: str, n: int, a: int, b: int, seed=None):
|
36
|
+
def add_randint(self, key: str, n: int, a: int, b: int, uniq=False, seed=None):
|
37
37
|
"""
|
38
38
|
Add a variable with random integer values
|
39
39
|
|
@@ -41,11 +41,17 @@ class ComboMaker:
|
|
41
41
|
:param n: Number of values
|
42
42
|
:param a: Lower bound
|
43
43
|
:param b: Upper bound
|
44
|
+
:param uniq: If True, values are unique, default is False
|
44
45
|
:param seed: Seed for random number generator
|
45
46
|
"""
|
46
47
|
if seed is not None:
|
47
48
|
random.seed(seed)
|
48
|
-
|
49
|
+
if uniq:
|
50
|
+
if b - a + 1 < n:
|
51
|
+
raise ValueError("Not enough unique values")
|
52
|
+
args = random.sample(range(a, b + 1), n)
|
53
|
+
else:
|
54
|
+
args = [random.randint(a, b) for _ in range(n)]
|
49
55
|
self.add_var(key, *args)
|
50
56
|
return self
|
51
57
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "oh-my-batch"
|
3
|
-
version = "0.4.
|
3
|
+
version = "0.4.5"
|
4
4
|
description = ""
|
5
5
|
authors = ["weihong.xu <xuweihong.cn@gmail.com>"]
|
6
6
|
license = "GPL"
|
@@ -9,7 +9,7 @@ packages = [{include = "oh_my_batch"}]
|
|
9
9
|
|
10
10
|
[tool.poetry.dependencies]
|
11
11
|
python = "^3.8"
|
12
|
-
fire = "^0.
|
12
|
+
fire = "^0.5.0"
|
13
13
|
|
14
14
|
[build-system]
|
15
15
|
requires = ["poetry-core"]
|
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
|