mapFolding 0.2.3__py3-none-any.whl → 0.2.5__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.
- mapFolding/__init__.py +1 -1
- mapFolding/babbage.py +9 -4
- mapFolding/beDRY.py +47 -6
- mapFolding/benchmarks/benchmarking.py +3 -2
- mapFolding/importSelector.py +7 -0
- mapFolding/lovelace.py +92 -96
- mapFolding/{JAX/lunnanJAX.py → reference/jax.py} +2 -0
- mapFolding/someAssemblyRequired/inlineAfunction.py +152 -0
- mapFolding/someAssemblyRequired/jobsAndTasks.py +47 -0
- mapFolding/someAssemblyRequired/makeNuitkaSource.py +99 -0
- mapFolding/someAssemblyRequired/makeNumbaJob.py +121 -0
- mapFolding/startHere.py +8 -28
- mapFolding/theSSOT.py +13 -5
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/METADATA +8 -6
- mapFolding-0.2.5.dist-info/RECORD +33 -0
- tests/conftest.py +8 -1
- tests/test_other.py +158 -88
- mapFolding/JAX/taskJAX.py +0 -313
- mapFolding/benchmarks/test_benchmarks.py +0 -74
- mapFolding-0.2.3.dist-info/RECORD +0 -30
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/WHEEL +0 -0
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""NOTE make a special venv for nuitka, then run nuitka from that venv"""
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from pickle import loads
|
|
4
|
+
from typing import Final
|
|
5
|
+
import numpy
|
|
6
|
+
from mapFolding.someAssemblyRequired.jobsAndTasks import Z0Z_makeJob
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
Section: configure every time"""
|
|
10
|
+
|
|
11
|
+
# TODO configure this
|
|
12
|
+
mapShape = [3]*3
|
|
13
|
+
# NOTE ^^^^^^ pay attention
|
|
14
|
+
|
|
15
|
+
"""
|
|
16
|
+
Section: settings"""
|
|
17
|
+
|
|
18
|
+
pathFilenameData = Z0Z_makeJob(mapShape)
|
|
19
|
+
|
|
20
|
+
pathJob = pathFilenameData.parent
|
|
21
|
+
|
|
22
|
+
pathFilenameAlgorithm = Path('/apps/mapFolding/mapFolding/countSequentialNoNumba.py')
|
|
23
|
+
pathFilenameDestination = Path(f"/apps/mapFolding/nn/{pathJob.name}.py")
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
Section: did you handle and include this stuff?"""
|
|
27
|
+
|
|
28
|
+
lineImportNumPy = "import numpy"
|
|
29
|
+
linePrintFoldsTotal = "print(foldsSubTotals.sum().item())"
|
|
30
|
+
linesAlgorithm = """"""
|
|
31
|
+
linesData = """"""
|
|
32
|
+
settingsNuitkaProject=f"""
|
|
33
|
+
# nuitka-project: --mode=onefile
|
|
34
|
+
# nuitka-project: --onefile-no-compression
|
|
35
|
+
# nuitka-project: --lto=yes
|
|
36
|
+
# nuitka-project: --clang
|
|
37
|
+
# nuitka-project: --output-dir={pathJob}
|
|
38
|
+
# nuitka-project: --output-filename={pathJob.name}.exe
|
|
39
|
+
"""
|
|
40
|
+
# nuitka-project:
|
|
41
|
+
"""
|
|
42
|
+
Section: do the work"""
|
|
43
|
+
|
|
44
|
+
WTFamIdoing = pathFilenameAlgorithm.read_text()
|
|
45
|
+
for lineSource in WTFamIdoing.splitlines():
|
|
46
|
+
ImaIndent = ' '
|
|
47
|
+
if lineSource.startswith(ImaIndent):
|
|
48
|
+
lineSource = lineSource[len(ImaIndent):None]
|
|
49
|
+
elif lineSource.startswith('#'):
|
|
50
|
+
continue
|
|
51
|
+
elif not lineSource:
|
|
52
|
+
continue
|
|
53
|
+
elif lineSource.startswith('def '):
|
|
54
|
+
continue
|
|
55
|
+
else:
|
|
56
|
+
raise NotImplementedError("You didn't anticipate this.")
|
|
57
|
+
linesAlgorithm = "\n".join([linesAlgorithm
|
|
58
|
+
, lineSource
|
|
59
|
+
])
|
|
60
|
+
|
|
61
|
+
stateJob = loads(pathFilenameData.read_bytes())
|
|
62
|
+
connectionGraph: Final[numpy.ndarray] = stateJob['connectionGraph']
|
|
63
|
+
foldsSubTotals: numpy.ndarray = stateJob['foldsSubTotals']
|
|
64
|
+
gapsWhere: numpy.ndarray = stateJob['gapsWhere']
|
|
65
|
+
my: numpy.ndarray = stateJob['my']
|
|
66
|
+
the: numpy.ndarray = stateJob['the']
|
|
67
|
+
track: numpy.ndarray = stateJob['track']
|
|
68
|
+
|
|
69
|
+
pathFilenameFoldsTotal = stateJob['pathFilenameFoldsTotal']
|
|
70
|
+
lineDataPathFilenameFoldsTotal = "pathFilenameFoldsTotal = r'" + str(pathFilenameFoldsTotal) + "'\n"
|
|
71
|
+
|
|
72
|
+
def archivistFormatsArrayToCode(arrayTarget: numpy.ndarray, identifierName: str) -> str:
|
|
73
|
+
"""Format numpy array into a code string that recreates the array."""
|
|
74
|
+
arrayAsTypeStr = numpy.array2string(
|
|
75
|
+
arrayTarget,
|
|
76
|
+
threshold=10000,
|
|
77
|
+
max_line_width=100,
|
|
78
|
+
separator=','
|
|
79
|
+
)
|
|
80
|
+
return f"{identifierName} = numpy.array({arrayAsTypeStr}, dtype=numpy.{arrayTarget.dtype})\n"
|
|
81
|
+
|
|
82
|
+
linesData = "\n".join([linesData
|
|
83
|
+
, lineDataPathFilenameFoldsTotal
|
|
84
|
+
, archivistFormatsArrayToCode(the, 'the')
|
|
85
|
+
, archivistFormatsArrayToCode(my, 'my')
|
|
86
|
+
, archivistFormatsArrayToCode(foldsSubTotals, 'foldsSubTotals')
|
|
87
|
+
, archivistFormatsArrayToCode(gapsWhere, 'gapsWhere')
|
|
88
|
+
, archivistFormatsArrayToCode(connectionGraph, 'connectionGraph')
|
|
89
|
+
, archivistFormatsArrayToCode(track, 'track')
|
|
90
|
+
])
|
|
91
|
+
|
|
92
|
+
linesAll = "\n".join([settingsNuitkaProject
|
|
93
|
+
, lineImportNumPy
|
|
94
|
+
, linesData
|
|
95
|
+
, linesAlgorithm
|
|
96
|
+
, linePrintFoldsTotal
|
|
97
|
+
])
|
|
98
|
+
|
|
99
|
+
pathFilenameDestination.write_text(linesAll)
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""Create a python module hardcoded to compute a map's foldsTotal.
|
|
2
|
+
NumPy ndarray.
|
|
3
|
+
Numba optimized.
|
|
4
|
+
Absolutely no other imports.
|
|
5
|
+
"""
|
|
6
|
+
from mapFolding import datatypeLarge, dtypeLarge, dtypeDefault
|
|
7
|
+
from mapFolding.someAssemblyRequired.inlineAfunction import Z0Z_inlineMapFolding
|
|
8
|
+
from mapFolding.someAssemblyRequired.jobsAndTasks import Z0Z_makeJob
|
|
9
|
+
import importlib
|
|
10
|
+
import llvmlite.binding
|
|
11
|
+
import numpy
|
|
12
|
+
import pathlib
|
|
13
|
+
import pickle
|
|
14
|
+
|
|
15
|
+
listDimensions = [3,7]
|
|
16
|
+
|
|
17
|
+
# NOTE this overwrites files
|
|
18
|
+
Z0Z_inlineMapFolding()
|
|
19
|
+
|
|
20
|
+
identifierCallableLaunch = "goGoGadgetAbsurdity"
|
|
21
|
+
|
|
22
|
+
def archivistFormatsArrayToCode(arrayTarget: numpy.ndarray, identifierName: str) -> str:
|
|
23
|
+
"""Format numpy array into a code string that recreates the array."""
|
|
24
|
+
arrayAsTypeStr = numpy.array2string(arrayTarget, threshold=10000, max_line_width=200, separator=',')
|
|
25
|
+
return f"{identifierName} = numpy.array({arrayAsTypeStr}, dtype=numpy.{arrayTarget.dtype})"
|
|
26
|
+
|
|
27
|
+
def writeModuleWithNumba(listDimensions):
|
|
28
|
+
numpy_dtypeLarge = dtypeLarge
|
|
29
|
+
numpy_dtypeDefault = dtypeDefault
|
|
30
|
+
|
|
31
|
+
parametersNumba = f"numba.types.{datatypeLarge}(), cache=True, parallel=False, boundscheck=False, \
|
|
32
|
+
error_model='numpy', fastmath=True, nogil=True, nopython=True, _nrt=True, forceinline=True, \
|
|
33
|
+
inline=True, looplift=True, no_cfunc_wrapper=False, no_cpython_wrapper=False"
|
|
34
|
+
|
|
35
|
+
pathFilenameData = Z0Z_makeJob(listDimensions, datatypeDefault=numpy_dtypeDefault, datatypeLarge=numpy_dtypeLarge)
|
|
36
|
+
|
|
37
|
+
pathFilenameAlgorithm = pathlib.Path('/apps/mapFolding/mapFolding/countSequentialNoNumba.py')
|
|
38
|
+
pathFilenameDestination = pathFilenameData.with_stem(pathFilenameData.parent.name).with_suffix(".py")
|
|
39
|
+
|
|
40
|
+
lineNumba = f"@numba.jit({parametersNumba})"
|
|
41
|
+
|
|
42
|
+
linesImport = "\n".join([
|
|
43
|
+
"import numpy"
|
|
44
|
+
, "import numba"
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
stateJob = pickle.loads(pathFilenameData.read_bytes())
|
|
48
|
+
|
|
49
|
+
ImaIndent = ' '
|
|
50
|
+
linesDataDynamic = """"""
|
|
51
|
+
linesDataDynamic = "\n".join([linesDataDynamic
|
|
52
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['my'], 'my')
|
|
53
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['foldsSubTotals'], 'foldsSubTotals')
|
|
54
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['gapsWhere'], 'gapsWhere')
|
|
55
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['track'], 'track')
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
linesDataStatic = """"""
|
|
59
|
+
linesDataStatic = "\n".join([linesDataStatic
|
|
60
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['the'], 'the')
|
|
61
|
+
, ImaIndent + archivistFormatsArrayToCode(stateJob['connectionGraph'], 'connectionGraph')
|
|
62
|
+
])
|
|
63
|
+
|
|
64
|
+
pathFilenameFoldsTotal: pathlib.Path = stateJob['pathFilenameFoldsTotal']
|
|
65
|
+
|
|
66
|
+
linesAlgorithm = """"""
|
|
67
|
+
for lineSource in pathFilenameAlgorithm.read_text().splitlines():
|
|
68
|
+
if lineSource.startswith('#'):
|
|
69
|
+
continue
|
|
70
|
+
elif not lineSource:
|
|
71
|
+
continue
|
|
72
|
+
elif lineSource.startswith('def '):
|
|
73
|
+
lineSource = "\n".join([lineNumba
|
|
74
|
+
, f"def {identifierCallableLaunch}():"
|
|
75
|
+
, linesDataDynamic
|
|
76
|
+
, linesDataStatic
|
|
77
|
+
])
|
|
78
|
+
linesAlgorithm = "\n".join([linesAlgorithm
|
|
79
|
+
, lineSource
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
lineReturn = f"{ImaIndent}return foldsSubTotals.sum().item()"
|
|
83
|
+
|
|
84
|
+
linesLaunch = """"""
|
|
85
|
+
linesLaunch = linesLaunch + f"""
|
|
86
|
+
if __name__ == '__main__':
|
|
87
|
+
foldsTotal = {identifierCallableLaunch}()"""
|
|
88
|
+
|
|
89
|
+
linesWriteFoldsTotal = """"""
|
|
90
|
+
linesWriteFoldsTotal = "\n".join([linesWriteFoldsTotal
|
|
91
|
+
, " print(foldsTotal)"
|
|
92
|
+
, f" open('{pathFilenameFoldsTotal.as_posix()}', 'w').write(str(foldsTotal))"
|
|
93
|
+
])
|
|
94
|
+
|
|
95
|
+
linesAll = "\n".join([
|
|
96
|
+
linesImport
|
|
97
|
+
, linesAlgorithm
|
|
98
|
+
, f"{ImaIndent}print(foldsSubTotals.sum().item())"
|
|
99
|
+
, lineReturn
|
|
100
|
+
, linesLaunch
|
|
101
|
+
, linesWriteFoldsTotal
|
|
102
|
+
])
|
|
103
|
+
|
|
104
|
+
pathFilenameDestination.write_text(linesAll)
|
|
105
|
+
|
|
106
|
+
return pathFilenameDestination
|
|
107
|
+
|
|
108
|
+
def writeModuleLLVM(pathFilenamePythonFile: pathlib.Path) -> pathlib.Path:
|
|
109
|
+
pathRootPackage = pathlib.Path('c:/apps/mapFolding')
|
|
110
|
+
relativePathModule = pathFilenamePythonFile.relative_to(pathRootPackage)
|
|
111
|
+
moduleTarget = '.'.join(relativePathModule.parts)[0:-len(relativePathModule.suffix)]
|
|
112
|
+
moduleTargetImported = importlib.import_module(moduleTarget)
|
|
113
|
+
linesLLVM = moduleTargetImported.__dict__[identifierCallableLaunch].inspect_llvm()[()]
|
|
114
|
+
moduleLLVM = llvmlite.binding.module.parse_assembly(linesLLVM)
|
|
115
|
+
pathFilenameLLVM = pathFilenamePythonFile.with_suffix(".ll")
|
|
116
|
+
pathFilenameLLVM.write_text(str(moduleLLVM))
|
|
117
|
+
return pathFilenameLLVM
|
|
118
|
+
|
|
119
|
+
if __name__ == '__main__':
|
|
120
|
+
pathFilenamePythonFile = writeModuleWithNumba(listDimensions)
|
|
121
|
+
pathFilenameLLVM = writeModuleLLVM(pathFilenamePythonFile)
|
mapFolding/startHere.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
from mapFolding import outfitCountFolds,
|
|
2
|
-
from typing import Optional, Sequence, Type, Union
|
|
1
|
+
from mapFolding import outfitCountFolds, getPathFilenameFoldsTotal, saveFoldsTotal
|
|
2
|
+
from typing import Any, Optional, Sequence, Type, Union
|
|
3
3
|
import os
|
|
4
|
-
import pathlib
|
|
5
4
|
|
|
6
|
-
def countFolds(listDimensions: Sequence[int],
|
|
5
|
+
def countFolds(listDimensions: Sequence[int], pathishWriteFoldsTotal: Optional[Union[str, os.PathLike[str]]] = None, computationDivisions: Optional[Union[int, str]] = None, CPUlimit: Optional[Union[int, float, bool]] = None, **keywordArguments: Optional[Type[Any]]) -> int:
|
|
7
6
|
"""Count the total number of possible foldings for a given map dimensions.
|
|
8
7
|
|
|
9
8
|
Parameters:
|
|
10
9
|
listDimensions: List of integers representing the dimensions of the map to be folded.
|
|
11
|
-
|
|
12
|
-
If a directory is provided, creates a file with default name based on map dimensions.
|
|
10
|
+
pathishWriteFoldsTotal (None): Path, filename, or pathFilename to write the total fold count to.
|
|
11
|
+
If a directory is provided, creates a file with a default name based on map dimensions.
|
|
13
12
|
computationDivisions (None):
|
|
14
13
|
Whether and how to divide the computational work. See notes for details.
|
|
15
14
|
CPUlimit (None): This is only relevant if there are `computationDivisions`: whether and how to limit the CPU usage. See notes for details.
|
|
@@ -37,34 +36,15 @@ def countFolds(listDimensions: Sequence[int], writeFoldsTotal: Optional[Union[st
|
|
|
37
36
|
stateUniversal = outfitCountFolds(listDimensions, computationDivisions=computationDivisions, CPUlimit=CPUlimit, **keywordArguments)
|
|
38
37
|
|
|
39
38
|
pathFilenameFoldsTotal = None
|
|
40
|
-
if
|
|
41
|
-
pathFilenameFoldsTotal =
|
|
42
|
-
if pathFilenameFoldsTotal.is_dir():
|
|
43
|
-
filenameFoldsTotalDEFAULT = getFilenameFoldsTotal(stateUniversal['mapShape'])
|
|
44
|
-
pathFilenameFoldsTotal = pathFilenameFoldsTotal / filenameFoldsTotalDEFAULT
|
|
45
|
-
pathFilenameFoldsTotal.parent.mkdir(parents=True, exist_ok=True)
|
|
39
|
+
if pathishWriteFoldsTotal is not None:
|
|
40
|
+
pathFilenameFoldsTotal = getPathFilenameFoldsTotal(stateUniversal['mapShape'], pathishWriteFoldsTotal)
|
|
46
41
|
|
|
47
|
-
# NOTE Don't import a module with a numba.jit function until you want the function to compile and to freeze all settings for that function.
|
|
48
42
|
from mapFolding.babbage import _countFolds
|
|
49
43
|
_countFolds(**stateUniversal)
|
|
50
|
-
# foldsSubTotals = benchmarkSherpa(**stateUniversal)
|
|
51
44
|
|
|
52
45
|
foldsTotal = stateUniversal['foldsSubTotals'].sum().item()
|
|
53
46
|
|
|
54
47
|
if pathFilenameFoldsTotal is not None:
|
|
55
|
-
|
|
56
|
-
pathFilenameFoldsTotal.write_text(str(foldsTotal))
|
|
57
|
-
except Exception as ERRORmessage:
|
|
58
|
-
print(ERRORmessage)
|
|
59
|
-
print(f"\nfoldsTotal foldsTotal foldsTotal foldsTotal foldsTotal\n\n{foldsTotal=}\n\nfoldsTotal foldsTotal foldsTotal foldsTotal foldsTotal")
|
|
48
|
+
saveFoldsTotal(pathFilenameFoldsTotal, foldsTotal)
|
|
60
49
|
|
|
61
50
|
return foldsTotal
|
|
62
|
-
|
|
63
|
-
# from numpy import integer
|
|
64
|
-
# from numpy.typing import NDArray
|
|
65
|
-
# from typing import Any, Tuple
|
|
66
|
-
# from mapFolding.benchmarks.benchmarking import recordBenchmarks
|
|
67
|
-
# @recordBenchmarks()
|
|
68
|
-
# def benchmarkSherpa(connectionGraph: NDArray[integer[Any]], foldsSubTotals: NDArray[integer[Any]], gapsWhere: NDArray[integer[Any]], mapShape: Tuple[int, ...], my: NDArray[integer[Any]], the: NDArray[integer[Any]], track: NDArray[integer[Any]]):
|
|
69
|
-
# from mapFolding.babbage import _countFolds
|
|
70
|
-
# return _countFolds(connectionGraph, foldsSubTotals, gapsWhere, mapShape, my, the, track)
|
mapFolding/theSSOT.py
CHANGED
|
@@ -5,9 +5,17 @@ import numpy.typing
|
|
|
5
5
|
import pathlib
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
datatypeModule = 'numpy'
|
|
9
|
+
|
|
10
|
+
datatypeLarge = 'int64'
|
|
11
|
+
datatypeDefault = datatypeLarge
|
|
12
|
+
datatypeSmall = datatypeDefault
|
|
13
|
+
|
|
14
|
+
make_dtype = lambda _datatype: eval(f"{datatypeModule}.{_datatype}")
|
|
15
|
+
|
|
16
|
+
dtypeLarge = make_dtype(datatypeLarge)
|
|
17
|
+
dtypeDefault = make_dtype(datatypeDefault)
|
|
18
|
+
dtypeSmall = make_dtype(datatypeSmall)
|
|
11
19
|
|
|
12
20
|
try:
|
|
13
21
|
_pathModule = pathlib.Path(__file__).parent
|
|
@@ -59,9 +67,9 @@ class indexTrack(EnumIndices):
|
|
|
59
67
|
|
|
60
68
|
class computationState(TypedDict):
|
|
61
69
|
connectionGraph: numpy.typing.NDArray[numpy.integer[Any]]
|
|
62
|
-
foldsSubTotals: numpy.
|
|
70
|
+
foldsSubTotals: numpy.typing.NDArray[numpy.integer[Any]]
|
|
71
|
+
gapsWhere: numpy.typing.NDArray[numpy.integer[Any]]
|
|
63
72
|
mapShape: Tuple[int, ...]
|
|
64
73
|
my: numpy.typing.NDArray[numpy.integer[Any]]
|
|
65
|
-
gapsWhere: numpy.typing.NDArray[numpy.integer[Any]]
|
|
66
74
|
the: numpy.typing.NDArray[numpy.integer[Any]]
|
|
67
75
|
track: numpy.typing.NDArray[numpy.integer[Any]]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mapFolding
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.2.5
|
|
4
|
+
Summary: Count distinct ways to fold a map (or a strip of stamps)
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
Project-URL: homepage, https://github.com/hunterhogan/mapFolding
|
|
7
7
|
Requires-Python: <3.13,>=3.10
|
|
@@ -14,9 +14,6 @@ Requires-Dist: pandas; extra == "benchmark"
|
|
|
14
14
|
Requires-Dist: jupyter; extra == "benchmark"
|
|
15
15
|
Requires-Dist: ipywidgets; extra == "benchmark"
|
|
16
16
|
Requires-Dist: tqdm; extra == "benchmark"
|
|
17
|
-
Provides-Extra: jax
|
|
18
|
-
Requires-Dist: jax; extra == "jax"
|
|
19
|
-
Requires-Dist: jaxtyping; extra == "jax"
|
|
20
17
|
Provides-Extra: testing
|
|
21
18
|
Requires-Dist: pytest; extra == "testing"
|
|
22
19
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
@@ -39,7 +36,7 @@ The directory [mapFolding/reference](https://github.com/hunterhogan/mapFolding/b
|
|
|
39
36
|
- [hunterNumba.py](https://github.com/hunterhogan/mapFolding/blob/main/mapFolding/reference), a one-size-fits-all, self-contained, reasonably fast, contemporary algorithm that is nevertheless infected by _noobaceae ignorancium_, and
|
|
40
37
|
- miscellaneous notes.
|
|
41
38
|
|
|
42
|
-
[](https://github.com/hunterhogan/mapFolding/actions/workflows/unittests.yml) [](https://pypi.org/project/mapFolding/) [](https://github.com/hunterhogan/mapFolding/actions/workflows/unittests.yml) [](https://youtu.be/g6f_miE91mk&t=4)   
|
|
43
40
|
|
|
44
41
|
## Simple, easy usage based on OEIS IDs
|
|
45
42
|
|
|
@@ -131,3 +128,8 @@ In [`foldings.txt`](https://github.com/hunterhogan/mapFolding/blob/main/mapFoldi
|
|
|
131
128
|
```sh
|
|
132
129
|
pip install mapFolding
|
|
133
130
|
```
|
|
131
|
+
|
|
132
|
+
## My recovery
|
|
133
|
+
|
|
134
|
+
[](https://HunterThinks.com/support)
|
|
135
|
+
[](https://www.youtube.com/@HunterHogan)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
mapFolding/__init__.py,sha256=yZ_rcMMCco346M62nKzp90GPp9OV1UkkWSxKzP3ISPA,380
|
|
2
|
+
mapFolding/babbage.py,sha256=51fO7lwcTsTvSMwzKW1G2nGslGoEQt19IgnqZi8znao,2222
|
|
3
|
+
mapFolding/beDRY.py,sha256=IhBnlo-Lg8DBaebTDAyJ7OiGUce9OFbNUNHJmlB04L0,15835
|
|
4
|
+
mapFolding/importSelector.py,sha256=sc9IGk8CpCNerFbuYnrroBH-itqsxjeBc4VYjiesOQo,310
|
|
5
|
+
mapFolding/lovelace.py,sha256=iu7anbA_TacIAjc4EKkeBVxIJKAMdrYgvR4evzMZ1WY,15193
|
|
6
|
+
mapFolding/oeis.py,sha256=_-fLGc1ybZ2eFxoiBrSmojMexeg6ROxtrLaBF2BzMn4,12144
|
|
7
|
+
mapFolding/startHere.py,sha256=Bu4boZnxlx66IU7RIsBRq00JScE0DWqKLAclUMPGOSM,3892
|
|
8
|
+
mapFolding/theSSOT.py,sha256=3Zty4rYWOqrwivuCaKA71R0HM4rjmvtkL_Bsn4ZhwFo,2318
|
|
9
|
+
mapFolding/benchmarks/benchmarking.py,sha256=HD_0NSvuabblg94ftDre6LFnXShTe8MYj3hIodW-zV0,3076
|
|
10
|
+
mapFolding/reference/flattened.py,sha256=X9nvRzg7YDcpCtSDTL4YiidjshlX9rg2e6JVCY6i2u0,16547
|
|
11
|
+
mapFolding/reference/hunterNumba.py,sha256=0giUyqAFzP-XKcq3Kz8wIWCK0BVFhjABVJ1s-w4Jhu0,7109
|
|
12
|
+
mapFolding/reference/irvineJavaPort.py,sha256=Sj-63Z-OsGuDoEBXuxyjRrNmmyl0d7Yz_XuY7I47Oyg,4250
|
|
13
|
+
mapFolding/reference/jax.py,sha256=bB34dGdi3VSz4cRFbmCPn_erAmQ3FyrSED8uJ7CsES0,14961
|
|
14
|
+
mapFolding/reference/lunnan.py,sha256=XEcql_gxvCCghb6Or3qwmPbn4IZUbZTaSmw_fUjRxZE,5037
|
|
15
|
+
mapFolding/reference/lunnanNumpy.py,sha256=HqDgSwTOZA-G0oophOEfc4zs25Mv4yw2aoF1v8miOLk,4653
|
|
16
|
+
mapFolding/reference/lunnanWhile.py,sha256=7NY2IKO5XBgol0aWWF_Fi-7oTL9pvu_z6lB0TF1uVHk,4063
|
|
17
|
+
mapFolding/reference/rotatedEntryPoint.py,sha256=z0QyDQtnMvXNj5ntWzzJUQUMFm1-xHGLVhtYzwmczUI,11530
|
|
18
|
+
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=usenM8Yn_G1dqlPl7NKKkcnbohBZVZBXTQRm2S3_EDA,8106
|
|
19
|
+
mapFolding/someAssemblyRequired/inlineAfunction.py,sha256=Hxytb9xgJV_Mnh8us0mA_oKwanEQWJSj3hJc25nI9Mk,6143
|
|
20
|
+
mapFolding/someAssemblyRequired/jobsAndTasks.py,sha256=u2ZtZ8xlQJALqQqQ8N7uBTNDbjG4OQ9nJsJZG5rLI8o,2189
|
|
21
|
+
mapFolding/someAssemblyRequired/makeNuitkaSource.py,sha256=jTK34OWzm6OsgFPd2mHwETxFo2X83io0M4YiEHRgk3U,3262
|
|
22
|
+
mapFolding/someAssemblyRequired/makeNumbaJob.py,sha256=YZ9JzzEieQH4sMqX84VGbpOJmdBatPanfmXFZ5V1Ex4,5109
|
|
23
|
+
tests/__init__.py,sha256=eg9smg-6VblOr0kisM40CpGnuDtU2JgEEWGDTFVOlW8,57
|
|
24
|
+
tests/conftest.py,sha256=AWB3m_jxMlkmOmGvk2ApJEk2ro5v8gmmJDcyLwN1oow,13761
|
|
25
|
+
tests/pythons_idiotic_namespace.py,sha256=oOLDBergQqqhGuRpsXUnFD-R_6AlJipNKYHw-kk_OKw,33
|
|
26
|
+
tests/test_oeis.py,sha256=vxnwO-cSR68htkyMh9QMVv-lvxBo6qlwPg1Rbx4JylY,7963
|
|
27
|
+
tests/test_other.py,sha256=1EtLe0te7qqdazFKvKIOHPYW_ENsqAu11nzJO0yAE_Q,12012
|
|
28
|
+
tests/test_tasks.py,sha256=Nwe4iuSjwGZvsw5CXCcic7tkBxgM5JX9mrGZMDYhAwE,1785
|
|
29
|
+
mapFolding-0.2.5.dist-info/METADATA,sha256=pKBorE-WQsa2LVETIUORCw-ae3cDPtUcLbE395-oVhs,6652
|
|
30
|
+
mapFolding-0.2.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
31
|
+
mapFolding-0.2.5.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
32
|
+
mapFolding-0.2.5.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
33
|
+
mapFolding-0.2.5.dist-info/RECORD,,
|
tests/conftest.py
CHANGED
|
@@ -26,7 +26,6 @@ from mapFolding.oeis import _parseBFileOEIS
|
|
|
26
26
|
from mapFolding.oeis import _validateOEISid
|
|
27
27
|
from mapFolding.oeis import oeisIDsImplemented
|
|
28
28
|
from mapFolding.oeis import settingsOEIS
|
|
29
|
-
from mapFolding import *
|
|
30
29
|
|
|
31
30
|
__all__ = [
|
|
32
31
|
'OEIS_for_n',
|
|
@@ -135,6 +134,14 @@ def setupTeardownTestData() -> Generator[None, None, None]:
|
|
|
135
134
|
yield
|
|
136
135
|
cleanupTempFileRegister()
|
|
137
136
|
|
|
137
|
+
@pytest.fixture(autouse=True)
|
|
138
|
+
def setupWarningsAsErrors():
|
|
139
|
+
"""Convert all warnings to errors for all tests."""
|
|
140
|
+
import warnings
|
|
141
|
+
warnings.filterwarnings("error")
|
|
142
|
+
yield
|
|
143
|
+
warnings.resetwarnings()
|
|
144
|
+
|
|
138
145
|
@pytest.fixture
|
|
139
146
|
def pathTempTesting(request: pytest.FixtureRequest) -> pathlib.Path:
|
|
140
147
|
"""Create a unique temp directory for each test function."""
|