mapFolding 0.4.1__py3-none-any.whl → 0.4.2__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/beDRY.py +69 -84
- mapFolding/someAssemblyRequired/synthesizeNumba.py +1 -0
- mapFolding/syntheticModules/numba_countInitialize.py +1 -1
- mapFolding/syntheticModules/numba_countParallel.py +3 -3
- mapFolding/syntheticModules/numba_countSequential.py +4 -4
- mapFolding/syntheticModules/numba_doTheNeedful.py +2 -2
- mapFolding/theDao.py +5 -2
- mapFolding/theSSOTnumba.py +0 -7
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/METADATA +1 -1
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/RECORD +15 -15
- tests/conftest.py +0 -30
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/LICENSE +0 -0
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/WHEEL +0 -0
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.4.1.dist-info → mapFolding-0.4.2.dist-info}/top_level.txt +0 -0
mapFolding/beDRY.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
from mapFolding import (
|
|
3
3
|
computationState,
|
|
4
4
|
getPathJobRootDEFAULT,
|
|
5
|
+
hackSSOTdatatype,
|
|
5
6
|
hackSSOTdtype,
|
|
6
7
|
indexMy,
|
|
7
8
|
indexTrack,
|
|
@@ -9,9 +10,9 @@ from mapFolding import (
|
|
|
9
10
|
setDatatypeFoldsTotal,
|
|
10
11
|
setDatatypeLeavesTotal,
|
|
11
12
|
)
|
|
12
|
-
from numpy import integer
|
|
13
|
+
from numpy import dtype, integer, ndarray
|
|
13
14
|
from numpy.typing import DTypeLike, NDArray
|
|
14
|
-
from typing import Any, List, Optional, Sequence, Tuple,
|
|
15
|
+
from typing import Any, List, Optional, Sequence, Tuple, Union
|
|
15
16
|
from Z0Z_tools import defineConcurrencyLimit, intInnit, oopsieKwargsie
|
|
16
17
|
import numba
|
|
17
18
|
import numpy
|
|
@@ -19,7 +20,7 @@ import os
|
|
|
19
20
|
import pathlib
|
|
20
21
|
import sys
|
|
21
22
|
|
|
22
|
-
def getFilenameFoldsTotal(mapShape: Union[Sequence[int],
|
|
23
|
+
def getFilenameFoldsTotal(mapShape: Union[Sequence[int], ndarray[Tuple[int], dtype[integer[Any]]]]) -> str:
|
|
23
24
|
"""Make a standardized filename for the computed value `foldsTotal`.
|
|
24
25
|
|
|
25
26
|
The filename takes into account
|
|
@@ -67,30 +68,29 @@ def getLeavesTotal(listDimensions: Sequence[int]) -> int:
|
|
|
67
68
|
|
|
68
69
|
return productDimensions
|
|
69
70
|
|
|
70
|
-
def getPathFilenameFoldsTotal(mapShape: Union[Sequence[int],
|
|
71
|
-
"""Get path for
|
|
71
|
+
def getPathFilenameFoldsTotal(mapShape: Union[Sequence[int], ndarray[Tuple[int], dtype[integer[Any]]]], pathLikeWriteFoldsTotal: Optional[Union[str, os.PathLike[str]]] = None) -> pathlib.Path:
|
|
72
|
+
"""Get a standardized path and filename for the computed value `foldsTotal`.
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
The function ensures the parent directory exists by creating it if necessary.
|
|
74
|
+
If you provide a directory, the function will append a standardized filename. If you provide a filename
|
|
75
|
+
or a relative path and filename, the function will prepend the default path.
|
|
76
76
|
|
|
77
77
|
Parameters:
|
|
78
|
-
mapShape
|
|
79
|
-
pathLikeWriteFoldsTotal (
|
|
80
|
-
the folds total. Can be a file path or directory path. If None, uses default path.
|
|
78
|
+
mapShape: List of dimensions for the map folding problem.
|
|
79
|
+
pathLikeWriteFoldsTotal (pathJobRootDEFAULT): Path, filename, or relative path and filename. If None, uses default path.
|
|
81
80
|
Defaults to None.
|
|
82
81
|
|
|
83
82
|
Returns:
|
|
84
|
-
|
|
83
|
+
pathFilenameFoldsTotal: Absolute path and filename.
|
|
85
84
|
"""
|
|
86
|
-
|
|
87
|
-
if
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
pathLikeSherpa = pathlib.Path(pathLikeWriteFoldsTotal) if pathLikeWriteFoldsTotal is not None else None
|
|
86
|
+
if not pathLikeSherpa:
|
|
87
|
+
pathLikeSherpa = getPathJobRootDEFAULT()
|
|
88
|
+
if pathLikeSherpa.is_dir():
|
|
89
|
+
pathFilenameFoldsTotal = pathLikeSherpa / getFilenameFoldsTotal(mapShape)
|
|
90
|
+
elif pathLikeSherpa.is_absolute():
|
|
91
|
+
pathFilenameFoldsTotal = pathLikeSherpa
|
|
92
92
|
else:
|
|
93
|
-
pathFilenameFoldsTotal =
|
|
93
|
+
pathFilenameFoldsTotal = getPathJobRootDEFAULT() / pathLikeSherpa
|
|
94
94
|
|
|
95
95
|
pathFilenameFoldsTotal.parent.mkdir(parents=True, exist_ok=True)
|
|
96
96
|
return pathFilenameFoldsTotal
|
|
@@ -107,23 +107,23 @@ def getTaskDivisions(computationDivisions: Optional[Union[int, str]], concurrenc
|
|
|
107
107
|
- int: direct set the number of task divisions; cannot exceed the map's total leaves
|
|
108
108
|
- "maximum": divides into `leavesTotal`-many `taskDivisions`
|
|
109
109
|
- "cpu": limits the divisions to the number of available CPUs, i.e. `concurrencyLimit`
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
concurrencyLimit:
|
|
111
|
+
Maximum number of concurrent tasks allowed
|
|
112
|
+
CPUlimit: for error reporting
|
|
113
|
+
listDimensions: for error reporting
|
|
114
114
|
|
|
115
115
|
Returns
|
|
116
116
|
-------
|
|
117
|
-
|
|
117
|
+
taskDivisions:
|
|
118
118
|
|
|
119
119
|
Raises
|
|
120
120
|
------
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
ValueError
|
|
122
|
+
If computationDivisions is an unsupported type or if resulting task divisions exceed total leaves
|
|
123
123
|
|
|
124
124
|
Notes
|
|
125
125
|
-----
|
|
126
|
-
Task divisions
|
|
126
|
+
Task divisions should not exceed total leaves to prevent duplicate counting of folds.
|
|
127
127
|
"""
|
|
128
128
|
taskDivisions = 0
|
|
129
129
|
leavesTotal = getLeavesTotal(listDimensions)
|
|
@@ -145,7 +145,7 @@ def getTaskDivisions(computationDivisions: Optional[Union[int, str]], concurrenc
|
|
|
145
145
|
|
|
146
146
|
return taskDivisions
|
|
147
147
|
|
|
148
|
-
def makeConnectionGraph(listDimensions: Sequence[int], **keywordArguments: Optional[
|
|
148
|
+
def makeConnectionGraph(listDimensions: Sequence[int], **keywordArguments: Optional[str]) -> ndarray[Tuple[int, int, int], dtype[integer[Any]]]:
|
|
149
149
|
"""
|
|
150
150
|
Constructs a multi-dimensional connection graph representing the connections between the leaves of a map with the given dimensions.
|
|
151
151
|
Also called a Cartesian product decomposition or dimensional product mapping.
|
|
@@ -157,21 +157,22 @@ def makeConnectionGraph(listDimensions: Sequence[int], **keywordArguments: Optio
|
|
|
157
157
|
Returns
|
|
158
158
|
connectionGraph: A 3D numpy array with shape of (dimensionsTotal, leavesTotal + 1, leavesTotal + 1).
|
|
159
159
|
"""
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
ImaSetTheDatatype = keywordArguments.get('datatype', None)
|
|
161
|
+
if ImaSetTheDatatype:
|
|
162
|
+
setDatatypeLeavesTotal(ImaSetTheDatatype)
|
|
163
|
+
dtype = hackSSOTdtype('connectionGraph')
|
|
163
164
|
mapShape = validateListDimensions(listDimensions)
|
|
164
165
|
leavesTotal = getLeavesTotal(mapShape)
|
|
165
|
-
arrayDimensions = numpy.array(mapShape, dtype=
|
|
166
|
+
arrayDimensions = numpy.array(mapShape, dtype=dtype)
|
|
166
167
|
dimensionsTotal = len(arrayDimensions)
|
|
167
168
|
|
|
168
|
-
cumulativeProduct = numpy.multiply.accumulate([1] + mapShape, dtype=
|
|
169
|
-
coordinateSystem = numpy.zeros((dimensionsTotal, leavesTotal + 1), dtype=
|
|
169
|
+
cumulativeProduct = numpy.multiply.accumulate([1] + mapShape, dtype=dtype)
|
|
170
|
+
coordinateSystem = numpy.zeros((dimensionsTotal, leavesTotal + 1), dtype=dtype)
|
|
170
171
|
for indexDimension in range(dimensionsTotal):
|
|
171
172
|
for leaf1ndex in range(1, leavesTotal + 1):
|
|
172
173
|
coordinateSystem[indexDimension, leaf1ndex] = ( ((leaf1ndex - 1) // cumulativeProduct[indexDimension]) % arrayDimensions[indexDimension] + 1 )
|
|
173
174
|
|
|
174
|
-
connectionGraph = numpy.zeros((dimensionsTotal, leavesTotal + 1, leavesTotal + 1), dtype=
|
|
175
|
+
connectionGraph = numpy.zeros((dimensionsTotal, leavesTotal + 1, leavesTotal + 1), dtype=dtype)
|
|
175
176
|
for indexDimension in range(dimensionsTotal):
|
|
176
177
|
for activeLeaf1ndex in range(1, leavesTotal + 1):
|
|
177
178
|
for connectee1ndex in range(1, activeLeaf1ndex + 1):
|
|
@@ -190,70 +191,54 @@ def makeConnectionGraph(listDimensions: Sequence[int], **keywordArguments: Optio
|
|
|
190
191
|
return connectionGraph
|
|
191
192
|
|
|
192
193
|
def makeDataContainer(shape: Union[int, Tuple[int, ...]], datatype: Optional[DTypeLike] = None) -> NDArray[integer[Any]]:
|
|
193
|
-
"""Create a zeroed-out `
|
|
194
|
+
"""Create a zeroed-out `ndarray` with the given shape and datatype.
|
|
194
195
|
|
|
195
196
|
Parameters:
|
|
196
|
-
shape
|
|
197
|
+
shape: The shape of the array. Can be an integer for 1D arrays
|
|
197
198
|
or a tuple of integers for multi-dimensional arrays.
|
|
198
|
-
datatype
|
|
199
|
+
datatype: The desired data type for the array.
|
|
199
200
|
If None, defaults to dtypeLargeDEFAULT. Defaults to None.
|
|
200
201
|
|
|
201
202
|
Returns:
|
|
202
|
-
|
|
203
|
+
dataContainer: A new array of given shape and type, filled with zeros.
|
|
203
204
|
"""
|
|
204
205
|
if datatype is None:
|
|
205
206
|
datatype = hackSSOTdtype('dtypeFoldsTotal')
|
|
206
207
|
return numpy.zeros(shape, dtype=datatype)
|
|
207
208
|
|
|
208
|
-
def outfitCountFolds(listDimensions: Sequence[int]
|
|
209
|
-
, computationDivisions: Optional[Union[int, str]] = None
|
|
210
|
-
, CPUlimit: Optional[Union[bool, float, int]] = None
|
|
211
|
-
, **keywordArguments: Optional[Union[str, bool]]) -> computationState:
|
|
209
|
+
def outfitCountFolds(listDimensions: Sequence[int], computationDivisions: Optional[Union[int, str]] = None, CPUlimit: Optional[Union[bool, float, int]] = None, **keywordArguments: Optional[Union[str, bool]]) -> computationState:
|
|
212
210
|
"""
|
|
213
211
|
Initializes and configures the computation state for map folding computations.
|
|
214
212
|
|
|
215
|
-
Parameters
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
Specifies how to divide computations:
|
|
221
|
-
- None: no division of the computation into tasks; sets task divisions to 0
|
|
222
|
-
- int: direct set the number of task divisions; cannot exceed the map's total leaves
|
|
223
|
-
- "maximum": divides into `leavesTotal`-many `taskDivisions`
|
|
224
|
-
- "cpu": limits the divisions to the number of available CPUs, i.e. `concurrencyLimit`
|
|
225
|
-
CPUlimit (None):
|
|
226
|
-
Whether and how to limit the CPU usage. See notes for details.
|
|
227
|
-
**keywordArguments:
|
|
228
|
-
Datatype management.
|
|
229
|
-
|
|
230
|
-
Returns
|
|
231
|
-
-------
|
|
232
|
-
computationState
|
|
233
|
-
An initialized computation state containing:
|
|
234
|
-
- connectionGraph: Graph representing connections in the map
|
|
235
|
-
- foldsSubTotals: Array tracking total folds
|
|
236
|
-
- mapShape: Validated and sorted dimensions of the map
|
|
237
|
-
- my: Array for internal state tracking
|
|
238
|
-
- gapsWhere: Array tracking gap positions
|
|
239
|
-
- the: Static settings and metadata
|
|
240
|
-
- track: Array for tracking computation progress
|
|
213
|
+
Parameters:
|
|
214
|
+
listDimensions: The dimensions of the map to be folded
|
|
215
|
+
computationDivisions (None): see `getTaskDivisions`
|
|
216
|
+
CPUlimit (None): see `setCPUlimit`
|
|
217
|
+
**keywordArguments: Datatype management.
|
|
241
218
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
- `True`: Yes, limit the CPU usage; limits to 1 CPU.
|
|
245
|
-
- Integer `>= 1`: Limits usage to the specified number of CPUs.
|
|
246
|
-
- Decimal value (`float`) between 0 and 1: Fraction of total CPUs to use.
|
|
247
|
-
- Decimal value (`float`) between -1 and 0: Fraction of CPUs to *not* use.
|
|
248
|
-
- Integer `<= -1`: Subtract the absolute value from total CPUs.
|
|
219
|
+
Returns:
|
|
220
|
+
stateInitialized: The initialized computation state
|
|
249
221
|
"""
|
|
250
|
-
kwourGrapes = keywordArguments.get('sourGrapes',
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
222
|
+
kwourGrapes = keywordArguments.get('sourGrapes', None)
|
|
223
|
+
if kwourGrapes:
|
|
224
|
+
sourGrapes = True
|
|
225
|
+
else:
|
|
226
|
+
sourGrapes = False
|
|
227
|
+
|
|
228
|
+
ImaSetTheDatatype = keywordArguments.get('datatypeElephino', None)
|
|
229
|
+
if ImaSetTheDatatype:
|
|
230
|
+
ImaSetTheDatatype = str(ImaSetTheDatatype)
|
|
231
|
+
setDatatypeElephino(ImaSetTheDatatype, sourGrapes)
|
|
232
|
+
|
|
233
|
+
ImaSetTheDatatype = keywordArguments.get('datatypeFoldsTotal', None)
|
|
234
|
+
if ImaSetTheDatatype:
|
|
235
|
+
ImaSetTheDatatype = str(ImaSetTheDatatype)
|
|
236
|
+
setDatatypeFoldsTotal(ImaSetTheDatatype, sourGrapes)
|
|
237
|
+
|
|
238
|
+
ImaSetTheDatatype = keywordArguments.get('datatypeLeavesTotal', None)
|
|
239
|
+
if ImaSetTheDatatype:
|
|
240
|
+
ImaSetTheDatatype = str(ImaSetTheDatatype)
|
|
241
|
+
setDatatypeLeavesTotal(ImaSetTheDatatype, sourGrapes)
|
|
257
242
|
|
|
258
243
|
my = makeDataContainer(len(indexMy), hackSSOTdtype('my'))
|
|
259
244
|
|
|
@@ -268,7 +253,7 @@ def outfitCountFolds(listDimensions: Sequence[int]
|
|
|
268
253
|
my[indexMy.dimensionsTotal] = len(mapShape)
|
|
269
254
|
my[indexMy.leaf1ndex] = 1
|
|
270
255
|
stateInitialized = computationState(
|
|
271
|
-
connectionGraph = makeConnectionGraph(mapShape, datatype=
|
|
256
|
+
connectionGraph = makeConnectionGraph(mapShape, datatype=hackSSOTdatatype('connectionGraph')),
|
|
272
257
|
foldGroups = foldGroups,
|
|
273
258
|
mapShape = numpy.array(mapShape, dtype=hackSSOTdtype('mapShape')),
|
|
274
259
|
my = my,
|
|
@@ -252,6 +252,7 @@ def makeAstModuleForOneCallable(pythonSource: str, callableTarget: str, paramete
|
|
|
252
252
|
if inlineCallables:
|
|
253
253
|
dictionaryFunctionDef = {statement.name: statement for statement in astModule.body if isinstance(statement, ast.FunctionDef)}
|
|
254
254
|
callableInlinerWorkhorse = RecursiveInliner(dictionaryFunctionDef)
|
|
255
|
+
# NOTE the inliner assumes each function is not called more than once
|
|
255
256
|
FunctionDefTarget = callableInlinerWorkhorse.inlineFunctionBody(callableTarget)
|
|
256
257
|
else:
|
|
257
258
|
FunctionDefTarget = next((node for node in astModule.body if isinstance(node, ast.FunctionDef) and node.name == callableTarget), None)
|
|
@@ -2,9 +2,9 @@ from mapFolding import indexMy
|
|
|
2
2
|
from mapFolding import indexTrack
|
|
3
3
|
from numba import jit
|
|
4
4
|
from numba import uint8
|
|
5
|
+
from numpy import dtype
|
|
5
6
|
from numpy import ndarray
|
|
6
7
|
from numpy import integer
|
|
7
|
-
from numpy import dtype
|
|
8
8
|
from typing import Tuple
|
|
9
9
|
from typing import Any
|
|
10
10
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from mapFolding import indexMy
|
|
2
2
|
from mapFolding import indexTrack
|
|
3
|
+
from numba import prange
|
|
4
|
+
from numba import int64
|
|
3
5
|
from numba import jit
|
|
4
6
|
from numba import uint8
|
|
5
|
-
from
|
|
6
|
-
from numba import prange
|
|
7
|
+
from numpy import dtype
|
|
7
8
|
from numpy import ndarray
|
|
8
9
|
from numpy import integer
|
|
9
|
-
from numpy import dtype
|
|
10
10
|
from typing import Tuple
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from mapFolding import indexMy
|
|
2
2
|
from mapFolding import indexTrack
|
|
3
|
+
from numba import int64
|
|
3
4
|
from numba import jit
|
|
4
5
|
from numba import uint8
|
|
5
|
-
from
|
|
6
|
+
from numpy import dtype
|
|
6
7
|
from numpy import ndarray
|
|
7
8
|
from numpy import integer
|
|
8
|
-
from numpy import dtype
|
|
9
9
|
from typing import Tuple
|
|
10
10
|
from typing import Any
|
|
11
11
|
|
|
@@ -34,10 +34,10 @@ def countSequential(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer
|
|
|
34
34
|
gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
|
|
35
35
|
indexDimension = 0
|
|
36
36
|
while indexDimension < dimensionsTotal:
|
|
37
|
-
|
|
37
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
38
|
+
if leafConnectee == leaf1ndex:
|
|
38
39
|
dimensionsUnconstrained -= 1
|
|
39
40
|
else:
|
|
40
|
-
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
41
41
|
while leafConnectee != leaf1ndex:
|
|
42
42
|
gapsWhere[gap1ndexCeiling] = leafConnectee
|
|
43
43
|
if countDimensionsGapped[leafConnectee] == 0:
|
|
@@ -2,12 +2,12 @@ from mapFolding.syntheticModules.numba_countInitialize import countInitialize
|
|
|
2
2
|
from mapFolding.syntheticModules.numba_countParallel import countParallel
|
|
3
3
|
from mapFolding.syntheticModules.numba_countSequential import countSequential
|
|
4
4
|
from mapFolding import indexMy
|
|
5
|
+
from numba import int64
|
|
5
6
|
from numba import jit
|
|
6
7
|
from numba import uint8
|
|
7
|
-
from
|
|
8
|
+
from numpy import dtype
|
|
8
9
|
from numpy import ndarray
|
|
9
10
|
from numpy import integer
|
|
10
|
-
from numpy import dtype
|
|
11
11
|
from typing import Tuple
|
|
12
12
|
from typing import Any
|
|
13
13
|
|
mapFolding/theDao.py
CHANGED
|
@@ -78,6 +78,9 @@ def leafConnecteeInitialization(connectionGraph: ndarray[Tuple[int, int, int], d
|
|
|
78
78
|
def leafConnecteeUpdate(connectionGraph: ndarray[Tuple[int, int, int], dtype[integer[Any]]], my: ndarray[Tuple[int], dtype[integer[Any]]], track: ndarray[Tuple[int, int], dtype[integer[Any]]]) -> None:
|
|
79
79
|
my[indexMy.leafConnectee.value] = connectionGraph[my[indexMy.indexDimension.value], my[indexMy.leaf1ndex.value], track[indexTrack.leafBelow.value, my[indexMy.leafConnectee.value]]]
|
|
80
80
|
|
|
81
|
+
def activeLeafConnectedToItself(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
82
|
+
return my[indexMy.leafConnectee.value] == my[indexMy.leaf1ndex.value]
|
|
83
|
+
|
|
81
84
|
def loopingLeavesConnectedToActiveLeaf(my: ndarray[Tuple[int], dtype[integer[Any]]]) -> Any:
|
|
82
85
|
return my[indexMy.leafConnectee.value] != my[indexMy.leaf1ndex.value]
|
|
83
86
|
|
|
@@ -195,10 +198,10 @@ def countSequential( connectionGraph: ndarray[Tuple[int, int, int], dtype[intege
|
|
|
195
198
|
else:
|
|
196
199
|
findGapsInitializeVariables(my=my, track=track)
|
|
197
200
|
while loopUpToDimensionsTotal(my=my):
|
|
198
|
-
|
|
201
|
+
leafConnecteeInitialization(connectionGraph=connectionGraph, my=my)
|
|
202
|
+
if activeLeafConnectedToItself(my=my):
|
|
199
203
|
dimensionsUnconstrainedDecrement(my=my)
|
|
200
204
|
else:
|
|
201
|
-
leafConnecteeInitialization(connectionGraph=connectionGraph, my=my)
|
|
202
205
|
while loopingLeavesConnectedToActiveLeaf(my=my):
|
|
203
206
|
countGaps(gapsWhere=gapsWhere, my=my, track=track)
|
|
204
207
|
leafConnecteeUpdate(connectionGraph=connectionGraph, my=my, track=track)
|
mapFolding/theSSOTnumba.py
CHANGED
|
@@ -18,23 +18,16 @@ Old notes that are not entirely accurate.
|
|
|
18
18
|
|
|
19
19
|
| **Option** | **Description** | **Why** | **Size** | **But** |
|
|
20
20
|
| ----------------------- | --------------------------------------------------- | --------------------- | --------------- | ------------------------ |
|
|
21
|
-
| `_dbg_extend_lifetimes` | Debug option to extend object lifetimes | Debugging | | |
|
|
22
|
-
| `_dbg_optnone` | Disable optimization for debugging | Debugging | | |
|
|
23
|
-
| `debug` | Enable debug mode with additional checks | Debugging | | |
|
|
24
21
|
| `no_rewrites` | Disable AST rewrites optimization | Debugging | | |
|
|
25
|
-
| `boundscheck` | Enable array bounds checking (slows execution) | Error checking | Larger | Slower |
|
|
26
22
|
| `error_model` | Divide by zero: kill or chill? | Error checking | ? | |
|
|
27
23
|
| `_nrt` | Enable No Runtime type checking | Startup speed | Smaller | No type protection |
|
|
28
|
-
| `fastmath` | Reduce float potential precision | Float speed | Smaller | Discriminatory, untested |
|
|
29
24
|
| `forceinline` | Force function inlining | Reduce function calls | Likely larger | |
|
|
30
|
-
| `forceobj` | Force object mode compilation | Inclusiveness | Larger | Slower execution |
|
|
31
25
|
| `inline` | Algorithmically choose inlining | Speed | Slightly larger | |
|
|
32
26
|
| `looplift` | Enable loop lifting optimization | Speed (if applicable) | Larger | Exclusionary |
|
|
33
27
|
| `no_cfunc_wrapper` | Disable C function wrapper generation | Size | Smaller | Exclusionary |
|
|
34
28
|
| `no_cpython_wrapper` | Disable Python C-API wrapper generation | Size | Smallest | Exclusionary |
|
|
35
29
|
|
|
36
30
|
"""
|
|
37
|
-
# NOTE Deepseek removed forceinline=True, inline='always'
|
|
38
31
|
# TODO try to implement all possible parameters, but use `NotRequired` for the more esoteric ones
|
|
39
32
|
class ParametersNumba(TypedDict):
|
|
40
33
|
_dbg_extend_lifetimes: NotRequired[bool]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
mapFolding/__init__.py,sha256=_YjoypHXmWLmEWwhFVgKO83Uf28ksesT9F73oJoAIPE,1323
|
|
2
2
|
mapFolding/basecamp.py,sha256=v0VCF_Zgm_XBHcz4bqblsxfHwAxZKgenW6um77quWLk,3751
|
|
3
|
-
mapFolding/beDRY.py,sha256=
|
|
3
|
+
mapFolding/beDRY.py,sha256=ejl-eIZTqAHCBNIND0pP_F9BxkPEWIlVXbCTk2Ki8x8,15751
|
|
4
4
|
mapFolding/oeis.py,sha256=3hv71o8bhckjY0nsSY5JTJ2LrpJcuhZ9j3mP6LWLIQc,11124
|
|
5
|
-
mapFolding/theDao.py,sha256=
|
|
5
|
+
mapFolding/theDao.py,sha256=vyln6gXdRp87Xhtuy31bjCpMv_8vL4KH6s1fH40V9oA,12832
|
|
6
6
|
mapFolding/theSSOT.py,sha256=QrEMPREjEbt1H8HcrM2Nm_hv7JsFWRG3lHdUU0Jrv-w,10238
|
|
7
|
-
mapFolding/theSSOTnumba.py,sha256=
|
|
7
|
+
mapFolding/theSSOTnumba.py,sha256=5jTbJyu9XASYC4eIoUj98eVKWdWyjZw-XF3V2GK8cLg,4445
|
|
8
8
|
mapFolding/reference/flattened.py,sha256=S6D9wiFTlbeoetEqaMLOcA-R22BHOzjqPRujffNxxUM,14875
|
|
9
9
|
mapFolding/reference/hunterNumba.py,sha256=jDS0ORHkIhcJ1rzA5hT49sZHKf3rgJOoGesUCcbKFFY,6054
|
|
10
10
|
mapFolding/reference/irvineJavaPort.py,sha256=7GvBU0tnS6wpFgkYad3465do9jBQW-2bYvbCYyABPHM,3341
|
|
@@ -18,25 +18,25 @@ mapFolding/someAssemblyRequired/__init__.py,sha256=wtec_hIz-AKz0_hGdXsWnCKTcCxdM
|
|
|
18
18
|
mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=nX8tghZClYt7zJd6RpZBXhE_h-CGRHOS17biqiEdf-o,855
|
|
19
19
|
mapFolding/someAssemblyRequired/makeJob.py,sha256=c9sTRUK90snTCcXCvs86VKBH6z_nt3OVFjNs_WgCoIg,2422
|
|
20
20
|
mapFolding/someAssemblyRequired/synthesizeModuleJAX.py,sha256=jatvtYhK5ZJK-YmCKATt7w3icFXXO79cZDAYVrU9bgA,1258
|
|
21
|
-
mapFolding/someAssemblyRequired/synthesizeNumba.py,sha256=
|
|
21
|
+
mapFolding/someAssemblyRequired/synthesizeNumba.py,sha256=3JF1FZwSB-dhLUM_pMy11dI4x1dnWOFQSfJytZHYl0M,17351
|
|
22
22
|
mapFolding/someAssemblyRequired/synthesizeNumbaGeneralized.py,sha256=k8IaCT74ZPhHyra0MbCRdt_5k0Ov3vJgXlN5tbLVnf4,13998
|
|
23
23
|
mapFolding/someAssemblyRequired/synthesizeNumbaJob.py,sha256=2sKZgc5kyyz2KaoApcazj_37UgBqAkxORFeROWWU5tk,9038
|
|
24
24
|
mapFolding/someAssemblyRequired/synthesizeNumbaModules.py,sha256=_iRXjMASB_BnYJeH8Rt7FlC-GE7lkZ1Hy292XTaUCu4,3785
|
|
25
25
|
mapFolding/syntheticModules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
mapFolding/syntheticModules/numba_countInitialize.py,sha256=
|
|
27
|
-
mapFolding/syntheticModules/numba_countParallel.py,sha256=
|
|
28
|
-
mapFolding/syntheticModules/numba_countSequential.py,sha256=
|
|
29
|
-
mapFolding/syntheticModules/numba_doTheNeedful.py,sha256=
|
|
26
|
+
mapFolding/syntheticModules/numba_countInitialize.py,sha256=9u-Skda9ntDxo_CiD5T4lUU1-Ts5GDZ33zs_Ybf77-Q,4274
|
|
27
|
+
mapFolding/syntheticModules/numba_countParallel.py,sha256=96-TDwLJgZhR9tFm2bqVDpk8TuWPx_2qFH7oNV78yUI,5517
|
|
28
|
+
mapFolding/syntheticModules/numba_countSequential.py,sha256=WCcPYnkyNpZS7SRMvx1A-IMIAFP5iHL9u9sj9gR8Yhw,3688
|
|
29
|
+
mapFolding/syntheticModules/numba_doTheNeedful.py,sha256=zBXDEN4DJTpCu_ho314-MWdS_08kP_vAgV-8sJDVgvo,1368
|
|
30
30
|
tests/__init__.py,sha256=eg9smg-6VblOr0kisM40CpGnuDtU2JgEEWGDTFVOlW8,57
|
|
31
|
-
tests/conftest.py,sha256=
|
|
31
|
+
tests/conftest.py,sha256=vH1BSOs8G6nIPWKFkSQFmX031IZqNFC4oiEia74mkHU,10554
|
|
32
32
|
tests/test_computations.py,sha256=qBha4IggMfr6ZH06W3M66enTA6PWsx8vkDp5eqYFM9M,4765
|
|
33
33
|
tests/test_oeis.py,sha256=31kdO1vnu2Lon43vM-YJVS4g40Ic03DWNER-cJcpxX4,4916
|
|
34
34
|
tests/test_other.py,sha256=u0vINT5EyVsXTNTR2DZIMpWCg4FH471jjHLRzC2JX7U,8351
|
|
35
35
|
tests/test_tasks.py,sha256=iq6_dh43JQkC2vAWXua0Xe915BKFGbvRJAkmbco854A,2389
|
|
36
36
|
tests/test_types.py,sha256=58tmPG9WOeGGAQbdQK_h_7t4SnENnZugH4WXlI8-L-M,171
|
|
37
|
-
mapFolding-0.4.
|
|
38
|
-
mapFolding-0.4.
|
|
39
|
-
mapFolding-0.4.
|
|
40
|
-
mapFolding-0.4.
|
|
41
|
-
mapFolding-0.4.
|
|
42
|
-
mapFolding-0.4.
|
|
37
|
+
mapFolding-0.4.2.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
38
|
+
mapFolding-0.4.2.dist-info/METADATA,sha256=EPivaT4-_Ygz9_DobQKBIigNnDkWtUq7vm6hJtYiDeQ,7633
|
|
39
|
+
mapFolding-0.4.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
40
|
+
mapFolding-0.4.2.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
41
|
+
mapFolding-0.4.2.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
42
|
+
mapFolding-0.4.2.dist-info/RECORD,,
|
tests/conftest.py
CHANGED
|
@@ -101,36 +101,6 @@ def makeDictionaryFoldsTotalKnown() -> Dict[Tuple[int,...], int]:
|
|
|
101
101
|
dimensions = settings['getMapShape'](n)
|
|
102
102
|
dimensions.sort()
|
|
103
103
|
dictionaryMapDimensionsToFoldsTotalKnown[tuple(dimensions)] = foldingsTotal
|
|
104
|
-
|
|
105
|
-
# Are we in a place that has jobs?
|
|
106
|
-
pathJobDEFAULT = getPathJobRootDEFAULT()
|
|
107
|
-
if pathJobDEFAULT.exists():
|
|
108
|
-
# Are there foldsTotal files?
|
|
109
|
-
for pathFilenameFoldsTotal in pathJobDEFAULT.rglob('*.foldsTotal'):
|
|
110
|
-
if pathFilenameFoldsTotal.is_file():
|
|
111
|
-
try:
|
|
112
|
-
listDimensions = eval(pathFilenameFoldsTotal.stem)
|
|
113
|
-
except Exception:
|
|
114
|
-
continue
|
|
115
|
-
# Are the dimensions in the dictionary?
|
|
116
|
-
if isinstance(listDimensions, list) and all(isinstance(dimension, int) for dimension in listDimensions):
|
|
117
|
-
listDimensions.sort()
|
|
118
|
-
if tuple(listDimensions) in dictionaryMapDimensionsToFoldsTotalKnown:
|
|
119
|
-
continue
|
|
120
|
-
# Are the contents a reasonably large integer?
|
|
121
|
-
try:
|
|
122
|
-
foldsTotal = pathFilenameFoldsTotal.read_text()
|
|
123
|
-
except Exception:
|
|
124
|
-
continue
|
|
125
|
-
# Why did I sincerely believe this would only be three lines of code?
|
|
126
|
-
if foldsTotal.isdigit():
|
|
127
|
-
foldsTotalInteger = int(foldsTotal)
|
|
128
|
-
if foldsTotalInteger > 85109616 * 10**3:
|
|
129
|
-
# You made it this far, so fuck it: put it in the dictionary
|
|
130
|
-
dictionaryMapDimensionsToFoldsTotalKnown[tuple(listDimensions)] = foldsTotalInteger
|
|
131
|
-
dictionaryMapDimensionsToFoldsTotalKnown[tuple(listDimensions)] = foldsTotalInteger
|
|
132
|
-
# The sunk-costs fallacy claims another victim!
|
|
133
|
-
|
|
134
104
|
return dictionaryMapDimensionsToFoldsTotalKnown
|
|
135
105
|
|
|
136
106
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|