hunterMakesPy 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.
@@ -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: # noqa: C901, PLR0915
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]: # noqa: C901
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: # noqa: C901, PLR0912
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: RUF010, T201
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: # noqa: C901, PYI041
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. Accepts `True`/`False`, an integer count, or a fraction of total CPUs. Positive and
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
- If you want to be extra nice to your users, consider using `hunterMakesPy.oopsieKwargsie()` to handle malformed inputs. For
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
- Examples
108
- --------
109
- Example parameters:
110
- CPUlimit: bool | float | int | None
111
- CPUlimit: bool | float | int | None = None
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
- ```python
112
+ Example docstring
113
+ -----------------
114
+ ```python
115
115
 
116
- Arguments:
117
- CPUlimit: bool | float | int | None
118
- whether and how to limit the CPU usage. See notes for details.
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
- Limits on CPU usage `CPUlimit`:
121
- - `False`, `None`, or `0`: No limits on CPU usage; uses all available CPUs. All other values will potentially limit CPU usage.
122
- - `True`: Yes, limit the CPU usage; limits to 1 CPU.
123
- - Integer `>= 1`: Limits usage to the specified number of CPUs.
124
- - Decimal value (`float`) between 0 and 1: Fraction of total CPUs to use.
125
- - Decimal value (`float`) between -1 and 0: Fraction of CPUs to *not* use.
126
- - Integer `<= -1`: Subtract the absolute value from total CPUs.
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]: # noqa: C901, PLR0912, PLR0915
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.1
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
- [![CC-BY-NC-4.0](https://github.com/hunterhogan/hunterMakesPy/blob/main/CC-BY-NC-4.0.svg)](https://creativecommons.org/licenses/by-nc/4.0/)
177
+ [![CC-BY-NC-4.0](https://github.com/hunterhogan/hunterMakesPy/blob/main/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
@@ -1,9 +1,9 @@
1
1
  hunterMakesPy/__init__.py,sha256=bVF1F2Mdo5AOiioEfxKvNrnsa3vCFI16eMK7Oy5O5TU,1450
2
2
  hunterMakesPy/_theSSOT.py,sha256=lkLOG3oTIWNKD_ULX55chlUGNqCHgqVIrBvolvK1vbQ,153
3
3
  hunterMakesPy/coping.py,sha256=covqNFAwkF9gjafrlAvMdtCO8haFsESQBhO-7s68qSg,5581
4
- hunterMakesPy/dataStructures.py,sha256=CFyGjmAOoN2MoEPwWwWdwKNXmOXX8kCS3ttMOa2Rsx0,11379
4
+ hunterMakesPy/dataStructures.py,sha256=Ur2Z4Pytb1Lc5ov8Ag_xm3eii16nJR_yMZzBhbS8vpI,11311
5
5
  hunterMakesPy/filesystemToolkit.py,sha256=jd7H5UtrIrPiCYWcvNBNa6DAy-2Ewcf21-jbGXg_IVI,4702
6
- hunterMakesPy/parseParameters.py,sha256=DXpyATx7trGBg_8jlO5dXGfLcG8vg_lU3R1sq1rRFOQ,11644
6
+ hunterMakesPy/parseParameters.py,sha256=1mwGNVIZ1x23k_di3lhOhQb8QMXMUCHgt7xw3NRzDXs,11814
7
7
  hunterMakesPy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  hunterMakesPy/pytestForYourUse.py,sha256=GiN1C1gTTM0ZunRPEMnrKlLQLMdH0wF_ZGr_RPgRjjA,500
9
9
  hunterMakesPy/theTypes.py,sha256=C2d0uLn1VIx6_2CK41it3IP7iplSQqe51tzWc-RT320,306
@@ -13,8 +13,8 @@ hunterMakesPy/tests/test_coping.py,sha256=mH89TUAL6fJanBLlhdVlCNNQqm5OpdcQMP_p5W
13
13
  hunterMakesPy/tests/test_dataStructures.py,sha256=O4aqzSKg7KfWWVhIewOH0Y8Zj28PbFCb4XX3xhwuFQA,16605
14
14
  hunterMakesPy/tests/test_filesystemToolkit.py,sha256=q2voXjCbQPIT8l8VF9iuWX1Bs2ZieABItWoVkITj_fo,8841
15
15
  hunterMakesPy/tests/test_parseParameters.py,sha256=80npsoWcCackjxvoW2dMXMpHeale7fuRXyXp78MibLs,14037
16
- huntermakespy-0.2.1.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
17
- huntermakespy-0.2.1.dist-info/METADATA,sha256=U7mdPv2TiV-JgdBigReM9zxA1N9uZ0Nb93fmASS1-bk,6501
18
- huntermakespy-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- huntermakespy-0.2.1.dist-info/top_level.txt,sha256=Uh4bj8EDTdsRpqY1VlK_his_B4HDfZ6Tqrwhoj75P_w,14
20
- huntermakespy-0.2.1.dist-info/RECORD,,
16
+ huntermakespy-0.2.2.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
17
+ huntermakespy-0.2.2.dist-info/METADATA,sha256=s4xUkaMaL_EEx5S0V5YZdV4qyl_ql6dx1Ozgvhf6kRA,6547
18
+ huntermakespy-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ huntermakespy-0.2.2.dist-info/top_level.txt,sha256=Uh4bj8EDTdsRpqY1VlK_his_B4HDfZ6Tqrwhoj75P_w,14
20
+ huntermakespy-0.2.2.dist-info/RECORD,,