hunterMakesPy 0.7.1__tar.gz → 0.7.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.
Files changed (27) hide show
  1. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/PKG-INFO +3 -4
  2. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/dataStructures.py +21 -21
  3. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/test_dataStructures.py +0 -1
  4. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/theTypesCallableFunction.py +3 -2
  5. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy.egg-info/PKG-INFO +3 -4
  6. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy.egg-info/requires.txt +1 -0
  7. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/pyproject.toml +4 -11
  8. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/LICENSE +0 -0
  9. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/README.md +0 -0
  10. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/__init__.py +0 -0
  11. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/_theSSOT.py +0 -0
  12. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/coping.py +0 -0
  13. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/filesystemToolkit.py +0 -0
  14. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/parseParameters.py +0 -0
  15. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/py.typed +0 -0
  16. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/semiotics.py +0 -0
  17. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/__init__.py +0 -0
  18. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/conftest.py +0 -0
  19. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/test_coping.py +0 -0
  20. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/test_filesystemToolkit.py +0 -0
  21. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/test_parseParameters.py +0 -0
  22. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/tests/test_theTypes.py +0 -0
  23. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy/theTypes.py +0 -0
  24. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy.egg-info/SOURCES.txt +0 -0
  25. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy.egg-info/dependency_links.txt +0 -0
  26. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/hunterMakesPy.egg-info/top_level.txt +0 -0
  27. {huntermakespy-0.7.1 → huntermakespy-0.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hunterMakesPy
3
- Version: 0.7.1
3
+ Version: 0.7.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-Expression: CC-BY-NC-4.0
@@ -9,13 +9,11 @@ Project-URL: Donate, https://www.patreon.com/integrated
9
9
  Project-URL: Homepage, https://github.com/hunterhogan/hunterMakesPy
10
10
  Project-URL: Issues, https://github.com/hunterhogan/hunterMakesPy/issues
11
11
  Project-URL: Repository, https://github.com/hunterhogan/hunterMakesPy
12
- Keywords: attribute loading,configuration,defensive programming,dictionary merging,dynamic import,file system utilities,input validation,module loading,package settings,parameter validation
12
+ Keywords: input validation,module loading,package settings,parameter validation
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Framework :: Pytest
16
16
  Classifier: Intended Audience :: Developers
17
- Classifier: Intended Audience :: End Users/Desktop
18
- Classifier: Intended Audience :: Other Audience
19
17
  Classifier: Natural Language :: English
20
18
  Classifier: Operating System :: OS Independent
21
19
  Classifier: Programming Language :: Python
@@ -27,6 +25,7 @@ Classifier: Typing :: Typed
27
25
  Requires-Python: >=3.10
28
26
  Description-Content-Type: text/markdown
29
27
  License-File: LICENSE
28
+ Requires-Dist: Z0Z_tools>=2.2.1
30
29
  Requires-Dist: autoflake
31
30
  Requires-Dist: charset_normalizer
32
31
  Requires-Dist: isort
@@ -17,8 +17,11 @@ Functions
17
17
  from __future__ import annotations
18
18
 
19
19
  from charset_normalizer import CharsetMatch
20
+ from collections.abc import Hashable
21
+ from humpy_cytoolz.dicttoolz import valmap
22
+ from humpy_cytoolz.functoolz import compose
20
23
  from types import FunctionType
21
- from typing import cast, TYPE_CHECKING
24
+ from typing import cast, TYPE_CHECKING, TypeVar
22
25
  import charset_normalizer
23
26
  import more_itertools
24
27
  import re as regex
@@ -173,7 +176,7 @@ def autoDecodingRLE(arrayTarget: NDArray[integer[Any]], *, assumeAddSpaces: bool
173
176
  arrayAsStr = patternRegex.sub(replacementByContext, arrayAsStr)
174
177
  arrayAsStr = patternRegex.sub(replacementByContext, arrayAsStr)
175
178
 
176
- # Replace `range(0,stop)` syntax with `range(stop)` syntax.
179
+ # .replace `range(0,stop)` syntax with `range(stop)` syntax.
177
180
  # Add unpack operator `*` for automatic decoding when evaluated.
178
181
  return arrayAsStr.replace('range(0,', 'range(').replace('range', '*range')
179
182
 
@@ -239,14 +242,17 @@ def stringItUp(*scrapPile: Any) -> list[str]:
239
242
  listStrungUp.append(repr(scrap))
240
243
  return listStrungUp
241
244
 
242
- def updateExtendPolishDictionaryLists(*dictionaryLists: Mapping[str, list[小于] | set[小于] | tuple[小于, ...]], destroyDuplicates: bool = False, reorderLists: bool = False, killErroneousDataTypes: bool = False) -> dict[str, list[小于]]:
245
+ 文件 = TypeVar('文件', bound=Hashable)
246
+
247
+ # TODO if `reorderLists: bool = False`, the elements do not need to be ordinals, and they should be covariant.
248
+ def updateExtendPolishDictionaryLists(*dictionaryLists: Mapping[文件, list[小于] | set[小于] | tuple[小于, ...]], destroyDuplicates: bool = False, reorderLists: bool = False, killErroneousDataTypes: bool = False) -> dict[文件, list[小于]]:
243
249
  """Merge multiple dictionaries with `list` values into a single dictionary with the `list` values merged.
244
250
 
245
251
  Plus options to destroy duplicates, sort `list` values, and handle erroneous data types.
246
252
 
247
253
  Parameters
248
254
  ----------
249
- *dictionaryLists : Mapping[str, list[Any] | set[Any] | tuple[Any, ...]]
255
+ *dictionaryLists : MutableMapping[文件, list[Any] | set[Any] | tuple[Any, ...]]
250
256
  Variable number of dictionaries to be merged. If only one dictionary is passed, it will be
251
257
  "polished".
252
258
  destroyDuplicates : bool = False
@@ -260,37 +266,31 @@ def updateExtendPolishDictionaryLists(*dictionaryLists: Mapping[str, list[小于
260
266
 
261
267
  Returns
262
268
  -------
263
- ePluribusUnum : dict[str, list[Any]]
269
+ ePluribusUnum : dict[文件, list[Any]]
264
270
  A single dictionary with merged and optionally "polished" `list` values.
265
271
 
266
272
  Notes
267
273
  -----
268
- The returned value, `ePluribusUnum`, is a so-called primitive dictionary (`dict`). Furthermore,
269
- every dictionary key is a so-called primitive string (_cf._ `str()`) and every dictionary value
270
- is a so-called primitive `list` (`list`). If `dictionaryLists` has other data types, the data
271
- types will not be preserved. That could have unexpected consequences. Conversion from the
272
- original data type to a `list`, for example, may not preserve the order even if you want the
273
- order to be preserved.
274
+ The returned value, `ePluribusUnum`, is a dictionary (`dict`). Furthermore, every dictionary value
275
+ is a `list`. If `dictionaryLists` has values that are not data type `list`, the data type will not
276
+ be preserved. That could have unexpected consequences. Conversion from the original data type to a
277
+ `list`, for example, may not preserve the order even if you want the order to be preserved.
274
278
  """ # noqa: DOC501
275
- ePluribusUnum: dict[str, list[小于]] = {}
279
+ ePluribusUnum: dict[文件, list[小于]] = {}
276
280
 
277
281
  for dictionaryListTarget in dictionaryLists:
278
282
  for keyName, keyValue in dictionaryListTarget.items():
279
283
  try:
280
- ImaStr = str(keyName)
281
284
  ImaList: list[小于] = list(keyValue)
282
- ePluribusUnum.setdefault(ImaStr, []).extend(ImaList)
283
- except TypeError: # noqa: PERF203
285
+ ePluribusUnum.setdefault(keyName, []).extend(ImaList)
286
+ except TypeError as error: # noqa: PERF203
284
287
  if killErroneousDataTypes:
285
288
  continue
286
- else:
287
- raise
289
+ raise TypeError from error
288
290
 
289
291
  if destroyDuplicates:
290
- for ImaStr, ImaList in ePluribusUnum.items():
291
- ePluribusUnum[ImaStr] = list(dict.fromkeys(ImaList))
292
+ ePluribusUnum = valmap(compose(list, dict.fromkeys), ePluribusUnum)
292
293
  if reorderLists:
293
- for ImaStr, ImaRichComparisonSupporter in ePluribusUnum.items():
294
- ePluribusUnum[ImaStr] = sorted(ImaRichComparisonSupporter)
294
+ ePluribusUnum = valmap(sorted, ePluribusUnum)
295
295
 
296
296
  return ePluribusUnum
@@ -108,7 +108,6 @@ def test_stringItUp(description: str, value_scrapPile: list[Any], expected: list
108
108
  ("Set values", ({'ne': {11, 13}, 'sw': {17}}, {'ne': {19, 23, 13, 29, 11}, 'sw': {31, 17, 37}}), {'destroyDuplicates': True, 'reorderLists': True}, {'ne': [11, 13, 19, 23, 29], 'sw': [17, 31, 37]}),
109
109
  ("NumPy arrays", ({'ne': numpy.array([11, 13]), 'sw': numpy.array([17])}, {'ne': numpy.array([19, 23, 13, 29, 11]), 'sw': numpy.array([31, 17, 37])}), {'destroyDuplicates': False, 'reorderLists': False}, {'ne': [11, 13, 19, 23, 13, 29, 11], 'sw': [17, 31, 17, 37]}),
110
110
  ("Destroy duplicates", ({'fr': [11, 13], 'jp': [17]}, {'fr': [19, 23, 13, 29, 11], 'jp': [31, 17, 37]}), {'destroyDuplicates': True, 'reorderLists': False}, {'fr': [11, 13, 19, 23, 29], 'jp': [17, 31, 37]}),
111
- ("Non-string keys", ({None: [13], True: [17]}, {19: [23], (29, 31): [37]}), {'destroyDuplicates': False, 'reorderLists': False}, {'None': [13], 'True': [17], '19': [23], '(29, 31)': [37]}),
112
111
  ("Reorder lists", ({'fr': [11, 13], 'jp': [17]}, {'fr': [19, 23, 13, 29, 11], 'jp': [31, 17, 37]}), {'destroyDuplicates': False, 'reorderLists': True}, {'fr': [11, 11, 13, 13, 19, 23, 29], 'jp': [17, 17, 31, 37]}),
113
112
  ("Non-iterable values", ({'ne': 13, 'sw': 17}, {'ne': 19, 'nw': 23}), {'destroyDuplicates': False, 'reorderLists': False}, TypeError),
114
113
  ("Skip erroneous types", ({'ne': [11, 13], 'sw': [17, 19]}, {'ne': 23, 'nw': 29}), {'killErroneousDataTypes': True}, {'ne': [11, 13], 'sw': [17, 19]}),
@@ -2,12 +2,13 @@
2
2
  from __future__ import annotations
3
3
 
4
4
  from collections.abc import Callable
5
- from typing import Any, overload, ParamSpec, Protocol, runtime_checkable, TYPE_CHECKING, TypeAlias, TypeVar
6
- from typing_extensions import Self, TypeVarTuple
5
+ from typing import Any, overload, ParamSpec, Protocol, runtime_checkable, TYPE_CHECKING, TypeVar
7
6
  import sys
8
7
 
9
8
  if TYPE_CHECKING:
10
9
  from types import CodeType, MethodType
10
+ from typing import TypeAlias
11
+ from typing_extensions import Self, TypeVarTuple
11
12
 
12
13
  # TODO explore the following
13
14
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hunterMakesPy
3
- Version: 0.7.1
3
+ Version: 0.7.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-Expression: CC-BY-NC-4.0
@@ -9,13 +9,11 @@ Project-URL: Donate, https://www.patreon.com/integrated
9
9
  Project-URL: Homepage, https://github.com/hunterhogan/hunterMakesPy
10
10
  Project-URL: Issues, https://github.com/hunterhogan/hunterMakesPy/issues
11
11
  Project-URL: Repository, https://github.com/hunterhogan/hunterMakesPy
12
- Keywords: attribute loading,configuration,defensive programming,dictionary merging,dynamic import,file system utilities,input validation,module loading,package settings,parameter validation
12
+ Keywords: input validation,module loading,package settings,parameter validation
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Framework :: Pytest
16
16
  Classifier: Intended Audience :: Developers
17
- Classifier: Intended Audience :: End Users/Desktop
18
- Classifier: Intended Audience :: Other Audience
19
17
  Classifier: Natural Language :: English
20
18
  Classifier: Operating System :: OS Independent
21
19
  Classifier: Programming Language :: Python
@@ -27,6 +25,7 @@ Classifier: Typing :: Typed
27
25
  Requires-Python: >=3.10
28
26
  Description-Content-Type: text/markdown
29
27
  License-File: LICENSE
28
+ Requires-Dist: Z0Z_tools>=2.2.1
30
29
  Requires-Dist: autoflake
31
30
  Requires-Dist: charset_normalizer
32
31
  Requires-Dist: isort
@@ -1,3 +1,4 @@
1
+ Z0Z_tools>=2.2.1
1
2
  autoflake
2
3
  charset_normalizer
3
4
  isort
@@ -1,18 +1,12 @@
1
1
  [project]
2
2
  name = "hunterMakesPy"
3
- version = "0.7.1"
3
+ version = "0.7.2"
4
4
  description = "Easy Python functions making making functional Python functions easier."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
7
  license = "CC-BY-NC-4.0"
8
8
  authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
9
9
  keywords = [
10
- "attribute loading",
11
- "configuration",
12
- "defensive programming",
13
- "dictionary merging",
14
- "dynamic import",
15
- "file system utilities",
16
10
  "input validation",
17
11
  "module loading",
18
12
  "package settings",
@@ -23,8 +17,6 @@ classifiers = [
23
17
  "Environment :: Console",
24
18
  "Framework :: Pytest",
25
19
  "Intended Audience :: Developers",
26
- "Intended Audience :: End Users/Desktop",
27
- "Intended Audience :: Other Audience",
28
20
  "Natural Language :: English",
29
21
  "Operating System :: OS Independent",
30
22
  "Programming Language :: Python",
@@ -35,6 +27,7 @@ classifiers = [
35
27
  "Typing :: Typed",
36
28
  ]
37
29
  dependencies = [
30
+ "Z0Z_tools>=2.2.1",
38
31
  "autoflake",
39
32
  "charset_normalizer",
40
33
  "isort",
@@ -45,7 +38,7 @@ dependencies = [
45
38
  ]
46
39
  optional-dependencies = { development = ["pytest-cov"], testing = [
47
40
  "librosa",
48
- "pytest",
41
+ "pytest"
49
42
  ] }
50
43
 
51
44
  [project.urls]
@@ -66,7 +59,7 @@ run = { branch = true, data_file = "hunterMakesPy/tests/coverage/.coverage", omi
66
59
  ], source = ["."] }
67
60
 
68
61
  [tool.pytest]
69
- addopts = ["--color=auto"]
62
+ addopts = ["--color=yes"]
70
63
  log_auto_indent = "On"
71
64
  testpaths = ["hunterMakesPy/tests"]
72
65
 
File without changes
File without changes
File without changes