hunterMakesPy 0.2.1__tar.gz → 0.2.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.
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/PKG-INFO +5 -5
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/README.md +1 -1
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/dataStructures.py +4 -4
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/parseParameters.py +28 -24
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy.egg-info/PKG-INFO +5 -5
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/pyproject.toml +2 -2
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/LICENSE +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/__init__.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/_theSSOT.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/coping.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/filesystemToolkit.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/py.typed +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/pytestForYourUse.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/__init__.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/conftest.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/test_coping.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/test_dataStructures.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/test_filesystemToolkit.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/tests/test_parseParameters.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy/theTypes.py +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy.egg-info/SOURCES.txt +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy.egg-info/dependency_links.txt +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy.egg-info/requires.txt +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/hunterMakesPy.egg-info/top_level.txt +0 -0
- {huntermakespy-0.2.1 → huntermakespy-0.2.2}/setup.cfg +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterMakesPy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Easy Python functions making making functional Python functions easier.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
7
7
|
Project-URL: Donate, https://www.patreon.com/integrated
|
|
8
|
-
Project-URL: Homepage, https://github.com/hunterhogan/
|
|
9
|
-
Project-URL: Issues, https://github.com/hunterhogan/
|
|
10
|
-
Project-URL: Repository, https://github.com/hunterhogan/
|
|
8
|
+
Project-URL: Homepage, https://github.com/hunterhogan/hunterMakesPy
|
|
9
|
+
Project-URL: Issues, https://github.com/hunterhogan/hunterMakesPy/issues
|
|
10
|
+
Project-URL: Repository, https://github.com/hunterhogan/hunterMakesPy
|
|
11
11
|
Keywords: attribute loading,concurrency limit,configuration,defensive programming,dictionary merging,directory creation,dynamic import,error propagation,file system utilities,input validation,integer parsing,module loading,nested data structures,package settings,parameter validation,pytest,string extraction,test utilities
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Environment :: Console
|
|
@@ -174,4 +174,4 @@ Coding One Step at a Time:
|
|
|
174
174
|
2. Write good code.
|
|
175
175
|
3. When revising, write better code.
|
|
176
176
|
|
|
177
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -128,4 +128,4 @@ Coding One Step at a Time:
|
|
|
128
128
|
2. Write good code.
|
|
129
129
|
3. When revising, write better code.
|
|
130
130
|
|
|
131
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -11,7 +11,7 @@ import sys
|
|
|
11
11
|
if sys.version_info < (3, 14):
|
|
12
12
|
import python_minifier
|
|
13
13
|
|
|
14
|
-
def autoDecodingRLE(arrayTarget: NDArray[integer[Any]], *, assumeAddSpaces: bool = False) -> str:
|
|
14
|
+
def autoDecodingRLE(arrayTarget: NDArray[integer[Any]], *, assumeAddSpaces: bool = False) -> str:
|
|
15
15
|
"""Transform a NumPy array into a compact, self-decoding run-length encoded string representation.
|
|
16
16
|
|
|
17
17
|
This function converts a NumPy array into a string that, when evaluated as Python code,
|
|
@@ -159,7 +159,7 @@ if sys.version_info < (3, 14):
|
|
|
159
159
|
# Add unpack operator `*` for automatic decoding when evaluated.
|
|
160
160
|
return arrayAsStr.replace('range(0,', 'range(').replace('range', '*range')
|
|
161
161
|
|
|
162
|
-
def stringItUp(*scrapPile: Any) -> list[str]:
|
|
162
|
+
def stringItUp(*scrapPile: Any) -> list[str]:
|
|
163
163
|
"""Convert, if possible, every element in the input data structure to a string.
|
|
164
164
|
|
|
165
165
|
Order is not preserved or readily predictable.
|
|
@@ -178,7 +178,7 @@ def stringItUp(*scrapPile: Any) -> list[str]: # noqa: C901
|
|
|
178
178
|
scrap = None
|
|
179
179
|
listStrungUp: list[str] = []
|
|
180
180
|
|
|
181
|
-
def drill(KitKat: Any) -> None:
|
|
181
|
+
def drill(KitKat: Any) -> None:
|
|
182
182
|
match KitKat:
|
|
183
183
|
case str():
|
|
184
184
|
listStrungUp.append(KitKat)
|
|
@@ -204,7 +204,7 @@ def stringItUp(*scrapPile: Any) -> list[str]: # noqa: C901
|
|
|
204
204
|
except TypeError: # "The error traceback provided indicates that there is an issue when calling the __str__ method on an object that does not have this method properly defined, leading to a TypeError."
|
|
205
205
|
pass
|
|
206
206
|
except:
|
|
207
|
-
print(f"\nWoah! I received '{repr(KitKat)}'.\nTheir report card says, 'Plays well with others: Needs improvement.'\n") # noqa:
|
|
207
|
+
print(f"\nWoah! I received '{repr(KitKat)}'.\nTheir report card says, 'Plays well with others: Needs improvement.'\n") # noqa: T201
|
|
208
208
|
raise
|
|
209
209
|
try:
|
|
210
210
|
for scrap in scrapPile:
|
|
@@ -75,7 +75,7 @@ def _constructErrorMessage(context: ErrorMessageContext, parameterName: str, par
|
|
|
75
75
|
|
|
76
76
|
return "".join(messageParts)
|
|
77
77
|
|
|
78
|
-
def defineConcurrencyLimit(*, limit: bool | float | int | None, cpuTotal: int = multiprocessing.cpu_count()) -> int:
|
|
78
|
+
def defineConcurrencyLimit(*, limit: bool | float | int | None, cpuTotal: int = multiprocessing.cpu_count()) -> int:
|
|
79
79
|
"""Determine the concurrency limit based on the provided parameter.
|
|
80
80
|
|
|
81
81
|
Tests for this function can be run with:
|
|
@@ -84,8 +84,7 @@ def defineConcurrencyLimit(*, limit: bool | float | int | None, cpuTotal: int =
|
|
|
84
84
|
Parameters
|
|
85
85
|
----------
|
|
86
86
|
limit : bool | float | int | None
|
|
87
|
-
Whether and how to limit CPU usage.
|
|
88
|
-
negative values have different behaviors, see code for details.
|
|
87
|
+
Whether and how to limit CPU usage. See notes and examples for details how to describe the options to your users.
|
|
89
88
|
cpuTotal : int = multiprocessing.cpu_count()
|
|
90
89
|
The total number of CPUs available in the system. Default is `multiprocessing.cpu_count()`.
|
|
91
90
|
|
|
@@ -96,35 +95,40 @@ def defineConcurrencyLimit(*, limit: bool | float | int | None, cpuTotal: int =
|
|
|
96
95
|
|
|
97
96
|
Notes
|
|
98
97
|
-----
|
|
99
|
-
|
|
100
|
-
example:
|
|
98
|
+
Consider using `hunterMakesPy.oopsieKwargsie()` to handle malformed inputs. For example:
|
|
101
99
|
|
|
102
100
|
```
|
|
103
101
|
if not (CPUlimit is None or isinstance(CPUlimit, (bool, int, float))):
|
|
104
102
|
CPUlimit = oopsieKwargsie(CPUlimit)
|
|
105
103
|
```
|
|
106
104
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
Example parameters
|
|
106
|
+
------------------
|
|
107
|
+
```python
|
|
108
|
+
CPUlimit: bool | float | int | None
|
|
109
|
+
CPUlimit: bool | float | int | None = None
|
|
110
|
+
```
|
|
112
111
|
|
|
113
|
-
Example docstring
|
|
114
|
-
|
|
112
|
+
Example docstring
|
|
113
|
+
-----------------
|
|
114
|
+
```python
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
Arguments
|
|
117
|
+
---------
|
|
118
|
+
CPUlimit: bool | float | int | None
|
|
119
|
+
Whether and how to limit the the number of available processors used by the function. See notes for details.
|
|
119
120
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
Notes
|
|
122
|
+
-----
|
|
123
|
+
Limits on CPU usage, `CPUlimit`:
|
|
124
|
+
- `False`, `None`, or `0`: No limits on processor usage; uses all available processors. All other values will potentially limit processor usage.
|
|
125
|
+
- `True`: Yes, limit the processor usage; limits to 1 processor.
|
|
126
|
+
- `int >= 1`: The maximum number of available processors to use.
|
|
127
|
+
- `0 < float < 1`: The maximum number of processors to use expressed as a fraction of available processors.
|
|
128
|
+
- `-1 < float < 0`: The number of processors to *not* use expressed as a fraction of available processors.
|
|
129
|
+
- `int <= -1`: The number of available processors to *not* use.
|
|
130
|
+
- If the value of `CPUlimit` is a `float` greater than 1 or less than -1, the function truncates the value to an `int` with the same sign as the `float`.
|
|
131
|
+
```
|
|
128
132
|
|
|
129
133
|
"""
|
|
130
134
|
concurrencyLimit = cpuTotal
|
|
@@ -160,7 +164,7 @@ def defineConcurrencyLimit(*, limit: bool | float | int | None, cpuTotal: int =
|
|
|
160
164
|
return max(int(concurrencyLimit), 1)
|
|
161
165
|
|
|
162
166
|
# ruff: noqa: TRY301
|
|
163
|
-
def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None, parameterType: type[Any] | None = None) -> list[int]:
|
|
167
|
+
def intInnit(listInt_Allegedly: Iterable[Any], parameterName: str | None = None, parameterType: type[Any] | None = None) -> list[int]:
|
|
164
168
|
"""Validate and convert input values to a `list` of integers.
|
|
165
169
|
|
|
166
170
|
Accepts various numeric types and attempts to convert them into integers while providing descriptive error messages. This
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterMakesPy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Easy Python functions making making functional Python functions easier.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License: CC-BY-NC-4.0
|
|
7
7
|
Project-URL: Donate, https://www.patreon.com/integrated
|
|
8
|
-
Project-URL: Homepage, https://github.com/hunterhogan/
|
|
9
|
-
Project-URL: Issues, https://github.com/hunterhogan/
|
|
10
|
-
Project-URL: Repository, https://github.com/hunterhogan/
|
|
8
|
+
Project-URL: Homepage, https://github.com/hunterhogan/hunterMakesPy
|
|
9
|
+
Project-URL: Issues, https://github.com/hunterhogan/hunterMakesPy/issues
|
|
10
|
+
Project-URL: Repository, https://github.com/hunterhogan/hunterMakesPy
|
|
11
11
|
Keywords: attribute loading,concurrency limit,configuration,defensive programming,dictionary merging,directory creation,dynamic import,error propagation,file system utilities,input validation,integer parsing,module loading,nested data structures,package settings,parameter validation,pytest,string extraction,test utilities
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Environment :: Console
|
|
@@ -174,4 +174,4 @@ Coding One Step at a Time:
|
|
|
174
174
|
2. Write good code.
|
|
175
175
|
3. When revising, write better code.
|
|
176
176
|
|
|
177
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "hunterMakesPy"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Easy Python functions making making functional Python functions easier."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -46,7 +46,7 @@ classifiers = [
|
|
|
46
46
|
"Topic :: Utilities",
|
|
47
47
|
"Typing :: Typed",
|
|
48
48
|
]
|
|
49
|
-
urls = { Donate = "https://www.patreon.com/integrated", Homepage = "https://github.com/hunterhogan/", Issues = "https://github.com/hunterhogan/", Repository = "https://github.com/hunterhogan/" }
|
|
49
|
+
urls = { Donate = "https://www.patreon.com/integrated", Homepage = "https://github.com/hunterhogan/hunterMakesPy", Issues = "https://github.com/hunterhogan/hunterMakesPy/issues", Repository = "https://github.com/hunterhogan/hunterMakesPy" }
|
|
50
50
|
dependencies = [
|
|
51
51
|
"charset_normalizer",
|
|
52
52
|
"more_itertools",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|