mapFolding 0.3.9__py3-none-any.whl → 0.3.10__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 +27 -9
- mapFolding/basecamp.py +1 -1
- mapFolding/beDRY.py +25 -13
- mapFolding/oeis.py +81 -71
- mapFolding/someAssemblyRequired/__init__.py +1 -0
- mapFolding/someAssemblyRequired/makeJob.py +1 -2
- mapFolding/someAssemblyRequired/synthesizeJobNumba.py +383 -0
- mapFolding/someAssemblyRequired/synthesizeModuleJAX.py +2 -2
- mapFolding/someAssemblyRequired/synthesizeModulesNumba.py +71 -44
- mapFolding/syntheticModules/numba_countInitialize.py +4 -5
- mapFolding/syntheticModules/numba_countParallel.py +5 -6
- mapFolding/syntheticModules/numba_countSequential.py +3 -4
- mapFolding/syntheticModules/numba_doTheNeedful.py +16 -19
- mapFolding/theDao.py +43 -44
- mapFolding/theSSOT.py +13 -31
- mapFolding/theSSOTnumba.py +115 -0
- {mapFolding-0.3.9.dist-info → mapFolding-0.3.10.dist-info}/METADATA +1 -7
- mapFolding-0.3.10.dist-info/RECORD +40 -0
- tests/conftest.py +2 -43
- tests/test_oeis.py +7 -66
- tests/test_other.py +30 -29
- mapFolding/someAssemblyRequired/synthesizeModuleJobNumba.py +0 -212
- mapFolding/syntheticModules/__init__.py +0 -3
- mapFolding-0.3.9.dist-info/RECORD +0 -40
- {mapFolding-0.3.9.dist-info → mapFolding-0.3.10.dist-info}/LICENSE +0 -0
- {mapFolding-0.3.9.dist-info → mapFolding-0.3.10.dist-info}/WHEEL +0 -0
- {mapFolding-0.3.9.dist-info → mapFolding-0.3.10.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.3.9.dist-info → mapFolding-0.3.10.dist-info}/top_level.txt +0 -0
tests/test_oeis.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from contextlib import redirect_stdout
|
|
2
2
|
from datetime import datetime, timedelta
|
|
3
|
-
from mapFolding.oeis import _getFilenameOEISbFile, _getOEISidValues, _parseBFileOEIS, _validateOEISid
|
|
3
|
+
from mapFolding.oeis import _getFilenameOEISbFile, _getOEISidValues, _parseBFileOEIS, _validateOEISid, _getOEISidInformation
|
|
4
4
|
from tests.conftest import *
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import NoReturn
|
|
6
|
+
from urllib.error import URLError
|
|
6
7
|
import io
|
|
7
8
|
import os
|
|
8
9
|
import pathlib
|
|
@@ -12,7 +13,6 @@ import re as regex
|
|
|
12
13
|
import unittest
|
|
13
14
|
import unittest.mock
|
|
14
15
|
import urllib
|
|
15
|
-
from urllib.error import URLError
|
|
16
16
|
import urllib.request
|
|
17
17
|
|
|
18
18
|
def test_algorithmSourceSequential(oeisID: str, useAlgorithmDirectly: None) -> None:
|
|
@@ -63,73 +63,14 @@ def test_clearOEIScache(mock_unlink: unittest.mock.MagicMock, mock_exists: unitt
|
|
|
63
63
|
clearOEIScache()
|
|
64
64
|
|
|
65
65
|
if cacheExists:
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
# Each OEIS ID has two cache files
|
|
67
|
+
expected_calls = len(settingsOEIS) * 2
|
|
68
|
+
assert mock_unlink.call_count == expected_calls
|
|
69
|
+
mock_unlink.assert_has_calls([unittest.mock.call(missing_ok=True)] * expected_calls)
|
|
68
70
|
else:
|
|
69
71
|
mock_exists.assert_called_once()
|
|
70
72
|
mock_unlink.assert_not_called()
|
|
71
73
|
|
|
72
|
-
@pytest.mark.parametrize("scenarioCache", ["miss", "expired", "invalid"])
|
|
73
|
-
def testCacheScenarios(pathCacheTesting: pathlib.Path, oeisID_1random: str, scenarioCache: str) -> None:
|
|
74
|
-
"""Test cache scenarios: missing file, expired file, and invalid file."""
|
|
75
|
-
|
|
76
|
-
def setupCacheExpired(pathCache: pathlib.Path, oeisID: str) -> None:
|
|
77
|
-
pathCache.write_text("# Old cache content")
|
|
78
|
-
oldModificationTime = datetime.now() - timedelta(days=30)
|
|
79
|
-
os.utime(pathCache, times=(oldModificationTime.timestamp(), oldModificationTime.timestamp()))
|
|
80
|
-
|
|
81
|
-
def setupCacheInvalid(pathCache: pathlib.Path, oeisID: str) -> None:
|
|
82
|
-
pathCache.write_text("Invalid content")
|
|
83
|
-
|
|
84
|
-
if scenarioCache == "miss":
|
|
85
|
-
prototypeCacheTest(settingsOEIS[oeisID_1random]['valuesKnown'], None, oeisID_1random, pathCacheTesting)
|
|
86
|
-
elif scenarioCache == "expired":
|
|
87
|
-
prototypeCacheTest(settingsOEIS[oeisID_1random]['valuesKnown'], setupCacheExpired, oeisID_1random, pathCacheTesting)
|
|
88
|
-
else:
|
|
89
|
-
prototypeCacheTest(settingsOEIS[oeisID_1random]['valuesKnown'], setupCacheInvalid, oeisID_1random, pathCacheTesting)
|
|
90
|
-
|
|
91
|
-
def testInvalidFileContent(pathCacheTesting: pathlib.Path, oeisID_1random: str) -> None:
|
|
92
|
-
pathFilenameCache = pathCacheTesting / _getFilenameOEISbFile(oeisID=oeisID_1random)
|
|
93
|
-
|
|
94
|
-
# Write invalid content to cache
|
|
95
|
-
pathFilenameCache.write_text("# A999999\n1 1\n2 2\n")
|
|
96
|
-
modificationTimeOriginal = pathFilenameCache.stat().st_mtime
|
|
97
|
-
|
|
98
|
-
# Function should detect invalid content, fetch fresh data, and update cache
|
|
99
|
-
OEISsequence = _getOEISidValues(oeisID_1random)
|
|
100
|
-
|
|
101
|
-
# Verify the function succeeded
|
|
102
|
-
assert OEISsequence is not None
|
|
103
|
-
# Verify cache was updated (modification time changed)
|
|
104
|
-
assert pathFilenameCache.stat().st_mtime > modificationTimeOriginal
|
|
105
|
-
# Verify cache now contains correct sequence ID
|
|
106
|
-
assert f"# {oeisID_1random}" in pathFilenameCache.read_text()
|
|
107
|
-
|
|
108
|
-
def testParseContentErrors() -> None:
|
|
109
|
-
"""Test invalid content parsing."""
|
|
110
|
-
standardizedEqualTo(ValueError, _parseBFileOEIS, "Invalid content\n1 2\n", 'A001415')
|
|
111
|
-
|
|
112
|
-
def testExtraComments(pathCacheTesting: pathlib.Path, oeisID_1random: str) -> None:
|
|
113
|
-
pathFilenameCache = pathCacheTesting / _getFilenameOEISbFile(oeisID=oeisID_1random)
|
|
114
|
-
|
|
115
|
-
# Write content with extra comment lines
|
|
116
|
-
contentWithExtraComments = f"""# {oeisID_1random}
|
|
117
|
-
# Normal place for comment line 1
|
|
118
|
-
# Abnormal comment line
|
|
119
|
-
1 2
|
|
120
|
-
2 4
|
|
121
|
-
3 6
|
|
122
|
-
# Another comment in the middle
|
|
123
|
-
4 8
|
|
124
|
-
5 10"""
|
|
125
|
-
pathFilenameCache.write_text(contentWithExtraComments)
|
|
126
|
-
|
|
127
|
-
OEISsequence = _getOEISidValues(oeisID_1random)
|
|
128
|
-
# Verify sequence values are correct despite extra comments
|
|
129
|
-
standardizedEqualTo(2, lambda d: d[1], OEISsequence) # First value
|
|
130
|
-
standardizedEqualTo(8, lambda d: d[4], OEISsequence) # Value after mid-sequence comment
|
|
131
|
-
standardizedEqualTo(10, lambda d: d[5], OEISsequence) # Last value
|
|
132
|
-
|
|
133
74
|
def testNetworkError(monkeypatch: pytest.MonkeyPatch, pathCacheTesting: pathlib.Path) -> None:
|
|
134
75
|
"""Test network error handling."""
|
|
135
76
|
def mockUrlopen(*args: Any, **kwargs: Any) -> NoReturn:
|
tests/test_other.py
CHANGED
|
@@ -61,35 +61,36 @@ def test_getLeavesTotal_edge_cases() -> None:
|
|
|
61
61
|
standardizedEqualTo(6, getLeavesTotal, listOriginal)
|
|
62
62
|
standardizedEqualTo([2, 3], lambda x: x, listOriginal) # Check that the list wasn't modified
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
64
|
+
# TODO fix this mock
|
|
65
|
+
# @pytest.mark.parametrize("foldsValue,writeFoldsTarget", [
|
|
66
|
+
# (756839, "foldsTotalTest.txt"), # Direct file
|
|
67
|
+
# (2640919, "foldsTotalTest.txt"), # Direct file
|
|
68
|
+
# (7715177, None), # Directory, will use default filename
|
|
69
|
+
# ])
|
|
70
|
+
# def test_countFolds_writeFoldsTotal(
|
|
71
|
+
# listDimensionsTestFunctionality: List[int],
|
|
72
|
+
# pathTempTesting: pathlib.Path,
|
|
73
|
+
# mockFoldingFunction: Callable[..., Callable[..., None]],
|
|
74
|
+
# mockDispatcher: Callable[[Callable[..., None]], Any],
|
|
75
|
+
# foldsValue: int,
|
|
76
|
+
# writeFoldsTarget: Optional[str]
|
|
77
|
+
# ) -> None:
|
|
78
|
+
# """Test writing folds total to either a file or directory."""
|
|
79
|
+
# # For directory case, use the directory path directly
|
|
80
|
+
# if writeFoldsTarget is None:
|
|
81
|
+
# pathWriteTarget = pathTempTesting
|
|
82
|
+
# filenameFoldsTotalExpected = getFilenameFoldsTotal(listDimensionsTestFunctionality)
|
|
83
|
+
# else:
|
|
84
|
+
# pathWriteTarget = pathTempTesting / writeFoldsTarget
|
|
85
|
+
# filenameFoldsTotalExpected = writeFoldsTarget
|
|
86
|
+
|
|
87
|
+
# foldsTotalExpected = foldsValue * getLeavesTotal(listDimensionsTestFunctionality)
|
|
88
|
+
# mock_countFolds = mockFoldingFunction(foldsValue, listDimensionsTestFunctionality)
|
|
89
|
+
|
|
90
|
+
# with mockDispatcher(mock_countFolds):
|
|
91
|
+
# returned = countFolds(listDimensionsTestFunctionality, pathLikeWriteFoldsTotal=pathWriteTarget)
|
|
92
|
+
|
|
93
|
+
# standardizedEqualTo(str(foldsTotalExpected), lambda: (pathTempTesting / filenameFoldsTotalExpected).read_text())
|
|
93
94
|
|
|
94
95
|
@pytest.mark.parametrize("nameOfTest,callablePytest", PytestFor_intInnit())
|
|
95
96
|
def testIntInnit(nameOfTest: str, callablePytest: Callable[[], None]) -> None:
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
from mapFolding import getPathFilenameFoldsTotal, indexMy, indexTrack
|
|
2
|
-
from mapFolding import setDatatypeElephino, setDatatypeFoldsTotal, setDatatypeLeavesTotal, setDatatypeModule, hackSSOTdatatype
|
|
3
|
-
from someAssemblyRequired import makeStateJob
|
|
4
|
-
from typing import Optional
|
|
5
|
-
import importlib
|
|
6
|
-
import importlib.util
|
|
7
|
-
import inspect
|
|
8
|
-
import more_itertools
|
|
9
|
-
import numpy
|
|
10
|
-
import pathlib
|
|
11
|
-
import python_minifier
|
|
12
|
-
|
|
13
|
-
identifierCallableLaunch = "goGoGadgetAbsurdity"
|
|
14
|
-
|
|
15
|
-
def makeStrRLEcompacted(arrayTarget: numpy.ndarray, identifierName: str) -> str:
|
|
16
|
-
"""Converts a NumPy array into a compressed string representation using run-length encoding (RLE).
|
|
17
|
-
|
|
18
|
-
This function takes a NumPy array and converts it into an optimized string representation by:
|
|
19
|
-
1. Compressing consecutive sequences of numbers into range objects
|
|
20
|
-
2. Minimizing repeated zeros using array multiplication syntax
|
|
21
|
-
3. Converting the result into a valid Python array initialization statement
|
|
22
|
-
|
|
23
|
-
Parameters:
|
|
24
|
-
arrayTarget (numpy.ndarray): The input NumPy array to be converted
|
|
25
|
-
identifierName (str): The variable name to use in the output string
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
str: A string containing Python code that recreates the input array in compressed form.
|
|
29
|
-
Format: "{identifierName} = numpy.array({compressed_data}, dtype=numpy.{dtype})"
|
|
30
|
-
|
|
31
|
-
Example:
|
|
32
|
-
>>> arr = numpy.array([[0,0,0,1,2,3,4,0,0]])
|
|
33
|
-
>>> print(makeStrRLEcompacted(arr, "myArray"))
|
|
34
|
-
"myArray = numpy.array([[0]*3,*range(1,5),[0]*2], dtype=numpy.int64)"
|
|
35
|
-
|
|
36
|
-
Notes:
|
|
37
|
-
- Sequences of 4 or fewer numbers are kept as individual values
|
|
38
|
-
- Sequences longer than 4 numbers are converted to range objects
|
|
39
|
-
- Consecutive zeros are compressed using multiplication syntax
|
|
40
|
-
- The function preserves the original array's dtype
|
|
41
|
-
"""
|
|
42
|
-
|
|
43
|
-
def compressRangesNDArrayNoFlatten(arraySlice):
|
|
44
|
-
if isinstance(arraySlice, numpy.ndarray) and arraySlice.ndim > 1:
|
|
45
|
-
return [compressRangesNDArrayNoFlatten(arraySlice[index]) for index in range(arraySlice.shape[0])]
|
|
46
|
-
elif isinstance(arraySlice, numpy.ndarray) and arraySlice.ndim == 1:
|
|
47
|
-
listWithRanges = []
|
|
48
|
-
for group in more_itertools.consecutive_groups(arraySlice.tolist()):
|
|
49
|
-
ImaSerious = list(group)
|
|
50
|
-
if len(ImaSerious) <= 4:
|
|
51
|
-
listWithRanges += ImaSerious
|
|
52
|
-
else:
|
|
53
|
-
ImaRange = [range(ImaSerious[0], ImaSerious[-1] + 1)]
|
|
54
|
-
listWithRanges += ImaRange
|
|
55
|
-
return listWithRanges
|
|
56
|
-
return arraySlice
|
|
57
|
-
|
|
58
|
-
arrayAsNestedLists = compressRangesNDArrayNoFlatten(arrayTarget)
|
|
59
|
-
|
|
60
|
-
stringMinimized = python_minifier.minify(str(arrayAsNestedLists))
|
|
61
|
-
commaZeroMaximum = arrayTarget.shape[-1] - 1
|
|
62
|
-
stringMinimized = stringMinimized.replace('[0' + ',0'*commaZeroMaximum + ']', '[0]*'+str(commaZeroMaximum+1))
|
|
63
|
-
for countZeros in range(commaZeroMaximum, 2, -1):
|
|
64
|
-
stringMinimized = stringMinimized.replace(',0'*countZeros + ']', ']+[0]*'+str(countZeros))
|
|
65
|
-
|
|
66
|
-
stringMinimized = stringMinimized.replace('range', '*range')
|
|
67
|
-
|
|
68
|
-
return f"{identifierName} = numpy.array({stringMinimized}, dtype=numpy.{arrayTarget.dtype})"
|
|
69
|
-
|
|
70
|
-
def writeModuleWithNumba(listDimensions) -> pathlib.Path:
|
|
71
|
-
"""
|
|
72
|
-
Writes a Numba-optimized Python module for map folding calculations.
|
|
73
|
-
|
|
74
|
-
This function takes map dimensions and generates a specialized Python module with Numba
|
|
75
|
-
optimizations. It processes a sequential counting algorithm, adds Numba decorators and
|
|
76
|
-
necessary data structures, and writes the resulting code to a file.
|
|
77
|
-
|
|
78
|
-
Parameters:
|
|
79
|
-
listDimensions: List of integers representing the dimensions of the map to be folded.
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
pathlib.Path: Path to the generated Python module file.
|
|
83
|
-
|
|
84
|
-
The generated module includes:
|
|
85
|
-
- Numba JIT compilation decorators for performance optimization
|
|
86
|
-
- Required numpy and numba imports
|
|
87
|
-
- Dynamic and static data structures needed for folding calculations
|
|
88
|
-
- Processed algorithm from the original sequential counter
|
|
89
|
-
- Launch code for standalone execution
|
|
90
|
-
- Code to write the final fold count to a file
|
|
91
|
-
The function handles:
|
|
92
|
-
- Translation of original code to Numba-compatible syntax
|
|
93
|
-
- Insertion of pre-calculated values from the state job
|
|
94
|
-
- Management of variable declarations and assignments
|
|
95
|
-
- Setup of proper data types for Numba optimization
|
|
96
|
-
- Organization of the output file structure
|
|
97
|
-
|
|
98
|
-
Note:
|
|
99
|
-
The generated module requires Numba and numpy to be installed.
|
|
100
|
-
The output file will be placed in the same directory as the folds total file,
|
|
101
|
-
with a .py extension.
|
|
102
|
-
"""
|
|
103
|
-
stateJob = makeStateJob(listDimensions, writeJob=False)
|
|
104
|
-
pathFilenameFoldsTotal = getPathFilenameFoldsTotal(stateJob['mapShape'])
|
|
105
|
-
|
|
106
|
-
from syntheticModules import countSequential
|
|
107
|
-
algorithmSource = countSequential
|
|
108
|
-
codeSource = inspect.getsource(algorithmSource)
|
|
109
|
-
|
|
110
|
-
lineNumba = f"@numba.jit(numba.types.{hackSSOTdatatype('datatypeFoldsTotal')}(), cache=True, nopython=True, fastmath=True, forceinline=True, inline='always', looplift=False, _nrt=True, error_model='numpy', parallel=False, boundscheck=False, no_cfunc_wrapper=False, no_cpython_wrapper=False)"
|
|
111
|
-
|
|
112
|
-
linesImport = "\n".join([
|
|
113
|
-
"import numpy"
|
|
114
|
-
, "import numba"
|
|
115
|
-
])
|
|
116
|
-
|
|
117
|
-
ImaIndent = ' '
|
|
118
|
-
linesDataDynamic = """"""
|
|
119
|
-
linesDataDynamic = "\n".join([linesDataDynamic
|
|
120
|
-
, ImaIndent + makeStrRLEcompacted(stateJob['gapsWhere'], 'gapsWhere')
|
|
121
|
-
])
|
|
122
|
-
|
|
123
|
-
linesDataStatic = """"""
|
|
124
|
-
linesDataStatic = "\n".join([linesDataStatic
|
|
125
|
-
, ImaIndent + makeStrRLEcompacted(stateJob['connectionGraph'], 'connectionGraph')
|
|
126
|
-
])
|
|
127
|
-
|
|
128
|
-
my = stateJob['my']
|
|
129
|
-
track = stateJob['track']
|
|
130
|
-
linesAlgorithm = """"""
|
|
131
|
-
for lineSource in codeSource.splitlines():
|
|
132
|
-
if lineSource.startswith(('#', 'import', 'from', '@numba.jit')):
|
|
133
|
-
continue
|
|
134
|
-
elif not lineSource:
|
|
135
|
-
continue
|
|
136
|
-
elif lineSource.startswith('def '):
|
|
137
|
-
lineSource = "\n".join([lineNumba
|
|
138
|
-
, f"def {identifierCallableLaunch}():"
|
|
139
|
-
, linesDataDynamic
|
|
140
|
-
, linesDataStatic
|
|
141
|
-
])
|
|
142
|
-
elif 'taskIndex' in lineSource:
|
|
143
|
-
continue
|
|
144
|
-
elif 'my[indexMy.' in lineSource:
|
|
145
|
-
if 'dimensionsTotal' in lineSource:
|
|
146
|
-
continue
|
|
147
|
-
# Statements are in the form: leaf1ndex = my[indexMy.leaf1ndex.value]
|
|
148
|
-
identifier, statement = lineSource.split('=')
|
|
149
|
-
lineSource = ImaIndent + identifier.strip() + f"=numba.types.{hackSSOTdatatype(identifier.strip())}({str(eval(statement.strip()))})"
|
|
150
|
-
elif ': int =' in lineSource or ':int=' in lineSource:
|
|
151
|
-
if 'dimensionsTotal' in lineSource:
|
|
152
|
-
continue
|
|
153
|
-
# Statements are in the form: groupsOfFolds: int = 0
|
|
154
|
-
assignment, statement = lineSource.split('=')
|
|
155
|
-
identifier = assignment.split(':')[0].strip()
|
|
156
|
-
lineSource = ImaIndent + identifier.strip() + f"=numba.types.{hackSSOTdatatype(identifier.strip())}({str(eval(statement.strip()))})"
|
|
157
|
-
elif 'track[indexTrack.' in lineSource:
|
|
158
|
-
# Statements are in the form: leafAbove = track[indexTrack.leafAbove.value]
|
|
159
|
-
identifier, statement = lineSource.split('=')
|
|
160
|
-
lineSource = ImaIndent + makeStrRLEcompacted(eval(statement.strip()), identifier.strip())
|
|
161
|
-
elif 'foldGroups[-1]' in lineSource:
|
|
162
|
-
lineSource = lineSource.replace('foldGroups[-1]', str(stateJob['foldGroups'][-1]))
|
|
163
|
-
elif 'dimensionsTotal' in lineSource:
|
|
164
|
-
lineSource = lineSource.replace('dimensionsTotal', str(stateJob['my'][indexMy.dimensionsTotal]))
|
|
165
|
-
|
|
166
|
-
linesAlgorithm = "\n".join([linesAlgorithm
|
|
167
|
-
, lineSource
|
|
168
|
-
])
|
|
169
|
-
|
|
170
|
-
linesLaunch = """"""
|
|
171
|
-
linesLaunch = linesLaunch + f"""
|
|
172
|
-
if __name__ == '__main__':
|
|
173
|
-
# import time
|
|
174
|
-
# timeStart = time.perf_counter()
|
|
175
|
-
{identifierCallableLaunch}()
|
|
176
|
-
# print(time.perf_counter() - timeStart)
|
|
177
|
-
"""
|
|
178
|
-
|
|
179
|
-
linesWriteFoldsTotal = """"""
|
|
180
|
-
linesWriteFoldsTotal = "\n".join([linesWriteFoldsTotal
|
|
181
|
-
, f" groupsOfFolds *= {str(stateJob['foldGroups'][-1])}"
|
|
182
|
-
, " print(groupsOfFolds)"
|
|
183
|
-
, " with numba.objmode():"
|
|
184
|
-
, f" open('{pathFilenameFoldsTotal.as_posix()}', 'w').write(str(groupsOfFolds))"
|
|
185
|
-
, " return groupsOfFolds"
|
|
186
|
-
])
|
|
187
|
-
|
|
188
|
-
linesAll = "\n".join([
|
|
189
|
-
linesImport
|
|
190
|
-
, linesAlgorithm
|
|
191
|
-
, linesWriteFoldsTotal
|
|
192
|
-
, linesLaunch
|
|
193
|
-
])
|
|
194
|
-
|
|
195
|
-
pathFilenameDestination = pathFilenameFoldsTotal.with_suffix(".py")
|
|
196
|
-
pathFilenameDestination.write_text(linesAll)
|
|
197
|
-
|
|
198
|
-
return pathFilenameDestination
|
|
199
|
-
|
|
200
|
-
if __name__ == '__main__':
|
|
201
|
-
listDimensions = [5,5]
|
|
202
|
-
setDatatypeFoldsTotal('int64', sourGrapes=True)
|
|
203
|
-
setDatatypeElephino('uint8', sourGrapes=True)
|
|
204
|
-
setDatatypeLeavesTotal('int8', sourGrapes=True)
|
|
205
|
-
pathFilenameModule = writeModuleWithNumba(listDimensions)
|
|
206
|
-
|
|
207
|
-
# Induce numba.jit compilation
|
|
208
|
-
moduleSpec = importlib.util.spec_from_file_location(pathFilenameModule.stem, pathFilenameModule)
|
|
209
|
-
if moduleSpec is None: raise ImportError(f"Could not load module specification from {pathFilenameModule}")
|
|
210
|
-
module = importlib.util.module_from_spec(moduleSpec)
|
|
211
|
-
if moduleSpec.loader is None: raise ImportError(f"Could not load module from {moduleSpec}")
|
|
212
|
-
moduleSpec.loader.exec_module(module)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
mapFolding/__init__.py,sha256=UWzkx8iO90WeetoipfAuHJisICTJNWN7t_Q8FRi8lok,833
|
|
2
|
-
mapFolding/basecamp.py,sha256=2Zo4ayHfpfn6RRtsumDNRvV7UUHx0GInfNYmr8-G2b4,3988
|
|
3
|
-
mapFolding/beDRY.py,sha256=otzEut41VWUiKkwM8ZE6_aduNDMGGXYsyjtNs6AcotA,17845
|
|
4
|
-
mapFolding/oeis.py,sha256=fIJySN5fIsRS-TBNbpKQdk9XVlZ4xFY6uthWzZY1jRs,12567
|
|
5
|
-
mapFolding/theDao.py,sha256=BlYx1h39ieZIkTOhvzMJ2MEI5tjB4dHyrbz0q3bJNDc,14418
|
|
6
|
-
mapFolding/theSSOT.py,sha256=ZXKFglwfr3JH4yGH8NmS1DRpfyON3Wulx8lG5gITHD0,10219
|
|
7
|
-
mapFolding/reference/flattened.py,sha256=6blZ2Y9G8mu1F3gV8SKndPE398t2VVFlsgKlyeJ765A,16538
|
|
8
|
-
mapFolding/reference/hunterNumba.py,sha256=HWndRgsajOf76rbb2LDNEZ6itsdYbyV-k3wgOFjeR6c,7104
|
|
9
|
-
mapFolding/reference/irvineJavaPort.py,sha256=Sj-63Z-OsGuDoEBXuxyjRrNmmyl0d7Yz_XuY7I47Oyg,4250
|
|
10
|
-
mapFolding/reference/jax.py,sha256=rojyK80lOATtbzxjGOHWHZngQa47CXCLJHZwIdN2MwI,14955
|
|
11
|
-
mapFolding/reference/lunnan.py,sha256=XEcql_gxvCCghb6Or3qwmPbn4IZUbZTaSmw_fUjRxZE,5037
|
|
12
|
-
mapFolding/reference/lunnanNumpy.py,sha256=HqDgSwTOZA-G0oophOEfc4zs25Mv4yw2aoF1v8miOLk,4653
|
|
13
|
-
mapFolding/reference/lunnanWhile.py,sha256=7NY2IKO5XBgol0aWWF_Fi-7oTL9pvu_z6lB0TF1uVHk,4063
|
|
14
|
-
mapFolding/reference/rotatedEntryPoint.py,sha256=z0QyDQtnMvXNj5ntWzzJUQUMFm1-xHGLVhtYzwmczUI,11530
|
|
15
|
-
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=usenM8Yn_G1dqlPl7NKKkcnbohBZVZBXTQRm2S3_EDA,8106
|
|
16
|
-
mapFolding/someAssemblyRequired/__init__.py,sha256=3JnAKXfaYPtmxV_4AnZ6KpCosT_0GFV5Nw7K8sz4-Uo,34
|
|
17
|
-
mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=FtJzw2pZS3A4NimWdZsegXaU-vKeCw8m67kcfb5wvGM,894
|
|
18
|
-
mapFolding/someAssemblyRequired/makeJob.py,sha256=uKonSGmE4ieTpfqmIiYvVW05F3YN70eiUYJi-bj6yR8,2622
|
|
19
|
-
mapFolding/someAssemblyRequired/synthesizeModuleJAX.py,sha256=43h_gOk0pCI8dITIRJ9_DBOwx4-KV5dQpw1MWRSoxE8,1355
|
|
20
|
-
mapFolding/someAssemblyRequired/synthesizeModuleJobNumba.py,sha256=TCYNNI19vCw0C1FLP691VPpYknkedj-zpx-xQFVIVJU,9851
|
|
21
|
-
mapFolding/someAssemblyRequired/synthesizeModulesNumba.py,sha256=EpIpJnCIZ6jQ0nwyw01ULM_55cAc0kM3YSLxRB2I5A0,25481
|
|
22
|
-
mapFolding/syntheticModules/__init__.py,sha256=cER6gqkGb3SCHHE35AVjf14_ehUroXPjlM6Ot-TIt5w,149
|
|
23
|
-
mapFolding/syntheticModules/numba_countInitialize.py,sha256=WTXIETx8EOncMRGzOJzDepoHkNCP25eaQAKfAIleaVs,4065
|
|
24
|
-
mapFolding/syntheticModules/numba_countParallel.py,sha256=lMf2dtSTPoVLHT5yXemdSiXPMbdCdXJvVdLgVf_SVxM,5493
|
|
25
|
-
mapFolding/syntheticModules/numba_countSequential.py,sha256=RjO4yAH9Qu0OJC6moECJ7JTDIRNXr5mlm6wrusGr-Og,3670
|
|
26
|
-
mapFolding/syntheticModules/numba_doTheNeedful.py,sha256=iUbjbIlvoa--fK6f2tiGjaHA93E1v5jSnJUakE_5UTg,2465
|
|
27
|
-
tests/__init__.py,sha256=eg9smg-6VblOr0kisM40CpGnuDtU2JgEEWGDTFVOlW8,57
|
|
28
|
-
tests/conftest.py,sha256=4KuPXvkgYDZKWhxZlwRgnoLynMvmlnGLK8j2iqTX_9E,9044
|
|
29
|
-
tests/conftest_tmpRegistry.py,sha256=0XpGe7s2aJcjdEAqKs10vceW0_JAaK-Rp1UoPaL-BIo,2450
|
|
30
|
-
tests/conftest_uniformTests.py,sha256=2v9UJbKgbrus3UyWXsanEHLksBskbnP0MD8iKVPaIBo,2178
|
|
31
|
-
tests/test_oeis.py,sha256=xIyU88nyEfeBK5TS4NfeBBy3YErgM1rGwVSu4ry-XrU,8491
|
|
32
|
-
tests/test_other.py,sha256=yHGhoZfKh_Z-MZHXZknHC_FBm3sS9Cntr94_L9LLLhQ,12151
|
|
33
|
-
tests/test_tasks.py,sha256=ap_tKjHUN95vjzKo3xzBAQ3kMbdMJ_XXbOv9YIBJ5pY,2826
|
|
34
|
-
tests/test_types.py,sha256=HklNCGThFiqQ89AOMkE7YkcfAPiZE32DpD3GMDUPQVc,177
|
|
35
|
-
mapFolding-0.3.9.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
36
|
-
mapFolding-0.3.9.dist-info/METADATA,sha256=NnN8fZG_zufvXSK5XC8Yrw0SmLwihDjFZlpIutqj-lc,7935
|
|
37
|
-
mapFolding-0.3.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
38
|
-
mapFolding-0.3.9.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
39
|
-
mapFolding-0.3.9.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
40
|
-
mapFolding-0.3.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|