mapFolding 0.2.6__tar.gz → 0.2.7__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.
- {mapfolding-0.2.6 → mapfolding-0.2.7}/PKG-INFO +21 -7
- {mapfolding-0.2.6 → mapfolding-0.2.7}/README.md +1 -1
- {mapfolding-0.2.6 → mapfolding-0.2.7/mapFolding}/mapFolding.egg-info/PKG-INFO +21 -7
- {mapfolding-0.2.6 → mapfolding-0.2.7/mapFolding}/mapFolding.egg-info/SOURCES.txt +6 -17
- {mapfolding-0.2.6 → mapfolding-0.2.7/mapFolding}/mapFolding.egg-info/requires.txt +3 -3
- mapfolding-0.2.7/mapFolding/mapFolding.egg-info/top_level.txt +4 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/someAssemblyRequired/inlineAfunction.py +2 -2
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/someAssemblyRequired/jobsAndTasks.py +3 -4
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/someAssemblyRequired/makeNumbaJob.py +19 -16
- mapfolding-0.2.7/pyproject.toml +75 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/tests/test_other.py +7 -8
- {mapfolding-0.2.6 → mapfolding-0.2.7}/tests/test_tasks.py +7 -8
- mapfolding-0.2.6/mapFolding/__init__.py +0 -12
- mapfolding-0.2.6/mapFolding/babbage.py +0 -35
- mapfolding-0.2.6/mapFolding/beDRY.py +0 -319
- mapfolding-0.2.6/mapFolding/importSelector.py +0 -7
- mapfolding-0.2.6/mapFolding/lovelace.py +0 -213
- mapfolding-0.2.6/mapFolding/oeis.py +0 -323
- mapfolding-0.2.6/mapFolding/startHere.py +0 -50
- mapfolding-0.2.6/mapFolding/theSSOT.py +0 -76
- mapfolding-0.2.6/mapFolding.egg-info/top_level.txt +0 -3
- mapfolding-0.2.6/pyproject.toml +0 -46
- mapfolding-0.2.6/tests/__init__.py +0 -1
- mapfolding-0.2.6/tests/conftest.py +0 -343
- mapfolding-0.2.6/tests/pythons_idiotic_namespace.py +0 -1
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/benchmarks/benchmarking.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7/mapFolding}/mapFolding.egg-info/dependency_links.txt +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7/mapFolding}/mapFolding.egg-info/entry_points.txt +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/flattened.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/hunterNumba.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/irvineJavaPort.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/jax.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/lunnan.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/lunnanNumpy.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/lunnanWhile.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/rotatedEntryPoint.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/reference/total_countPlus1vsPlusN.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/mapFolding/someAssemblyRequired/makeNuitkaSource.py +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/setup.cfg +0 -0
- {mapfolding-0.2.6 → mapfolding-0.2.7}/tests/test_oeis.py +0 -0
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mapFolding
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: Count distinct ways to fold a map (or a strip of stamps)
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
License: CC-BY-NC-4.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/hunterhogan/mapFolding
|
|
8
|
+
Project-URL: Donate, https://www.patreon.com/integrated
|
|
9
|
+
Keywords: A001415,A001416,A001417,A001418,A195646,folding,map folding,OEIS,stamp folding
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Education
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Intended Audience :: Other Audience
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: <3.14,>=3.10
|
|
8
22
|
Description-Content-Type: text/markdown
|
|
9
23
|
Requires-Dist: numba
|
|
10
24
|
Requires-Dist: numpy
|
|
11
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: Z0Z_tools
|
|
12
26
|
Provides-Extra: benchmark
|
|
13
|
-
Requires-Dist: pandas; extra == "benchmark"
|
|
14
|
-
Requires-Dist: jupyter; extra == "benchmark"
|
|
15
27
|
Requires-Dist: ipywidgets; extra == "benchmark"
|
|
28
|
+
Requires-Dist: jupyter; extra == "benchmark"
|
|
29
|
+
Requires-Dist: pandas; extra == "benchmark"
|
|
16
30
|
Requires-Dist: tqdm; extra == "benchmark"
|
|
17
31
|
Provides-Extra: testing
|
|
18
32
|
Requires-Dist: pytest; extra == "testing"
|
|
@@ -40,7 +54,7 @@ The directory [mapFolding/reference](https://github.com/hunterhogan/mapFolding/b
|
|
|
40
54
|
|
|
41
55
|
## Simple, easy usage based on OEIS IDs
|
|
42
56
|
|
|
43
|
-
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_.
|
|
57
|
+
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_ ([BibTex](https://github.com/hunterhogan/mapFolding/blob/main/mapFolding/citations/oeis.bibtex) citation).
|
|
44
58
|
|
|
45
59
|
### Usage: command line
|
|
46
60
|
|
|
@@ -18,7 +18,7 @@ The directory [mapFolding/reference](https://github.com/hunterhogan/mapFolding/b
|
|
|
18
18
|
|
|
19
19
|
## Simple, easy usage based on OEIS IDs
|
|
20
20
|
|
|
21
|
-
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_.
|
|
21
|
+
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_ ([BibTex](https://github.com/hunterhogan/mapFolding/blob/main/mapFolding/citations/oeis.bibtex) citation).
|
|
22
22
|
|
|
23
23
|
### Usage: command line
|
|
24
24
|
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mapFolding
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: Count distinct ways to fold a map (or a strip of stamps)
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
License: CC-BY-NC-4.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/hunterhogan/mapFolding
|
|
8
|
+
Project-URL: Donate, https://www.patreon.com/integrated
|
|
9
|
+
Keywords: A001415,A001416,A001417,A001418,A195646,folding,map folding,OEIS,stamp folding
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Education
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Intended Audience :: Other Audience
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: <3.14,>=3.10
|
|
8
22
|
Description-Content-Type: text/markdown
|
|
9
23
|
Requires-Dist: numba
|
|
10
24
|
Requires-Dist: numpy
|
|
11
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: Z0Z_tools
|
|
12
26
|
Provides-Extra: benchmark
|
|
13
|
-
Requires-Dist: pandas; extra == "benchmark"
|
|
14
|
-
Requires-Dist: jupyter; extra == "benchmark"
|
|
15
27
|
Requires-Dist: ipywidgets; extra == "benchmark"
|
|
28
|
+
Requires-Dist: jupyter; extra == "benchmark"
|
|
29
|
+
Requires-Dist: pandas; extra == "benchmark"
|
|
16
30
|
Requires-Dist: tqdm; extra == "benchmark"
|
|
17
31
|
Provides-Extra: testing
|
|
18
32
|
Requires-Dist: pytest; extra == "testing"
|
|
@@ -40,7 +54,7 @@ The directory [mapFolding/reference](https://github.com/hunterhogan/mapFolding/b
|
|
|
40
54
|
|
|
41
55
|
## Simple, easy usage based on OEIS IDs
|
|
42
56
|
|
|
43
|
-
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_.
|
|
57
|
+
`mapFolding` directly implements some IDs from _The On-Line Encyclopedia of Integer Sequences_ ([BibTex](https://github.com/hunterhogan/mapFolding/blob/main/mapFolding/citations/oeis.bibtex) citation).
|
|
44
58
|
|
|
45
59
|
### Usage: command line
|
|
46
60
|
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
|
-
mapFolding/__init__.py
|
|
4
|
-
mapFolding/babbage.py
|
|
5
|
-
mapFolding/beDRY.py
|
|
6
|
-
mapFolding/importSelector.py
|
|
7
|
-
mapFolding/lovelace.py
|
|
8
|
-
mapFolding/oeis.py
|
|
9
|
-
mapFolding/startHere.py
|
|
10
|
-
mapFolding/theSSOT.py
|
|
11
|
-
mapFolding.egg-info/PKG-INFO
|
|
12
|
-
mapFolding.egg-info/SOURCES.txt
|
|
13
|
-
mapFolding.egg-info/dependency_links.txt
|
|
14
|
-
mapFolding.egg-info/entry_points.txt
|
|
15
|
-
mapFolding.egg-info/requires.txt
|
|
16
|
-
mapFolding.egg-info/top_level.txt
|
|
17
3
|
mapFolding/benchmarks/benchmarking.py
|
|
4
|
+
mapFolding/mapFolding.egg-info/PKG-INFO
|
|
5
|
+
mapFolding/mapFolding.egg-info/SOURCES.txt
|
|
6
|
+
mapFolding/mapFolding.egg-info/dependency_links.txt
|
|
7
|
+
mapFolding/mapFolding.egg-info/entry_points.txt
|
|
8
|
+
mapFolding/mapFolding.egg-info/requires.txt
|
|
9
|
+
mapFolding/mapFolding.egg-info/top_level.txt
|
|
18
10
|
mapFolding/reference/flattened.py
|
|
19
11
|
mapFolding/reference/hunterNumba.py
|
|
20
12
|
mapFolding/reference/irvineJavaPort.py
|
|
@@ -28,9 +20,6 @@ mapFolding/someAssemblyRequired/inlineAfunction.py
|
|
|
28
20
|
mapFolding/someAssemblyRequired/jobsAndTasks.py
|
|
29
21
|
mapFolding/someAssemblyRequired/makeNuitkaSource.py
|
|
30
22
|
mapFolding/someAssemblyRequired/makeNumbaJob.py
|
|
31
|
-
tests/__init__.py
|
|
32
|
-
tests/conftest.py
|
|
33
|
-
tests/pythons_idiotic_namespace.py
|
|
34
23
|
tests/test_oeis.py
|
|
35
24
|
tests/test_other.py
|
|
36
25
|
tests/test_tasks.py
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from mapFolding import indexMy,
|
|
1
|
+
from mapFolding import indexMy, indexTrack
|
|
2
2
|
import ast
|
|
3
3
|
import copy
|
|
4
4
|
import pathlib
|
|
5
5
|
|
|
6
6
|
def getDictionaryEnumValues():
|
|
7
7
|
dictionaryEnumValues = {}
|
|
8
|
-
for enumIndex in [indexMy,
|
|
8
|
+
for enumIndex in [indexMy, indexTrack]:
|
|
9
9
|
for memberName, memberValue in enumIndex._member_map_.items():
|
|
10
10
|
dictionaryEnumValues[f"{enumIndex.__name__}.{memberName}.value"] = memberValue.value
|
|
11
11
|
return dictionaryEnumValues
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from typing import Any, Optional, Sequence, Type
|
|
1
|
+
from typing import Any, Optional, Sequence, Type
|
|
2
2
|
|
|
3
3
|
def Z0Z_makeJob(listDimensions: Sequence[int], **keywordArguments: Optional[Type[Any]]):
|
|
4
4
|
from mapFolding import outfitCountFolds
|
|
5
5
|
stateUniversal = outfitCountFolds(listDimensions, computationDivisions=None, CPUlimit=None, **keywordArguments)
|
|
6
6
|
from mapFolding.someAssemblyRequired.countInitializeNoNumba import countInitialize
|
|
7
|
-
countInitialize(stateUniversal['connectionGraph'], stateUniversal['gapsWhere'], stateUniversal['my'], stateUniversal['
|
|
7
|
+
countInitialize(stateUniversal['connectionGraph'], stateUniversal['gapsWhere'], stateUniversal['my'], stateUniversal['track'])
|
|
8
8
|
from mapFolding import getPathFilenameFoldsTotal
|
|
9
9
|
pathFilenameChopChop = getPathFilenameFoldsTotal(stateUniversal['mapShape'])
|
|
10
10
|
import pathlib
|
|
@@ -35,11 +35,10 @@ def runJob(pathFilename):
|
|
|
35
35
|
gapsWhere: numpy.ndarray = stateJob['gapsWhere']
|
|
36
36
|
my: numpy.ndarray = stateJob['my']
|
|
37
37
|
pathFilenameFoldsTotal: Final[Path] = stateJob['pathFilenameFoldsTotal']
|
|
38
|
-
the: Final[numpy.ndarray] = stateJob['the']
|
|
39
38
|
track: numpy.ndarray = stateJob['track']
|
|
40
39
|
|
|
41
40
|
from mapFolding.someAssemblyRequired.countSequentialNoNumba import countSequential
|
|
42
|
-
countSequential(connectionGraph, foldsSubTotals, gapsWhere, my,
|
|
41
|
+
countSequential(connectionGraph, foldsSubTotals, gapsWhere, my, track)
|
|
43
42
|
|
|
44
43
|
print(foldsSubTotals.sum().item())
|
|
45
44
|
Path(pathFilenameFoldsTotal).parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -16,7 +16,7 @@ import pathlib
|
|
|
16
16
|
import pickle
|
|
17
17
|
import python_minifier
|
|
18
18
|
|
|
19
|
-
listDimensions = [
|
|
19
|
+
listDimensions = [5,5]
|
|
20
20
|
|
|
21
21
|
# NOTE this overwrites files
|
|
22
22
|
Z0Z_inlineMapFolding()
|
|
@@ -38,22 +38,23 @@ def writeModuleWithNumba(listDimensions):
|
|
|
38
38
|
datatypeDefault = 'uint8'
|
|
39
39
|
numpy_dtypeDefault = make_dtype(datatypeDefault)
|
|
40
40
|
numpy_dtypeSmall = numpy_dtypeDefault
|
|
41
|
-
|
|
41
|
+
# forceinline=True might actually be useful
|
|
42
42
|
parametersNumba = f"numba.types.{datatypeLarge}(), \
|
|
43
43
|
cache=True, \
|
|
44
|
+
nopython=True, \
|
|
45
|
+
fastmath=True, \
|
|
46
|
+
forceinline=True, \
|
|
47
|
+
inline='always', \
|
|
48
|
+
looplift=False, \
|
|
49
|
+
_nrt=True, \
|
|
50
|
+
error_model='numpy', \
|
|
51
|
+
parallel=False, \
|
|
52
|
+
boundscheck=False, \
|
|
53
|
+
no_cfunc_wrapper=False, \
|
|
54
|
+
no_cpython_wrapper=False, \
|
|
44
55
|
"
|
|
45
56
|
# no_cfunc_wrapper=True, \
|
|
46
57
|
# no_cpython_wrapper=True, \
|
|
47
|
-
# _nrt=True, \
|
|
48
|
-
# nopython=True, \
|
|
49
|
-
# parallel=False, \
|
|
50
|
-
# boundscheck=False, \
|
|
51
|
-
# error_model='numpy', \
|
|
52
|
-
# fastmath=True, \
|
|
53
|
-
# no_cfunc_wrapper=False, \
|
|
54
|
-
# no_cpython_wrapper=False, \
|
|
55
|
-
# looplift=True, \
|
|
56
|
-
# forceinline=True, \
|
|
57
58
|
|
|
58
59
|
pathFilenameData = Z0Z_makeJob(listDimensions, datatypeDefault=numpy_dtypeDefault, datatypeLarge=numpy_dtypeLarge, datatypeSmall=numpy_dtypeSmall)
|
|
59
60
|
|
|
@@ -74,14 +75,13 @@ cache=True, \
|
|
|
74
75
|
linesDataDynamic = "\n".join([linesDataDynamic
|
|
75
76
|
, ImaIndent + f"foldsTotal = numba.types.{datatypeLarge}(0)"
|
|
76
77
|
, ImaIndent + convertNDArrayToStr(stateJob['my'], 'my')
|
|
77
|
-
, ImaIndent + convertNDArrayToStr(stateJob['
|
|
78
|
+
, ImaIndent + convertNDArrayToStr(stateJob['foldGroups'], 'foldGroups')
|
|
78
79
|
, ImaIndent + convertNDArrayToStr(stateJob['gapsWhere'], 'gapsWhere')
|
|
79
80
|
, ImaIndent + convertNDArrayToStr(stateJob['track'], 'track')
|
|
80
81
|
])
|
|
81
82
|
|
|
82
83
|
linesDataStatic = """"""
|
|
83
84
|
linesDataStatic = "\n".join([linesDataStatic
|
|
84
|
-
, ImaIndent + convertNDArrayToStr(stateJob['the'], 'the')
|
|
85
85
|
, ImaIndent + convertNDArrayToStr(stateJob['connectionGraph'], 'connectionGraph')
|
|
86
86
|
])
|
|
87
87
|
|
|
@@ -106,11 +106,14 @@ cache=True, \
|
|
|
106
106
|
linesLaunch = """"""
|
|
107
107
|
linesLaunch = linesLaunch + f"""
|
|
108
108
|
if __name__ == '__main__':
|
|
109
|
-
|
|
109
|
+
import time
|
|
110
|
+
timeStart = time.perf_counter()
|
|
111
|
+
{identifierCallableLaunch}()
|
|
112
|
+
print(time.perf_counter() - timeStart)"""
|
|
110
113
|
|
|
111
114
|
linesWriteFoldsTotal = """"""
|
|
112
115
|
linesWriteFoldsTotal = "\n".join([linesWriteFoldsTotal
|
|
113
|
-
, " foldsTotal =
|
|
116
|
+
, " foldsTotal = foldGroups[0:-1].sum() * foldGroups[-1]"
|
|
114
117
|
, " print(foldsTotal)"
|
|
115
118
|
, " with numba.objmode():"
|
|
116
119
|
, f" open('{pathFilenameFoldsTotal.as_posix()}', 'w').write(str(foldsTotal))"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
7
|
+
classifiers = [
|
|
8
|
+
"Development Status :: 5 - Production/Stable",
|
|
9
|
+
"Environment :: Console",
|
|
10
|
+
"Intended Audience :: Education",
|
|
11
|
+
"Intended Audience :: End Users/Desktop",
|
|
12
|
+
"Intended Audience :: Other Audience",
|
|
13
|
+
"Intended Audience :: Science/Research",
|
|
14
|
+
"Natural Language :: English",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python",
|
|
17
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
18
|
+
"Typing :: Typed",
|
|
19
|
+
]
|
|
20
|
+
dependencies = ["numba", "numpy", "Z0Z_tools"]
|
|
21
|
+
description = "Count distinct ways to fold a map (or a strip of stamps)"
|
|
22
|
+
keywords = [
|
|
23
|
+
"A001415",
|
|
24
|
+
"A001416",
|
|
25
|
+
"A001417",
|
|
26
|
+
"A001418",
|
|
27
|
+
"A195646",
|
|
28
|
+
"folding",
|
|
29
|
+
"map folding",
|
|
30
|
+
"OEIS",
|
|
31
|
+
"stamp folding",
|
|
32
|
+
]
|
|
33
|
+
license = { text = "CC-BY-NC-4.0" }
|
|
34
|
+
name = "mapFolding"
|
|
35
|
+
optional-dependencies = { benchmark = [
|
|
36
|
+
"ipywidgets",
|
|
37
|
+
"jupyter",
|
|
38
|
+
"pandas",
|
|
39
|
+
"tqdm",
|
|
40
|
+
], testing = [
|
|
41
|
+
"pytest",
|
|
42
|
+
"pytest-cov",
|
|
43
|
+
"pytest-env",
|
|
44
|
+
"pytest-xdist",
|
|
45
|
+
] }
|
|
46
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
47
|
+
requires-python = ">=3.10,<3.14"
|
|
48
|
+
scripts = { getOEISids = "mapFolding.oeis:getOEISids", clearOEIScache = "mapFolding.oeis:clearOEIScache", OEIS_for_n = "mapFolding.oeis:OEIS_for_n" }
|
|
49
|
+
urls = { Homepage = "https://github.com/hunterhogan/mapFolding", Donate = "https://www.patreon.com/integrated" }
|
|
50
|
+
version = "0.2.7"
|
|
51
|
+
|
|
52
|
+
[tool.coverage]
|
|
53
|
+
report = { exclude_lines = [
|
|
54
|
+
"if TYPE_CHECKING:",
|
|
55
|
+
"if __name__ == \"__main__\":",
|
|
56
|
+
"numba.jit_module",
|
|
57
|
+
], ignore_errors = false }
|
|
58
|
+
run = { branch = true, concurrency = [
|
|
59
|
+
"multiprocessing",
|
|
60
|
+
"thread",
|
|
61
|
+
], data_file = "tests/coverage/.coverage", omit = [
|
|
62
|
+
"tests/*",
|
|
63
|
+
"Z0Z_*",
|
|
64
|
+
], parallel = true, source = [
|
|
65
|
+
"mapFolding",
|
|
66
|
+
] }
|
|
67
|
+
xml = { output = "tests/coverage/coverage.xml" }
|
|
68
|
+
|
|
69
|
+
[tool.pytest.ini_options]
|
|
70
|
+
addopts = ["--color=yes", "-n 4"]
|
|
71
|
+
env = ["NUMBA_JIT_COVERAGE=1"]
|
|
72
|
+
testpaths = ["tests"]
|
|
73
|
+
|
|
74
|
+
[tool.setuptools.packages.find]
|
|
75
|
+
where = ["mapFolding"]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pathlib
|
|
2
|
+
from Z0Z_tools import intInnit
|
|
2
3
|
from tests.conftest import *
|
|
3
4
|
from tests.pythons_idiotic_namespace import *
|
|
4
5
|
from typing import List, Optional, Any
|
|
@@ -92,15 +93,13 @@ def test_countFolds_writeFoldsTotal(
|
|
|
92
93
|
# standardComparison(foldsValue, lambda: returned) # Check return value
|
|
93
94
|
standardComparison(str(foldsTotalExpected), lambda: (pathTempTesting / filenameFoldsTotalExpected).read_text()) # Check file content
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
testFunction()
|
|
96
|
+
@pytest.mark.parametrize("nameOfTest,callablePytest", PytestFor_intInnit())
|
|
97
|
+
def testIntInnit(nameOfTest, callablePytest):
|
|
98
|
+
callablePytest()
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
testFunction()
|
|
100
|
+
@pytest.mark.parametrize("nameOfTest,callablePytest", PytestFor_oopsieKwargsie())
|
|
101
|
+
def testOopsieKwargsie(nameOfTest, callablePytest):
|
|
102
|
+
callablePytest()
|
|
104
103
|
|
|
105
104
|
@pytest.mark.parametrize("CPUlimit, expectedLimit", [
|
|
106
105
|
(None, numba.config.NUMBA_DEFAULT_NUM_THREADS), # type: ignore
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .conftest import *
|
|
1
|
+
from tests.conftest import *
|
|
2
2
|
import pytest
|
|
3
3
|
from typing import List, Dict, Tuple
|
|
4
4
|
|
|
@@ -8,14 +8,13 @@ from typing import List, Dict, Tuple
|
|
|
8
8
|
def test_countFolds_computationDivisions(listDimensionsTest_countFolds: List[int], foldsTotalKnown: Dict[Tuple[int, ...], int]) -> None:
|
|
9
9
|
standardComparison(foldsTotalKnown[tuple(listDimensionsTest_countFolds)], countFolds, listDimensionsTest_countFolds, None, 'maximum')
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
testFunction()
|
|
11
|
+
@pytest.mark.parametrize("nameOfTest,callablePytest", PytestFor_defineConcurrencyLimit())
|
|
12
|
+
def testConcurrencyLimit(nameOfTest, callablePytest):
|
|
13
|
+
callablePytest()
|
|
15
14
|
|
|
16
|
-
@pytest.mark.parametrize("CPUlimitParameter", [{"invalid": True}, ["weird"]])
|
|
17
|
-
def test_countFolds_cpuLimitOopsie(listDimensionsTestFunctionality: List[int], CPUlimitParameter: Dict[str, bool] | List[str]) -> None:
|
|
18
|
-
|
|
15
|
+
# @pytest.mark.parametrize("CPUlimitParameter", [{"invalid": True}, ["weird"]])
|
|
16
|
+
# def test_countFolds_cpuLimitOopsie(listDimensionsTestFunctionality: List[int], CPUlimitParameter: Dict[str, bool] | List[str]) -> None:
|
|
17
|
+
# standardComparison((AttributeError or ValueError), countFolds, listDimensionsTestFunctionality, None, 'cpu', CPUlimitParameter)
|
|
19
18
|
|
|
20
19
|
def test_countFolds_invalid_computationDivisions(listDimensionsTestFunctionality: List[int]) -> None:
|
|
21
20
|
standardComparison(ValueError, countFolds, listDimensionsTestFunctionality, None, {"wrong": "value"})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from .theSSOT import *
|
|
2
|
-
from Z0Z_tools import defineConcurrencyLimit, intInnit, oopsieKwargsie
|
|
3
|
-
from .beDRY import getFilenameFoldsTotal, getPathFilenameFoldsTotal, outfitCountFolds, saveFoldsTotal
|
|
4
|
-
from .startHere import countFolds
|
|
5
|
-
from .oeis import oeisIDfor_n, getOEISids, clearOEIScache
|
|
6
|
-
|
|
7
|
-
__all__ = [
|
|
8
|
-
'clearOEIScache',
|
|
9
|
-
'countFolds',
|
|
10
|
-
'getOEISids',
|
|
11
|
-
'oeisIDfor_n',
|
|
12
|
-
]
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from mapFolding.importSelector import countSequential, countParallel, countInitialize
|
|
2
|
-
from mapFolding import indexMy
|
|
3
|
-
from numpy import integer
|
|
4
|
-
from numpy.typing import NDArray
|
|
5
|
-
from typing import Any, Tuple
|
|
6
|
-
import numba
|
|
7
|
-
import numpy
|
|
8
|
-
|
|
9
|
-
@numba.jit(cache=True)
|
|
10
|
-
def _countFolds(connectionGraph: NDArray[integer[Any]], foldGroups: NDArray[integer[Any]], gapsWhere: NDArray[integer[Any]], mapShape: Tuple[int, ...], my: NDArray[integer[Any]], track: NDArray[integer[Any]]):
|
|
11
|
-
"""
|
|
12
|
-
What in tarnation is this stupid module and function?
|
|
13
|
-
|
|
14
|
-
- This function is not in the same module as `countFolds` so that we can delay Numba just-in-time (jit) compilation of this function and the finalization of its settings until we are ready.
|
|
15
|
-
- This function is not in the same module as `countFoldsCompiled`, which is the function that does the hard, so that we can delay `numba.jit` compilation of `countFoldsCompiled`.
|
|
16
|
-
- `countFoldsCompiled` is not merely "jitted", it is super jitted, which makes it too arrogant to talk to plebian Python functions. It will, however, reluctantly talk to basic jitted functions.
|
|
17
|
-
- The function in this module is jitted, so it can talk to `countFoldsCompiled`, and because it isn't so arrogant, it will talk to the low-class `countFolds` with only a few restrictions, such as:
|
|
18
|
-
- No `TypedDict`
|
|
19
|
-
- No Python v 3.13
|
|
20
|
-
- The plebs must clean up their own memory problems
|
|
21
|
-
- No oversized integers
|
|
22
|
-
- No global variables, only global constants
|
|
23
|
-
- They don't except pleb nonlocal variables either
|
|
24
|
-
- Python "class": they are all inferior to a jit
|
|
25
|
-
- No `**kwargs`
|
|
26
|
-
- and just a few dozen-jillion other things.
|
|
27
|
-
|
|
28
|
-
"""
|
|
29
|
-
# print("babbage")
|
|
30
|
-
countInitialize(connectionGraph=connectionGraph, gapsWhere=gapsWhere, my=my, track=track)
|
|
31
|
-
|
|
32
|
-
if my[indexMy.taskDivisions.value] > 0:
|
|
33
|
-
countParallel(connectionGraph=connectionGraph, foldGroups=foldGroups, gapsWherePARALLEL=gapsWhere, myPARALLEL=my, trackPARALLEL=track)
|
|
34
|
-
else:
|
|
35
|
-
countSequential(connectionGraph=connectionGraph, foldGroups=foldGroups, gapsWhere=gapsWhere, my=my, track=track)
|