hunterMakesPy 0.10.0__tar.gz → 0.10.1__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.10.0 → huntermakespy-0.10.1}/PKG-INFO +2 -2
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/coping.py +5 -5
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/dataStructures.py +10 -9
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/kitFilesystem.py +4 -9
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/parseParameters.py +5 -4
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/tests/__init__.py +6 -4
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/tests/conftest.py +11 -1
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/tests/conftestAnnex.py +3 -2
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/__init__.py +13 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/arrays.py +85 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/arraysRLE.py +11 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/callables.py +20 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/classes.py +50 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/containers.py +22 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/messages.py +4 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/packages.py +11 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/pyprojects.py +7 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/pythonSource.py +10 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/dataSamples/text.py +10 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_conftestAnnex.py +68 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_coping.py +100 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_dataStructures.py +259 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_kitFilesystem.py +167 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_parseParameters.py +156 -0
- huntermakespy-0.10.1/hunterMakesPy/tests/test_theTypes.py +27 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy.egg-info/PKG-INFO +2 -2
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy.egg-info/SOURCES.txt +13 -1
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy.egg-info/requires.txt +1 -1
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/pyproject.toml +10 -4
- huntermakespy-0.10.0/hunterMakesPy/tests/test_coping.py +0 -52
- huntermakespy-0.10.0/hunterMakesPy/tests/test_dataStructures.py +0 -79
- huntermakespy-0.10.0/hunterMakesPy/tests/test_kitFilesystem.py +0 -83
- huntermakespy-0.10.0/hunterMakesPy/tests/test_parseParameters.py +0 -53
- huntermakespy-0.10.0/hunterMakesPy/tests/test_theTypes.py +0 -15
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/LICENSE +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/README.md +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/__init__.py +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/_theSSOT.py +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/py.typed +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/semiotics.py +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy/theTypes.py +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy.egg-info/dependency_links.txt +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/hunterMakesPy.egg-info/top_level.txt +0 -0
- {huntermakespy-0.10.0 → huntermakespy-0.10.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterMakesPy
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.1
|
|
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
|
|
@@ -25,7 +25,7 @@ Classifier: Typing :: Typed
|
|
|
25
25
|
Requires-Python: >=3.12
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
License-File: LICENSE
|
|
28
|
-
Requires-Dist: Z0Z_tools>=4.
|
|
28
|
+
Requires-Dist: Z0Z_tools>=4.1.1
|
|
29
29
|
Requires-Dist: autoflake
|
|
30
30
|
Requires-Dist: charset_normalizer
|
|
31
31
|
Requires-Dist: isort
|
|
@@ -11,14 +11,14 @@ import tomllib
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
12
12
|
from importlib.machinery import ModuleSpec
|
|
13
13
|
|
|
14
|
-
def
|
|
14
|
+
def _getIdentifierPackagePACKAGING(identifierPackageFALLBACK: str) -> str:
|
|
15
15
|
"""Get package name from pyproject.toml or fallback to provided value."""
|
|
16
16
|
identifierPackage: str = identifierPackageFALLBACK
|
|
17
17
|
with contextlib.suppress(OSError, tomllib.TOMLDecodeError, KeyError):
|
|
18
18
|
identifierPackage = tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8'))['project']['name'] or identifierPackageFALLBACK
|
|
19
19
|
return identifierPackage
|
|
20
20
|
|
|
21
|
-
def
|
|
21
|
+
def _getPathPackageINSTALLING(identifierPackage: str) -> Path:
|
|
22
22
|
"""Return the root directory of the installed package."""
|
|
23
23
|
pathPackage: Path = Path.cwd()
|
|
24
24
|
with contextlib.suppress(ModuleNotFoundError):
|
|
@@ -46,7 +46,7 @@ class PackageSettings:
|
|
|
46
46
|
identifierPackage : str = ''
|
|
47
47
|
Canonical name of the package. An explicit value takes precedence over `pyproject.toml`, then
|
|
48
48
|
`identifierPackageFALLBACK`.
|
|
49
|
-
pathPackage : Path =
|
|
49
|
+
pathPackage : Path = _getPathPackageINSTALLING(identifierPackage)
|
|
50
50
|
Absolute path to the installed package directory. Automatically resolved from
|
|
51
51
|
`identifierPackage` if not provided.
|
|
52
52
|
fileExtension : str = '.py'
|
|
@@ -82,9 +82,9 @@ class PackageSettings:
|
|
|
82
82
|
|
|
83
83
|
def __post_init__(self, identifierPackageFALLBACK: str) -> None:
|
|
84
84
|
"""Initialize computed fields after dataclass initialization."""
|
|
85
|
-
self.identifierPackage = self.identifierPackage or
|
|
85
|
+
self.identifierPackage = self.identifierPackage or _getIdentifierPackagePACKAGING(identifierPackageFALLBACK)
|
|
86
86
|
if self.pathPackage == Path() and self.identifierPackage:
|
|
87
|
-
self.pathPackage =
|
|
87
|
+
self.pathPackage = _getPathPackageINSTALLING(self.identifierPackage)
|
|
88
88
|
|
|
89
89
|
def raiseIfNone[TypeSansNone](expression: TypeSansNone | None, errorMessage: str | None = None) -> TypeSansNone:
|
|
90
90
|
"""Convert the `expression` return annotation from '`cerPytainty | None`' to '`cerPytainty`' because `expression` cannot be `None`; `raise` an `Exception` if you're wrong.
|
|
@@ -29,7 +29,7 @@ import re as regex
|
|
|
29
29
|
import sys
|
|
30
30
|
|
|
31
31
|
if TYPE_CHECKING:
|
|
32
|
-
from collections.abc import Callable, Iterable,
|
|
32
|
+
from collections.abc import Callable, Iterable, Mapping
|
|
33
33
|
from hunterMakesPy import 小于, 文义, 文件
|
|
34
34
|
from numpy import integer
|
|
35
35
|
from numpy.typing import NDArray
|
|
@@ -102,13 +102,14 @@ def autoDecodingRLE(arrayTarget: NDArray[integer[Any]], *, assumeAddSpaces: bool
|
|
|
102
102
|
return [sliceNDArrayToNestedLists(arraySlice[index]) for index in range(arraySlice.shape[axisOfOperation])]
|
|
103
103
|
if arraySlice.ndim == 1:
|
|
104
104
|
arraySliceAsList: list[int | range] = []
|
|
105
|
-
cache_consecutiveGroup_addMe: dict[
|
|
105
|
+
cache_consecutiveGroup_addMe: dict[range, list[int] | list[range]] = {}
|
|
106
106
|
for consecutiveGroup in more_itertools.consecutive_groups(arraySlice.tolist()):
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
ImaSerious: list[int] = list(consecutiveGroup)
|
|
108
|
+
rangeConsecutiveGroup: range = range(ImaSerious[0], ImaSerious[-1] + 1)
|
|
109
|
+
if rangeConsecutiveGroup in cache_consecutiveGroup_addMe:
|
|
110
|
+
addMe = cache_consecutiveGroup_addMe[rangeConsecutiveGroup]
|
|
109
111
|
else:
|
|
110
|
-
|
|
111
|
-
ImaRange: list[range] = [range(ImaSerious[0], ImaSerious[-1] + 1)]
|
|
112
|
+
ImaRange: list[range] = [rangeConsecutiveGroup]
|
|
112
113
|
ImaRangeAsStr: str = removeExtraWhitespace(str(ImaRange)).replace('range(0,', 'range(').replace('range', '*range')
|
|
113
114
|
|
|
114
115
|
option1 = ImaRange
|
|
@@ -127,7 +128,7 @@ def autoDecodingRLE(arrayTarget: NDArray[integer[Any]], *, assumeAddSpaces: bool
|
|
|
127
128
|
else:
|
|
128
129
|
addMe = option2
|
|
129
130
|
|
|
130
|
-
cache_consecutiveGroup_addMe[
|
|
131
|
+
cache_consecutiveGroup_addMe[rangeConsecutiveGroup] = addMe
|
|
131
132
|
|
|
132
133
|
arraySliceAsList += addMe
|
|
133
134
|
|
|
@@ -273,7 +274,7 @@ def stringItUp(*scrapPile: Any) -> list[str]:
|
|
|
273
274
|
drill(broken)
|
|
274
275
|
drill(piece)
|
|
275
276
|
elif isinstance(KitKat, (list, tuple, set, frozenset, range)):
|
|
276
|
-
for kit in KitKat:
|
|
277
|
+
for kit in KitKat:
|
|
277
278
|
drill(kit)
|
|
278
279
|
elif hasattr(KitKat, '__iter__'):
|
|
279
280
|
for kat in KitKat:
|
|
@@ -383,7 +384,7 @@ def updateExtendPolishDictionaryLists(*dictionaryLists: Mapping[文件, Iterable
|
|
|
383
384
|
raise TypeError from error
|
|
384
385
|
|
|
385
386
|
if destroyDuplicates:
|
|
386
|
-
ePluribusUnum = mapValues(compose(list, dict.fromkeys), ePluribusUnum)
|
|
387
|
+
ePluribusUnum = mapValues(compose(list, dict.fromkeys), ePluribusUnum) # ty: ignore[invalid-argument-type]
|
|
387
388
|
if reorderLists:
|
|
388
389
|
#=SIN= `sorted` is broken.
|
|
389
390
|
ePluribusUnum = mapValues(cast('Callable[[list[文义]], list[文义]]', sorted), ePluribusUnum)
|
|
@@ -109,13 +109,6 @@ def importLogicalPath2Identifier(logicalPathModule: identifierDotAttribute, iden
|
|
|
109
109
|
identifierImported : Any
|
|
110
110
|
The attribute retrieved from the imported module.
|
|
111
111
|
|
|
112
|
-
Raises
|
|
113
|
-
------
|
|
114
|
-
ModuleNotFoundError
|
|
115
|
-
Raised when Python cannot find the module named by `logicalPathModule`.
|
|
116
|
-
AttributeError
|
|
117
|
-
Raised when the imported module does not define `identifier`.
|
|
118
|
-
|
|
119
112
|
See Also
|
|
120
113
|
--------
|
|
121
114
|
`importPathFilename2Identifier`
|
|
@@ -166,8 +159,8 @@ def importPathFilename2Identifier(pathFilename: PathLike[Any] | PurePath, identi
|
|
|
166
159
|
Raises
|
|
167
160
|
------
|
|
168
161
|
ImportError
|
|
169
|
-
Raised when Python cannot create a module loader for `pathFilename`, such as when the
|
|
170
|
-
|
|
162
|
+
Raised when Python cannot create a module loader for `pathFilename`, such as when the filename
|
|
163
|
+
suffix is not a Python source suffix like `.py`.
|
|
171
164
|
FileNotFoundError
|
|
172
165
|
Raised when the loader cannot read `pathFilename`.
|
|
173
166
|
AttributeError
|
|
@@ -398,10 +391,12 @@ def writeStringToHere(this: str, pathFilename: PathLike[Any] | PurePath | TextIO
|
|
|
398
391
|
```
|
|
399
392
|
"""
|
|
400
393
|
if isinstance(pathFilename, TextIOBase):
|
|
394
|
+
#pyrefly: ignore[unnecessary-type-conversion] #=SIN= Insurance.
|
|
401
395
|
pathFilename.write(str(this))
|
|
402
396
|
pathFilename.flush()
|
|
403
397
|
else:
|
|
404
398
|
pathFilename = Path(pathFilename)
|
|
405
399
|
makeDirectorySafely(pathFilename)
|
|
400
|
+
#pyrefly: ignore[unnecessary-type-conversion] #=SIN= Insurance.
|
|
406
401
|
pathFilename.write_text(str(this), encoding='utf-8')
|
|
407
402
|
return pathFilename
|
|
@@ -59,7 +59,7 @@ def defineConcurrencyLimit(*, limit: ConcurrencyLimit, cpuTotal: int = multiproc
|
|
|
59
59
|
|
|
60
60
|
Parameters
|
|
61
61
|
----------
|
|
62
|
-
limit : bool | float | int |
|
|
62
|
+
limit : bool | float | int | None
|
|
63
63
|
The worker-count specification. `None`, `False`, or zero select `cpuTotal`; `True` selects
|
|
64
64
|
one worker. Positive counts select workers to use, and negative counts select CPUs to reserve.
|
|
65
65
|
Fractions between negative one and one select proportions to reserve or use, respectively.
|
|
@@ -123,14 +123,15 @@ def defineConcurrencyLimit(*, limit: ConcurrencyLimit, cpuTotal: int = multiproc
|
|
|
123
123
|
elif 0 < limit < 1:
|
|
124
124
|
concurrencyLimit = round(limit * cpuTotal)
|
|
125
125
|
elif -1 < limit < 0:
|
|
126
|
-
concurrencyLimit = cpuTotal - abs(round(limit * cpuTotal))
|
|
126
|
+
concurrencyLimit = (cpuTotal - abs(round(limit * cpuTotal)))
|
|
127
127
|
elif limit <= -1:
|
|
128
128
|
concurrencyLimit = cpuTotal - abs(int(limit))
|
|
129
129
|
|
|
130
130
|
#https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor
|
|
131
131
|
if sys.platform == "win32":
|
|
132
132
|
concurrencyLimit = min(concurrencyLimit, 61)
|
|
133
|
-
|
|
133
|
+
#pyrefly: ignore[unnecessary-type-conversion] #=SIN= Insurance.
|
|
134
|
+
return int(max(concurrencyLimit, 1))
|
|
134
135
|
|
|
135
136
|
def intInnit(listInt_Allegedly: Collection[Any], parameterName: str | None = None, parameterType: type[Any] | None = None) -> list[int]:
|
|
136
137
|
"""Validate and convert input values to a `list` of integers.
|
|
@@ -185,7 +186,7 @@ def intInnit(listInt_Allegedly: Collection[Any], parameterName: str | None = Non
|
|
|
185
186
|
parameterName = parameterName or 'the parameter'
|
|
186
187
|
parameterType = parameterType or list
|
|
187
188
|
|
|
188
|
-
if listInt_Allegedly is None or len(listInt_Allegedly) == 0:
|
|
189
|
+
if listInt_Allegedly is None or len(listInt_Allegedly) == 0:
|
|
189
190
|
message: str = f"I did not receive a value for `{parameterName}`, but I must have it."
|
|
190
191
|
raise ValueError(message)
|
|
191
192
|
|
|
@@ -7,9 +7,12 @@ from hunterMakesPy.tests import assert_array_equal, assertEqualTo
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Test package organization (in hunterMakesPy/tests/):
|
|
10
|
-
- conftest.py: Fixtures: working directories with a given `pyproject.toml
|
|
11
|
-
|
|
12
|
-
-
|
|
10
|
+
- conftest.py: Fixtures: working directories with a given `pyproject.toml`, Python files written from source, and isolated
|
|
11
|
+
copies of samples that a target mutates
|
|
12
|
+
- conftestAnnex.py: Assertion helpers, re-exported here; assertion rewriting is registered before the import, so their plain
|
|
13
|
+
`assert` statements report their operands
|
|
14
|
+
- dataSamples/: Samples whose meaning does not depend on a test, named by content
|
|
15
|
+
- test_conftestAnnex.py: The assertion helpers' messages and strict array comparisons
|
|
13
16
|
- test_coping.py: Package identity and location, and `raiseIfNone`
|
|
14
17
|
- test_dataStructures.py: Run-length encoding, whitespace removal, string extraction, and merging mappings of lists
|
|
15
18
|
- test_kitFilesystem.py: Writing and appending text, writing Python source, creating directories, and importing identifiers
|
|
@@ -20,7 +23,6 @@ from __future__ import annotations
|
|
|
20
23
|
|
|
21
24
|
import pytest
|
|
22
25
|
|
|
23
|
-
# Register assertion rewriting before importing `conftestAnnex`, so its plain `assert` statements report their operands.
|
|
24
26
|
# ruff: ignore[non-empty-init-module]
|
|
25
27
|
pytest.register_assert_rewrite('hunterMakesPy.tests.conftestAnnex')
|
|
26
28
|
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
"""Fixtures that own temporary files
|
|
1
|
+
"""Fixtures that own temporary files, the working directory, and isolated copies of samples that a target mutates."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
from hunterMakesPy.tests.dataSamples.classes import ListGrowsWhenIterated
|
|
4
5
|
from typing import TYPE_CHECKING
|
|
5
6
|
import pytest
|
|
6
7
|
|
|
7
8
|
if TYPE_CHECKING:
|
|
9
|
+
from collections.abc import Collection
|
|
8
10
|
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
@pytest.fixture
|
|
14
|
+
def listInt_Allegedly(request: pytest.FixtureRequest) -> Collection[Any] | int | None:
|
|
15
|
+
"""`request.param`, or, for a `ListGrowsWhenIterated`, a copy that only one test grows."""
|
|
16
|
+
if isinstance(request.param, ListGrowsWhenIterated):
|
|
17
|
+
return request.param.copy()
|
|
18
|
+
return request.param
|
|
9
19
|
|
|
10
20
|
@pytest.fixture
|
|
11
21
|
def pathFilename(request: pytest.FixtureRequest, tmp_path: Path) -> Path:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
"""Assert
|
|
1
|
+
"""Assert that a target's result equals its expected value, and report the call that produced the result.
|
|
2
2
|
|
|
3
3
|
Other packages import these objects from `hunterMakesPy.tests`. Each assertion reports the target function and the
|
|
4
|
-
arguments that produced `actual`, then delegates the comparison to `==`, `pytest.approx`, or `numpy.testing`.
|
|
4
|
+
arguments that produced `actual`, then delegates the comparison to `==`, `pytest.approx`, or `numpy.testing`. The
|
|
5
|
+
helpers for NumPy arrays report shapes and dtypes, never the arrays.
|
|
5
6
|
"""
|
|
6
7
|
from __future__ import annotations
|
|
7
8
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Samples shared by the hunterMakesPy tests, and facts about them, named by what they hold.
|
|
2
|
+
|
|
3
|
+
- arrays.py: Integer arrays named by structure, and a lookup of every integer array by its identifier
|
|
4
|
+
- arraysRLE.py: The `autoDecodingRLE` expressions of the arrays whose expressions are too long to read in a decorator
|
|
5
|
+
- callables.py: Callables named by kind
|
|
6
|
+
- classes.py: Classes whose instances exhibit one unusual behavior
|
|
7
|
+
- containers.py: Built-in containers named by their structure and by the kind of their values
|
|
8
|
+
- messages.py: Messages that a caller supplies to a function that raises
|
|
9
|
+
- packages.py: Package identifiers named by whether the test environment has the package installed
|
|
10
|
+
- pyprojects.py: The text of `pyproject.toml` files
|
|
11
|
+
- pythonSource.py: Python source modules named by the state of their imports
|
|
12
|
+
- text.py: Text named by script and content
|
|
13
|
+
"""
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Integer arrays named by structure: consecutive ranges, repeated values, and multidimensional patterns.
|
|
2
|
+
|
|
3
|
+
A name states the shape of an array with more than one dimension (`array2x3Primes`); `arrayEmpty` and `arrayScalarFibonacci`
|
|
4
|
+
state theirs in words; every other array has one dimension. No consumer may mutate these arrays: every test in a session
|
|
5
|
+
shares each object.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import TYPE_CHECKING
|
|
10
|
+
import numpy
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from numpy.typing import NDArray
|
|
14
|
+
|
|
15
|
+
arrayEmpty: NDArray[numpy.int64] = numpy.array([], dtype=numpy.int64)
|
|
16
|
+
arrayScalarFibonacci: NDArray[numpy.int64] = numpy.array(233)
|
|
17
|
+
|
|
18
|
+
arrayRange: NDArray[numpy.int64] = numpy.arange(50, 60)
|
|
19
|
+
arrayRangeNegative: NDArray[numpy.int64] = numpy.arange(-34, 35)
|
|
20
|
+
arrayRangeRange: NDArray[numpy.int64] = numpy.array([*range(461, 471), *range(479, 487)])
|
|
21
|
+
arrayRangeRepeat: NDArray[numpy.int64] = numpy.array([*range(251, 257), 271, 271, 271])
|
|
22
|
+
arrayRangeRun: NDArray[numpy.int64] = numpy.tile(numpy.arange(-5, 5), 3)
|
|
23
|
+
arrayRangeValue: NDArray[numpy.int64] = numpy.array([*range(91, 97), 101])
|
|
24
|
+
arrayRepeat: NDArray[numpy.int64] = numpy.array([191, 191, 191])
|
|
25
|
+
arrayRepeatRange: NDArray[numpy.int64] = numpy.array([373, 373, 373, *range(383, 389)])
|
|
26
|
+
arrayRepeatRangeValue: NDArray[numpy.int64] = numpy.array([*[401] * 7, *range(409, 415), 421])
|
|
27
|
+
arrayRepeatRepeatValue: NDArray[numpy.int64] = numpy.array([313, 313, 313, 331, 331, 349])
|
|
28
|
+
arrayRunsFibonacci: NDArray[numpy.int64] = numpy.array([3, 3, 3, 3, 8, 8, 13, 13, 13, 13, 13, 21])
|
|
29
|
+
arrayValueRange: NDArray[numpy.int64] = numpy.array([123, *range(71, 81)])
|
|
30
|
+
arrayValueRangeRepeat: NDArray[numpy.int64] = numpy.array([281, *range(291, 297), 307, 307])
|
|
31
|
+
arrayValueRangeRunValue: NDArray[numpy.int64] = numpy.array([97, *range(-5, 5), *range(-5, 5), *range(-5, 5), 97])
|
|
32
|
+
arrayValueRangeValue: NDArray[numpy.int64] = numpy.array([151, *range(163, 171), 181])
|
|
33
|
+
arrayValueRepeat: NDArray[numpy.int64] = numpy.array([211, 223, 223, 223])
|
|
34
|
+
arrayValueRepeatNegative: NDArray[numpy.int64] = numpy.array([5, -3, -3, -3])
|
|
35
|
+
|
|
36
|
+
array2x2x2Primes: NDArray[numpy.int64] = numpy.array([[[541, 547], [557, 563]], [[569, 571], [577, 587]]])
|
|
37
|
+
array2x3Primes: NDArray[numpy.int64] = numpy.array([[491, 499, 503], [509, 521, 523]])
|
|
38
|
+
array2x3x5Range: NDArray[numpy.int64] = numpy.arange(2 * 3 * 5).reshape(2, 3, 5)
|
|
39
|
+
array3x20RangeRun: NDArray[numpy.int64] = numpy.tile(numpy.arange(10), (3, 2))
|
|
40
|
+
array8x8Checkerboard: NDArray[numpy.int32] = (numpy.indices((8, 8)).sum(axis=0) % 2).astype(numpy.int32)
|
|
41
|
+
array10x12Stripes: NDArray[numpy.int64] = numpy.repeat(numpy.arange(10)[:, None] // 2, 12, axis=1)
|
|
42
|
+
array13x9Saddle: NDArray[numpy.int64] = (numpy.arange(13)[:, None] - 6) ** 2 - (numpy.arange(9)[None, :] - 4) ** 2
|
|
43
|
+
array100x100Modular: NDArray[numpy.int64] = ((numpy.arange(100)[:, None] * 13) % 7 + (numpy.arange(100)[None, :] * 17) % 11) % 10
|
|
44
|
+
|
|
45
|
+
edgesMelBands44100Hz: NDArray[numpy.int64] = numpy.array((
|
|
46
|
+
1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 53, 56, 60, 65, 69, 74, 79, 84, 90, 97, 103, 110, 118, 126
|
|
47
|
+
, 135, 145, 155, 165, 177, 189, 203, 217, 232, 248, 265, 284, 304, 325, 348, 372, 398, 426, 455, 487, 521, 558, 597, 638, 683
|
|
48
|
+
, 731, 782, 836, 895, 958, 1025
|
|
49
|
+
))
|
|
50
|
+
"""Bin edges of `librosa.filters.mel(sr=44100, n_fft=2048, n_mels=60)`: mel band 次Band is nonzero from edge 次Band to edge 次Band + 2."""
|
|
51
|
+
|
|
52
|
+
array60x1025MelMask: NDArray[numpy.int32] = (
|
|
53
|
+
(edgesMelBands44100Hz[:-2, None] <= numpy.arange(1025)) & (numpy.arange(1025) < edgesMelBands44100Hz[2:, None])
|
|
54
|
+
).astype(numpy.int32)
|
|
55
|
+
|
|
56
|
+
lookupArraysInteger: dict[str, NDArray[numpy.int32] | NDArray[numpy.int64]] = {
|
|
57
|
+
'array2x2x2Primes': array2x2x2Primes,
|
|
58
|
+
'array2x3Primes': array2x3Primes,
|
|
59
|
+
'array2x3x5Range': array2x3x5Range,
|
|
60
|
+
'array3x20RangeRun': array3x20RangeRun,
|
|
61
|
+
'array8x8Checkerboard': array8x8Checkerboard,
|
|
62
|
+
'array10x12Stripes': array10x12Stripes,
|
|
63
|
+
'array13x9Saddle': array13x9Saddle,
|
|
64
|
+
'array60x1025MelMask': array60x1025MelMask,
|
|
65
|
+
'array100x100Modular': array100x100Modular,
|
|
66
|
+
'arrayEmpty': arrayEmpty,
|
|
67
|
+
'arrayRange': arrayRange,
|
|
68
|
+
'arrayRangeNegative': arrayRangeNegative,
|
|
69
|
+
'arrayRangeRange': arrayRangeRange,
|
|
70
|
+
'arrayRangeRepeat': arrayRangeRepeat,
|
|
71
|
+
'arrayRangeRun': arrayRangeRun,
|
|
72
|
+
'arrayRangeValue': arrayRangeValue,
|
|
73
|
+
'arrayRepeat': arrayRepeat,
|
|
74
|
+
'arrayRepeatRange': arrayRepeatRange,
|
|
75
|
+
'arrayRepeatRangeValue': arrayRepeatRangeValue,
|
|
76
|
+
'arrayRepeatRepeatValue': arrayRepeatRepeatValue,
|
|
77
|
+
'arrayRunsFibonacci': arrayRunsFibonacci,
|
|
78
|
+
'arrayScalarFibonacci': arrayScalarFibonacci,
|
|
79
|
+
'arrayValueRange': arrayValueRange,
|
|
80
|
+
'arrayValueRangeRepeat': arrayValueRangeRepeat,
|
|
81
|
+
'arrayValueRangeRunValue': arrayValueRangeRunValue,
|
|
82
|
+
'arrayValueRangeValue': arrayValueRangeValue,
|
|
83
|
+
'arrayValueRepeat': arrayValueRepeat,
|
|
84
|
+
'arrayValueRepeatNegative': arrayValueRepeatNegative,
|
|
85
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""The `autoDecodingRLE` expressions of the integer arrays in `arrays.py` whose expressions are too long to read in a decorator.
|
|
2
|
+
|
|
3
|
+
Accepted recording: outputs of `autoDecodingRLE`, accepted before this suite was reorganized; `assumeAddSpaces` does not change
|
|
4
|
+
them. The round-trip relation in `test_autoDecodingRLERoundTrip` establishes that each expression decodes to its array.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
rleArray8x8Checkerboard: str = '[[0,1,0,1,0,1,0,1],[1,0,1,0,1,0,1,0],[0,1,0,1,0,1,0,1],[1,0,1,0,1,0,1,0],[0,1,0,1,0,1,0,1],[1,0,1,0,1,0,1,0],[0,1,0,1,0,1,0,1],[1,0,1,0,1,0,1,0]]'
|
|
9
|
+
rleArray13x9Saddle: str = '[[20,27,32,35,36,35,32,27,20],[9,16,21,24,25,24,21,16,9],[0,7,12,15,16,15,12,7,0],[-7,0,5,8,9,8,5,0,-7],[-12,-5,0,3,4,3,0,-5,-12],[-15,-8,-3,0,1,0,-3,-8,-15],[-16,-9,-4,-1,0,-1,-4,-9,-16],[-15,-8,-3,0,1,0,-3,-8,-15],[-12,-5,0,3,4,3,0,-5,-12],[-7,0,5,8,9,8,5,0,-7],[0,7,12,15,16,15,12,7,0],[9,16,21,24,25,24,21,16,9],[20,27,32,35,36,35,32,27,20]]'
|
|
10
|
+
rleArray100x100Modular: str = '[[0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0,6,1,7,2,8,3,9,4,0,5,0],[6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6],[5,1,6,2,7,3,8,4,9,5,0,5,1,6,2,7,3,8,4,9,5,0,5,1,6,2,7,3,8,4,9,5,0,5,1,6,2,7,3,8,4,9,5,0,5,1,6,2,7,3,8,4,9,5,0,5,1,6,2,7,3,8,4,9,5,0,5,1,6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8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6,2,7,3,8,4,9,5,0,6,1,6]]'
|
|
11
|
+
rleArray60x1025MelMask: str = '[[0]+[1]*6+[0]*1018,[0]*4+[1]*6+[0]*1015,[0]*7+[1]*6+[0]*1012,[0]*10+[1]*6+[0]*1009,[0]*13+[1]*6+[0]*1006,[0]*16+[1]*6+[0]*1003,[0]*19+[1]*6+[0]*1000,[0]*22+[1]*6+[0]*997,[0]*25+[1]*6+[0]*994,[0]*28+[1]*6+[0]*991,[0]*31+[1]*6+[0]*988,[0]*34+[1]*6+[0]*985,[0]*37+[1]*6+[0]*982,[0]*40+[1]*6+[0]*979,[0]*43+[1]*6+[0]*976,[0]*46+[1]*7+[0]*972,[0]*49+[1]*7+[0]*969,[0]*53+[1]*7+[0]*965,[0]*56+[1]*9+[0]*960,[0]*60+[1]*9+[0]*956,[0]*65+[1]*9+[0]*951,[0]*69+[1]*10+[0]*946,[0]*74+[1]*10+[0]*941,[0]*79+[1]*11+[0]*935,[0]*84+[1]*13+[0]*928,[0]*90+[1]*13+[0]*922,[0]*97+[1]*13+[0]*915,[0]*103+[1]*15+[0]*907,[0]*110+[1]*16+[0]*899,[0]*118+[1]*17+[0]*890,[0]*126+[1]*19+[0]*880,[0]*135+[1]*20+[0]*870,[0]*145+[1]*20+[0]*860,[0]*155+[1]*22+[0]*848,[0]*165+[1]*24+[0]*836,[0]*177+[1]*26+[0]*822,[0]*189+[1]*28+[0]*808,[0]*203+[1]*29+[0]*793,[0]*217+[1]*31+[0]*777,[0]*232+[1]*33+[0]*760,[0]*248+[1]*36+[0]*741,[0]*265+[1]*39+[0]*721,[0]*284+[1]*41+[0]*700,[0]*304+[1]*44+[0]*677,[0]*325+[1]*47+[0]*653,[0]*348+[1]*50+[0]*627,[0]*372+[1]*54+[0]*599,[0]*398+[1]*57+[0]*570,[0]*426+[1]*61+[0]*538,[0]*455+[1]*66+[0]*504,[0]*487+[1]*71+[0]*467,[0]*521+[1]*76+[0]*428,[0]*558+[1]*80+[0]*387,[0]*597+[1]*86+[0]*342,[0]*638+[1]*93+[0]*294,[0]*683+[1]*99+[0]*243,[0]*731+[1]*105+[0]*189,[0]*782+[1]*113+[0]*130,[0]*836+[1]*122+[0]*67,[0]*895+[1]*130]'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Callables named by kind: functions, a bound method, and callable instances without `__name__`."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from fractions import Fraction
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
import functools
|
|
7
|
+
import math
|
|
8
|
+
import operator
|
|
9
|
+
import textwrap
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from collections.abc import Callable
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
callableItemGetter: operator.itemgetter[Any] = operator.itemgetter(2)
|
|
16
|
+
callablePartial: Callable[[int], int] = functools.partial(operator.add, 13)
|
|
17
|
+
functionBuiltin: Callable[..., int] = len
|
|
18
|
+
functionCached: Callable[[int], int] = functools.cache(math.factorial)
|
|
19
|
+
functionPurePython: Callable[[str], str] = textwrap.dedent
|
|
20
|
+
methodBoundPython: Callable[..., Fraction] = Fraction(3, 5).limit_denominator
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Classes whose instances exhibit one unusual behavior, named by that behavior."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from collections import UserList
|
|
5
|
+
from typing import override, TYPE_CHECKING
|
|
6
|
+
import operator
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from collections.abc import Iterator
|
|
10
|
+
|
|
11
|
+
class ListGrowsWhenIterated(UserList[int]):
|
|
12
|
+
"""Append 89 each time iteration begins, so the length changes during iteration.
|
|
13
|
+
|
|
14
|
+
An instance in a shared parameter grows with every consumer; every length still changes during iteration.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
@override
|
|
18
|
+
def __iter__(self) -> Iterator[int]:
|
|
19
|
+
self.append(89)
|
|
20
|
+
return super().__iter__()
|
|
21
|
+
|
|
22
|
+
class StrReturnsNone:
|
|
23
|
+
"""Return `None` from `__str__`, so `str(instance)` raises `TypeError`."""
|
|
24
|
+
|
|
25
|
+
def __str__(self) -> str:
|
|
26
|
+
return None # ruff: ignore[invalid-str-return-type] # pyrefly: ignore[bad-return] # ty: ignore[invalid-explicit-return]
|
|
27
|
+
|
|
28
|
+
class StrReturnsNoneText:
|
|
29
|
+
"""Return the text 'None' from `__str__`, which is text, not the object `None`."""
|
|
30
|
+
|
|
31
|
+
def __str__(self) -> str:
|
|
32
|
+
return 'None'
|
|
33
|
+
|
|
34
|
+
class StrDividesByZero:
|
|
35
|
+
"""Divide by zero in `__str__`, so `str(instance)` raises `ZeroDivisionError`."""
|
|
36
|
+
|
|
37
|
+
def __str__(self) -> str:
|
|
38
|
+
return str(13 // 0) # pyrefly: ignore[division-by-zero]
|
|
39
|
+
|
|
40
|
+
class StrFormatsBadSpecification:
|
|
41
|
+
"""Format the instance with the specification 'NE' in `__str__`, so `str(instance)` raises `TypeError`."""
|
|
42
|
+
|
|
43
|
+
def __str__(self) -> str:
|
|
44
|
+
return format(self, 'NE')
|
|
45
|
+
|
|
46
|
+
class StrReadsAbsentAttribute:
|
|
47
|
+
"""Read the absent attribute `north` in `__str__`, so `str(instance)` raises `AttributeError`."""
|
|
48
|
+
|
|
49
|
+
def __str__(self) -> str:
|
|
50
|
+
return operator.attrgetter('north')(self)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Built-in containers named by their structure and by the kind of their values.
|
|
2
|
+
|
|
3
|
+
No consumer may mutate these containers: every test in a session shares each object.
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
listContainsItself: list[Any] = []
|
|
10
|
+
listContainsItself.append(listContainsItself)
|
|
11
|
+
|
|
12
|
+
lookupPrimesFewer: dict[str, list[int]] = {'NE': [11, 13], 'SW': [17]}
|
|
13
|
+
lookupPrimesMore: dict[str, list[int]] = {'NE': [19, 23, 13, 29, 11], 'SW': [31, 17, 37]}
|
|
14
|
+
|
|
15
|
+
boxOfLookupsIntText: tuple[dict[str, list[int | str]], ...] = ({'NE': [11, 'NE']},)
|
|
16
|
+
boxOfLookupsIntValues: tuple[dict[str, list[int]] | dict[str, int], ...] = (lookupPrimesFewer, {'NE': 23, 'NW': 29})
|
|
17
|
+
boxOfLookupsNested: tuple[dict[str, list[list[int]]], ...] = ({'NE': [[11], [13]]},)
|
|
18
|
+
boxOfLookupsPrimes: tuple[dict[str, list[int]], ...] = (lookupPrimesFewer, lookupPrimesMore)
|
|
19
|
+
boxOfLookupsServers: tuple[dict[str, list[str]], ...] = ({'servers': ['chicago']}, {'servers': ['tokyo', 'chicago']})
|
|
20
|
+
boxOfLookupsSets: tuple[dict[str, set[int]], ...] = ({'NE': {13, 11}}, {'NE': {17, 11}})
|
|
21
|
+
boxOfLookupsText: tuple[dict[str, str], dict[str, dict[str, int]]] = ({'NE': 'NE'}, {'NE': {'SW': 37}})
|
|
22
|
+
boxOfLookupsTupleRange: tuple[dict[str, tuple[int, ...]], dict[str, range]] = ({'NE': (11, 13)}, {'NE': range(17, 20)})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Package identifiers named by whether the test environment has the package installed."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
boxOfIdentifiersPackageAbsent: tuple[str, ...] = ('astToolkit', 'mapFolding')
|
|
5
|
+
|
|
6
|
+
lookupIdentifiersPackageInstalled: dict[str, str] = {
|
|
7
|
+
'fractions': 'fractions',
|
|
8
|
+
'hunterMakesPy': 'hunterMakesPy',
|
|
9
|
+
'hunterMakesPyTests': 'hunterMakesPy.tests',
|
|
10
|
+
'json': 'json',
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""The text of `pyproject.toml` files, named by the state of `project.name`."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
tomlProjectMalformed: str = "[project\nname = 'cobraPy'\n"
|
|
5
|
+
tomlProjectNameEmpty: str = "[project]\nname = ''\n"
|
|
6
|
+
tomlProjectNamed: str = "[project]\nname = 'cobraPy'\nversion = '2.3.5'\n"
|
|
7
|
+
tomlProjectNameless: str = "[project]\nversion = '13.21.34'\n"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Python source modules named by the state of their imports."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
sourceImportsUnsorted: str = (
|
|
5
|
+
"import math\nimport collections\nfrom pathlib import PurePosixPath\n\n"
|
|
6
|
+
"primes = collections.Counter([2, 3, 3, 5])\nnorth = PurePosixPath('north')\ntau = math.tau\n"
|
|
7
|
+
)
|
|
8
|
+
sourceImportsUnused: str = 'import sys\nimport os\nimport math\n\nfibonacci = 13\n'
|
|
9
|
+
sourceImportsUnusedThirdParty: str = 'import numpy\nimport math\n\nfibonacci = 21\n'
|
|
10
|
+
sourceImportsUsed: str = 'import math\n\nprimeGCD = math.gcd(221, 323)\n'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Text named by script and content.
|
|
2
|
+
|
|
3
|
+
No text contains a carriage return: `Path.write_text` translates newlines on Windows, so a carriage return would not survive
|
|
4
|
+
a write-and-read round trip through the platform's text mode.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
textASCIIPrimes: str = '2 3 5 7 11 13 17'
|
|
9
|
+
textEastAsianCities: str = '北京\t東京\t서울'
|
|
10
|
+
textGreekCities: str = 'Αθήνα\nΣπάρτη\nΚόρινθος\n'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Expected values and exceptions come from the docstrings of `hunterMakesPy.tests.conftestAnnex` unless a test's docstring names another basis."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from hunterMakesPy.tests import assert_allclose, assert_array_equal, assertEqualTo, messageTestFailure, messageTestFailure_ndarray
|
|
5
|
+
from hunterMakesPy.tests.dataSamples.arrays import array2x3Primes, arrayRange, arrayRepeat, lookupArraysInteger
|
|
6
|
+
from typing import Any, TYPE_CHECKING
|
|
7
|
+
import numpy
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from numpy.typing import NDArray
|
|
12
|
+
|
|
13
|
+
@pytest.mark.parametrize('actual, expected, function, arguments, keywordArguments, messageExpected', (
|
|
14
|
+
pytest.param([13], [21], 'intInnit', (['NW'],), {}, "intInnit(['NW']) = [13], but expected = [21].", id='intInnit-positional'),
|
|
15
|
+
pytest.param(
|
|
16
|
+
13, 21, 'defineConcurrencyLimit', (), {'limit': 0.5, 'cpuTotal': 13}
|
|
17
|
+
, 'defineConcurrencyLimit(limit=0.5, cpuTotal=13) = 13, but expected = 21.', id='defineConcurrencyLimit-keyword'
|
|
18
|
+
),
|
|
19
|
+
pytest.param('NE', 'SW', 'oopsieKwargsie', (), {}, "oopsieKwargsie() = 'NE', but expected = 'SW'.", id='oopsieKwargsie-none'),
|
|
20
|
+
))
|
|
21
|
+
def test_messageTestFailure(actual: Any, expected: Any, function: str, arguments: tuple[Any, ...], keywordArguments: dict[str, Any], messageExpected: str) -> None:
|
|
22
|
+
"""Accepted recording: the message format, which reads as the call that produced `actual`."""
|
|
23
|
+
assertEqualTo(
|
|
24
|
+
messageTestFailure(actual, expected, function, *arguments, **keywordArguments)
|
|
25
|
+
, messageExpected, messageTestFailure.__name__, actual, expected, function, *arguments, **keywordArguments
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
@pytest.mark.parametrize('actual, expected, messageExpected', (
|
|
29
|
+
pytest.param(
|
|
30
|
+
arrayRange, arrayRange.astype(numpy.float64)
|
|
31
|
+
, "autoDecodingRLE() = actual.shape=(10,), actual.dtype=dtype('int64'), but expected.shape=(10,), expected.dtype=dtype('float64')."
|
|
32
|
+
, id='arrayRange-float64'
|
|
33
|
+
),
|
|
34
|
+
))
|
|
35
|
+
def test_messageTestFailure_ndarray(actual: NDArray[Any], expected: NDArray[Any], messageExpected: str) -> None:
|
|
36
|
+
"""Accepted recording: the message format, which reports shapes and dtypes and never the arrays."""
|
|
37
|
+
assertEqualTo(messageTestFailure_ndarray(actual, expected, 'autoDecodingRLE'), messageExpected, messageTestFailure_ndarray.__name__, actual.shape, expected.shape)
|
|
38
|
+
|
|
39
|
+
@pytest.mark.parametrize('arrayTarget', lookupArraysInteger.values(), ids=lookupArraysInteger.keys())
|
|
40
|
+
def test_assert_array_equal(arrayTarget: NDArray[numpy.integer[Any]]) -> None:
|
|
41
|
+
assert_array_equal(arrayTarget, arrayTarget.copy(), assert_array_equal.__name__)
|
|
42
|
+
|
|
43
|
+
@pytest.mark.parametrize('actual, expected, match', (
|
|
44
|
+
pytest.param(array2x3Primes, array2x3Primes.astype(numpy.float64), 'dtypes .* mismatch', id='array2x3Primes-float64'),
|
|
45
|
+
pytest.param(arrayRepeat, numpy.array(191), 'shapes .* mismatch', id='arrayRepeat-scalar191'),
|
|
46
|
+
pytest.param(arrayRange, arrayRange + 1, 'Mismatched elements', id='arrayRange-arrayRangePlus1'),
|
|
47
|
+
))
|
|
48
|
+
def test_assert_array_equalError(actual: NDArray[Any], expected: NDArray[Any], match: str) -> None:
|
|
49
|
+
"""`numpy.testing` without `strict=True` accepts `array2x3Primes-float64` and `arrayRepeat-scalar191`."""
|
|
50
|
+
with pytest.raises(AssertionError, match=match):
|
|
51
|
+
assert_array_equal(actual, expected, assert_array_equal.__name__)
|
|
52
|
+
|
|
53
|
+
@pytest.mark.parametrize('actual, expected, rtol, atol', (
|
|
54
|
+
pytest.param(numpy.array([numpy.nan, 1.0]), numpy.array([numpy.nan, 1.0]), 1e-7, 0, id='NaN'),
|
|
55
|
+
pytest.param(numpy.array([1.0]), numpy.array([1.0 + 1e-9]), 1e-7, 0, id='withinRelativeTolerance'),
|
|
56
|
+
))
|
|
57
|
+
def test_assert_allclose(actual: NDArray[Any], expected: NDArray[Any], rtol: float, atol: float) -> None:
|
|
58
|
+
assert_allclose(actual, expected, rtol, atol, assert_allclose.__name__)
|
|
59
|
+
|
|
60
|
+
@pytest.mark.parametrize('actual, expected, rtol, atol, match', (
|
|
61
|
+
pytest.param(numpy.arange(3.0, dtype=numpy.float32), numpy.arange(3.0), 1e-7, 0, 'dtypes .* mismatch', id='float32-float64'),
|
|
62
|
+
pytest.param(numpy.full(3, 0.5), numpy.array(0.5), 1e-7, 0, 'shapes .* mismatch', id='full3Half-scalarHalf'),
|
|
63
|
+
pytest.param(numpy.array([1.0]), numpy.array([1.001]), 1e-7, 0, 'Mismatched elements', id='beyondRelativeTolerance'),
|
|
64
|
+
))
|
|
65
|
+
def test_assert_allcloseError(actual: NDArray[Any], expected: NDArray[Any], rtol: float, atol: float, match: str) -> None:
|
|
66
|
+
"""`numpy.testing` without `strict=True` accepts `float32-float64` and `full3Half-scalarHalf`."""
|
|
67
|
+
with pytest.raises(AssertionError, match=match):
|
|
68
|
+
assert_allclose(actual, expected, rtol, atol, assert_allclose.__name__)
|