mapFolding 0.7.1__py3-none-any.whl → 0.8.0__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 +77 -81
- mapFolding/noHomeYet.py +2 -2
- mapFolding/oeis.py +2 -2
- mapFolding/someAssemblyRequired/Z0Z_workbench.py +347 -30
- mapFolding/someAssemblyRequired/__init__.py +4 -3
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py +0 -1
- mapFolding/someAssemblyRequired/ingredientsNumba.py +87 -2
- mapFolding/someAssemblyRequired/synthesizeDataConverters.py +34 -52
- mapFolding/someAssemblyRequired/{synthesizeNumbaJob.py → synthesizeNumbaJobVESTIGIAL.py} +18 -21
- mapFolding/someAssemblyRequired/transformationTools.py +546 -208
- mapFolding/syntheticModules/numbaCount_doTheNeedful.py +197 -12
- mapFolding/theDao.py +23 -16
- mapFolding/theSSOT.py +28 -43
- {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/METADATA +6 -7
- mapfolding-0.8.0.dist-info/RECORD +41 -0
- {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/WHEEL +1 -1
- tests/conftest.py +2 -3
- tests/test_filesystem.py +0 -2
- tests/test_other.py +2 -3
- tests/test_tasks.py +0 -4
- mapFolding/someAssemblyRequired/synthesizeCountingFunctions.py +0 -7
- mapFolding/someAssemblyRequired/synthesizeNumba.py +0 -91
- mapFolding/someAssemblyRequired/synthesizeNumbaModules.py +0 -91
- mapFolding/someAssemblyRequired/whatWillBe.py +0 -357
- mapFolding/syntheticModules/__init__.py +0 -0
- mapFolding/syntheticModules/dataNamespaceFlattened.py +0 -30
- mapFolding/syntheticModules/multiprocessingCount_doTheNeedful.py +0 -216
- mapFolding/syntheticModules/numbaCount.py +0 -90
- mapFolding/syntheticModules/numbaCountSequential.py +0 -111
- mapFolding/syntheticModules/numba_doTheNeedful.py +0 -12
- mapfolding-0.7.1.dist-info/RECORD +0 -51
- /mapFolding/syntheticModules/{numbaCountExample.py → numbaCountHistoricalExample.py} +0 -0
- /mapFolding/syntheticModules/{numba_doTheNeedfulExample.py → numba_doTheNeedfulHistoricalExample.py} +0 -0
- {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/LICENSE +0 -0
- {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
from concurrent.futures import ProcessPoolExecutor
|
|
2
|
-
from mapFolding.theSSOT import ComputationState
|
|
3
|
-
import concurrent.futures
|
|
4
|
-
import copy
|
|
5
|
-
import multiprocessing
|
|
6
|
-
|
|
7
|
-
def activeLeafConnectedToItself(state: ComputationState) -> bool:
|
|
8
|
-
return state.leafConnectee == state.leaf1ndex
|
|
9
|
-
|
|
10
|
-
def activeLeafGreaterThan0(state: ComputationState) -> bool:
|
|
11
|
-
return state.leaf1ndex > 0
|
|
12
|
-
|
|
13
|
-
def activeLeafGreaterThanLeavesTotal(state: ComputationState) -> bool:
|
|
14
|
-
return state.leaf1ndex > state.leavesTotal
|
|
15
|
-
|
|
16
|
-
def activeLeafIsTheFirstLeaf(state: ComputationState) -> bool:
|
|
17
|
-
return state.leaf1ndex <= 1
|
|
18
|
-
|
|
19
|
-
def allDimensionsAreUnconstrained(state: ComputationState) -> bool:
|
|
20
|
-
return not state.dimensionsUnconstrained
|
|
21
|
-
|
|
22
|
-
def backtrack(state: ComputationState) -> ComputationState:
|
|
23
|
-
state.leaf1ndex -= 1
|
|
24
|
-
state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leafBelow[state.leaf1ndex]
|
|
25
|
-
state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leafAbove[state.leaf1ndex]
|
|
26
|
-
return state
|
|
27
|
-
|
|
28
|
-
def countGaps(state: ComputationState) -> ComputationState:
|
|
29
|
-
state.gapsWhere[state.gap1ndexCeiling] = state.leafConnectee
|
|
30
|
-
if state.countDimensionsGapped[state.leafConnectee] == 0:
|
|
31
|
-
state = incrementGap1ndexCeiling(state)
|
|
32
|
-
state.countDimensionsGapped[state.leafConnectee] += 1
|
|
33
|
-
return state
|
|
34
|
-
|
|
35
|
-
def decrementDimensionsUnconstrained(state: ComputationState) -> ComputationState:
|
|
36
|
-
state.dimensionsUnconstrained -= 1
|
|
37
|
-
return state
|
|
38
|
-
|
|
39
|
-
def dimensionsUnconstrainedCondition(state: ComputationState) -> bool:
|
|
40
|
-
return state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex] == state.leaf1ndex
|
|
41
|
-
|
|
42
|
-
def filterCommonGaps(state: ComputationState) -> ComputationState:
|
|
43
|
-
state.gapsWhere[state.gap1ndex] = state.gapsWhere[state.indexMiniGap]
|
|
44
|
-
if state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] == state.dimensionsUnconstrained:
|
|
45
|
-
state = incrementActiveGap(state)
|
|
46
|
-
state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] = 0
|
|
47
|
-
return state
|
|
48
|
-
|
|
49
|
-
def incrementActiveGap(state: ComputationState) -> ComputationState:
|
|
50
|
-
state.gap1ndex += 1
|
|
51
|
-
return state
|
|
52
|
-
|
|
53
|
-
def incrementGap1ndexCeiling(state: ComputationState) -> ComputationState:
|
|
54
|
-
state.gap1ndexCeiling += 1
|
|
55
|
-
return state
|
|
56
|
-
|
|
57
|
-
def incrementIndexDimension(state: ComputationState) -> ComputationState:
|
|
58
|
-
state.indexDimension += 1
|
|
59
|
-
return state
|
|
60
|
-
|
|
61
|
-
def incrementIndexMiniGap(state: ComputationState) -> ComputationState:
|
|
62
|
-
state.indexMiniGap += 1
|
|
63
|
-
return state
|
|
64
|
-
|
|
65
|
-
def initializeIndexMiniGap(state: ComputationState) -> ComputationState:
|
|
66
|
-
state.indexMiniGap = state.gap1ndex
|
|
67
|
-
return state
|
|
68
|
-
|
|
69
|
-
def initializeLeafConnectee(state: ComputationState) -> ComputationState:
|
|
70
|
-
state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex]
|
|
71
|
-
return state
|
|
72
|
-
|
|
73
|
-
def initializeVariablesToFindGaps(state: ComputationState) -> ComputationState:
|
|
74
|
-
state.dimensionsUnconstrained = state.dimensionsTotal
|
|
75
|
-
state.gap1ndexCeiling = state.gapRangeStart[state.leaf1ndex - 1]
|
|
76
|
-
state.indexDimension = 0
|
|
77
|
-
return state
|
|
78
|
-
|
|
79
|
-
def insertUnconstrainedLeaf(state: ComputationState) -> ComputationState:
|
|
80
|
-
indexLeaf = 0
|
|
81
|
-
while indexLeaf < state.leaf1ndex:
|
|
82
|
-
state.gapsWhere[state.gap1ndexCeiling] = indexLeaf
|
|
83
|
-
state.gap1ndexCeiling += 1
|
|
84
|
-
indexLeaf += 1
|
|
85
|
-
return state
|
|
86
|
-
|
|
87
|
-
def leafBelowSentinelIs1(state: ComputationState) -> bool:
|
|
88
|
-
return state.leafBelow[0] == 1
|
|
89
|
-
|
|
90
|
-
def loopingLeavesConnectedToActiveLeaf(state: ComputationState) -> bool:
|
|
91
|
-
return state.leafConnectee != state.leaf1ndex
|
|
92
|
-
|
|
93
|
-
def loopingToActiveGapCeiling(state: ComputationState) -> bool:
|
|
94
|
-
return state.indexMiniGap < state.gap1ndexCeiling
|
|
95
|
-
|
|
96
|
-
def loopUpToDimensionsTotal(state: ComputationState) -> bool:
|
|
97
|
-
return state.indexDimension < state.dimensionsTotal
|
|
98
|
-
|
|
99
|
-
def noGapsHere(state: ComputationState) -> bool:
|
|
100
|
-
return (state.leaf1ndex > 0) and (state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1])
|
|
101
|
-
|
|
102
|
-
def placeLeaf(state: ComputationState) -> ComputationState:
|
|
103
|
-
state.gap1ndex -= 1
|
|
104
|
-
state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
|
|
105
|
-
state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
|
|
106
|
-
state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leaf1ndex
|
|
107
|
-
state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
|
|
108
|
-
state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
|
|
109
|
-
state.leaf1ndex += 1
|
|
110
|
-
return state
|
|
111
|
-
|
|
112
|
-
def thereIsAnActiveLeaf(state: ComputationState) -> bool:
|
|
113
|
-
return state.leaf1ndex > 0
|
|
114
|
-
|
|
115
|
-
def thisIsMyTaskIndex(state: ComputationState) -> bool:
|
|
116
|
-
return (state.leaf1ndex != state.taskDivisions) or (state.leafConnectee % state.taskDivisions == state.taskIndex)
|
|
117
|
-
|
|
118
|
-
def updateLeafConnectee(state: ComputationState) -> ComputationState:
|
|
119
|
-
state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leafBelow[state.leafConnectee]]
|
|
120
|
-
return state
|
|
121
|
-
|
|
122
|
-
def countInitialize(state: ComputationState) -> ComputationState:
|
|
123
|
-
while activeLeafGreaterThan0(state):
|
|
124
|
-
if activeLeafIsTheFirstLeaf(state) or leafBelowSentinelIs1(state):
|
|
125
|
-
state = initializeVariablesToFindGaps(state)
|
|
126
|
-
while loopUpToDimensionsTotal(state):
|
|
127
|
-
state = initializeLeafConnectee(state)
|
|
128
|
-
if activeLeafConnectedToItself(state):
|
|
129
|
-
state = decrementDimensionsUnconstrained(state)
|
|
130
|
-
else:
|
|
131
|
-
while loopingLeavesConnectedToActiveLeaf(state):
|
|
132
|
-
state = countGaps(state)
|
|
133
|
-
state = updateLeafConnectee(state)
|
|
134
|
-
state = incrementIndexDimension(state)
|
|
135
|
-
if allDimensionsAreUnconstrained(state):
|
|
136
|
-
state = insertUnconstrainedLeaf(state)
|
|
137
|
-
state = initializeIndexMiniGap(state)
|
|
138
|
-
while loopingToActiveGapCeiling(state):
|
|
139
|
-
state = filterCommonGaps(state)
|
|
140
|
-
state = incrementIndexMiniGap(state)
|
|
141
|
-
if thereIsAnActiveLeaf(state):
|
|
142
|
-
state = placeLeaf(state)
|
|
143
|
-
if state.gap1ndex > 0:
|
|
144
|
-
break
|
|
145
|
-
return state
|
|
146
|
-
|
|
147
|
-
def countParallel(state: ComputationState) -> ComputationState:
|
|
148
|
-
while activeLeafGreaterThan0(state):
|
|
149
|
-
if activeLeafIsTheFirstLeaf(state) or leafBelowSentinelIs1(state):
|
|
150
|
-
if activeLeafGreaterThanLeavesTotal(state):
|
|
151
|
-
state.groupsOfFolds += 1
|
|
152
|
-
else:
|
|
153
|
-
state = initializeVariablesToFindGaps(state)
|
|
154
|
-
while loopUpToDimensionsTotal(state):
|
|
155
|
-
if dimensionsUnconstrainedCondition(state):
|
|
156
|
-
state = decrementDimensionsUnconstrained(state)
|
|
157
|
-
else:
|
|
158
|
-
state = initializeLeafConnectee(state)
|
|
159
|
-
while loopingLeavesConnectedToActiveLeaf(state):
|
|
160
|
-
if thisIsMyTaskIndex(state):
|
|
161
|
-
state = countGaps(state)
|
|
162
|
-
state = updateLeafConnectee(state)
|
|
163
|
-
state = incrementIndexDimension(state)
|
|
164
|
-
state = initializeIndexMiniGap(state)
|
|
165
|
-
while loopingToActiveGapCeiling(state):
|
|
166
|
-
state = filterCommonGaps(state)
|
|
167
|
-
state = incrementIndexMiniGap(state)
|
|
168
|
-
while noGapsHere(state):
|
|
169
|
-
state = backtrack(state)
|
|
170
|
-
if thereIsAnActiveLeaf(state):
|
|
171
|
-
state = placeLeaf(state)
|
|
172
|
-
state.foldGroups[state.taskIndex] = state.groupsOfFolds
|
|
173
|
-
return state
|
|
174
|
-
|
|
175
|
-
def countSequential(state: ComputationState) -> ComputationState:
|
|
176
|
-
while activeLeafGreaterThan0(state):
|
|
177
|
-
if activeLeafIsTheFirstLeaf(state) or leafBelowSentinelIs1(state):
|
|
178
|
-
if activeLeafGreaterThanLeavesTotal(state):
|
|
179
|
-
state.groupsOfFolds += 1
|
|
180
|
-
else:
|
|
181
|
-
state = initializeVariablesToFindGaps(state)
|
|
182
|
-
while loopUpToDimensionsTotal(state):
|
|
183
|
-
state = initializeLeafConnectee(state)
|
|
184
|
-
if activeLeafConnectedToItself(state):
|
|
185
|
-
state = decrementDimensionsUnconstrained(state)
|
|
186
|
-
else:
|
|
187
|
-
while loopingLeavesConnectedToActiveLeaf(state):
|
|
188
|
-
state = countGaps(state)
|
|
189
|
-
state = updateLeafConnectee(state)
|
|
190
|
-
state = incrementIndexDimension(state)
|
|
191
|
-
state = initializeIndexMiniGap(state)
|
|
192
|
-
while loopingToActiveGapCeiling(state):
|
|
193
|
-
state = filterCommonGaps(state)
|
|
194
|
-
state = incrementIndexMiniGap(state)
|
|
195
|
-
while noGapsHere(state):
|
|
196
|
-
state = backtrack(state)
|
|
197
|
-
if thereIsAnActiveLeaf(state):
|
|
198
|
-
state = placeLeaf(state)
|
|
199
|
-
state.foldGroups[state.taskIndex] = state.groupsOfFolds
|
|
200
|
-
return state
|
|
201
|
-
|
|
202
|
-
def doTheNeedful(state: ComputationState) -> ComputationState:
|
|
203
|
-
state = countInitialize(state)
|
|
204
|
-
if state.taskDivisions > 0:
|
|
205
|
-
multiprocessing.set_start_method('spawn')
|
|
206
|
-
dictionaryConcurrency: dict[int, concurrent.futures.Future[ComputationState]] = {}
|
|
207
|
-
with ProcessPoolExecutor() as concurrencyManager:
|
|
208
|
-
for indexSherpa in range(state.taskDivisions):
|
|
209
|
-
stateParallel = copy.deepcopy(state)
|
|
210
|
-
stateParallel.taskIndex = indexSherpa
|
|
211
|
-
dictionaryConcurrency[indexSherpa] = concurrencyManager.submit(countParallel, stateParallel)
|
|
212
|
-
for indexSherpa in range(state.taskDivisions):
|
|
213
|
-
state.foldGroups[indexSherpa] = dictionaryConcurrency[indexSherpa].result().foldGroups[indexSherpa]
|
|
214
|
-
return state
|
|
215
|
-
else:
|
|
216
|
-
return countSequential(state)
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
from import , ,
|
|
2
|
-
from mapFolding.theSSOT import ComputationState, ComputationState, ComputationState
|
|
3
|
-
import copy
|
|
4
|
-
|
|
5
|
-
@(ComputationState(ComputationState), _nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, no_cfunc_wrapper=True, no_cpython_wrapper=True, nopython=True, parallel=True)
|
|
6
|
-
def countParallel(statePARALLEL: ComputationState) -> ComputationState:
|
|
7
|
-
stateComplete = copy.deepcopy(statePARALLEL)
|
|
8
|
-
for indexSherpa in range(statePARALLEL.taskDivisions):
|
|
9
|
-
state = copy.deepcopy(statePARALLEL)
|
|
10
|
-
state.taskIndex = indexSherpa
|
|
11
|
-
while state.leaf1ndex > 0:
|
|
12
|
-
if state.leaf1ndex <= 1 or state.leafBelow[0] == 1:
|
|
13
|
-
if state.leaf1ndex > state.leavesTotal:
|
|
14
|
-
state.groupsOfFolds += 1
|
|
15
|
-
else:
|
|
16
|
-
state = state
|
|
17
|
-
while state.indexDimension < state.dimensionsTotal:
|
|
18
|
-
if state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex] == state.leaf1ndex:
|
|
19
|
-
state = state
|
|
20
|
-
else:
|
|
21
|
-
state = state
|
|
22
|
-
while state.leafConnectee != state.leaf1ndex:
|
|
23
|
-
if state.leaf1ndex != state.taskDivisions or state.leafConnectee % state.taskDivisions == state.taskIndex:
|
|
24
|
-
state = state
|
|
25
|
-
state = state
|
|
26
|
-
state = state
|
|
27
|
-
state = state
|
|
28
|
-
while state.indexMiniGap < state.gap1ndexCeiling:
|
|
29
|
-
state = state
|
|
30
|
-
state = state
|
|
31
|
-
while state.leaf1ndex > 0 and state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1]:
|
|
32
|
-
state = state
|
|
33
|
-
if state.leaf1ndex > 0:
|
|
34
|
-
state = state
|
|
35
|
-
stateComplete.foldGroups[state.taskIndex] = state.groupsOfFolds
|
|
36
|
-
return stateComplete
|
|
37
|
-
|
|
38
|
-
@(ComputationState(ComputationState), _nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, no_cfunc_wrapper=True, no_cpython_wrapper=True, nopython=True, parallel=False)
|
|
39
|
-
def countSequential(state: ComputationState) -> ComputationState:
|
|
40
|
-
while state.leaf1ndex > 0:
|
|
41
|
-
if state.leaf1ndex <= 1 or state.leafBelow[0] == 1:
|
|
42
|
-
if state.leaf1ndex > state.leavesTotal:
|
|
43
|
-
state.groupsOfFolds += 1
|
|
44
|
-
else:
|
|
45
|
-
state = state
|
|
46
|
-
while state.indexDimension < state.dimensionsTotal:
|
|
47
|
-
state = state
|
|
48
|
-
if state.leafConnectee == state.leaf1ndex:
|
|
49
|
-
state = state
|
|
50
|
-
else:
|
|
51
|
-
while state.leafConnectee != state.leaf1ndex:
|
|
52
|
-
state = state
|
|
53
|
-
state = state
|
|
54
|
-
state = state
|
|
55
|
-
state = state
|
|
56
|
-
while state.indexMiniGap < state.gap1ndexCeiling:
|
|
57
|
-
state = state
|
|
58
|
-
state = state
|
|
59
|
-
while state.leaf1ndex > 0 and state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1]:
|
|
60
|
-
state = state
|
|
61
|
-
if state.leaf1ndex > 0:
|
|
62
|
-
state = state
|
|
63
|
-
state.foldGroups[state.taskIndex] = state.groupsOfFolds
|
|
64
|
-
return state
|
|
65
|
-
|
|
66
|
-
@(ComputationState(ComputationState), _nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, no_cfunc_wrapper=False, no_cpython_wrapper=False, nopython=True, parallel=False)
|
|
67
|
-
def countInitialize(state: ComputationState) -> ComputationState:
|
|
68
|
-
while state.leaf1ndex > 0:
|
|
69
|
-
if state.leaf1ndex <= 1 or state.leafBelow[0] == 1:
|
|
70
|
-
state = state
|
|
71
|
-
while state.indexDimension < state.dimensionsTotal:
|
|
72
|
-
state = state
|
|
73
|
-
if state.leafConnectee == state.leaf1ndex:
|
|
74
|
-
state = state
|
|
75
|
-
else:
|
|
76
|
-
while state.leafConnectee != state.leaf1ndex:
|
|
77
|
-
state = state
|
|
78
|
-
state = state
|
|
79
|
-
state = state
|
|
80
|
-
if not state.dimensionsUnconstrained:
|
|
81
|
-
state = state
|
|
82
|
-
state = state
|
|
83
|
-
while state.indexMiniGap < state.gap1ndexCeiling:
|
|
84
|
-
state = state
|
|
85
|
-
state = state
|
|
86
|
-
if state.leaf1ndex > 0:
|
|
87
|
-
state = state
|
|
88
|
-
if state.gap1ndex > 0:
|
|
89
|
-
break
|
|
90
|
-
return state
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
from mapFolding.theDao import countInitialize, doTheNeedful
|
|
2
|
-
from mapFolding.theSSOT import Array1DElephino, Array1DLeavesTotal, Array3D, ComputationState, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal
|
|
3
|
-
from numba import jit
|
|
4
|
-
|
|
5
|
-
@jit(_nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, nopython=True, parallel=False)
|
|
6
|
-
def countSequential(
|
|
7
|
-
connectionGraph: Array3D,
|
|
8
|
-
countDimensionsGapped: Array1DLeavesTotal,
|
|
9
|
-
dimensionsTotal: DatatypeLeavesTotal,
|
|
10
|
-
dimensionsUnconstrained: DatatypeLeavesTotal,
|
|
11
|
-
gap1ndex: DatatypeLeavesTotal,
|
|
12
|
-
gap1ndexCeiling: DatatypeElephino,
|
|
13
|
-
gapRangeStart: Array1DElephino,
|
|
14
|
-
gapsWhere: Array1DLeavesTotal,
|
|
15
|
-
groupsOfFolds: DatatypeFoldsTotal,
|
|
16
|
-
indexDimension: DatatypeLeavesTotal,
|
|
17
|
-
indexMiniGap: DatatypeElephino,
|
|
18
|
-
leaf1ndex: DatatypeElephino,
|
|
19
|
-
leafAbove: Array1DLeavesTotal,
|
|
20
|
-
leafBelow: Array1DLeavesTotal,
|
|
21
|
-
leafConnectee: DatatypeElephino,
|
|
22
|
-
leavesTotal: DatatypeLeavesTotal,
|
|
23
|
-
) -> DatatypeFoldsTotal:
|
|
24
|
-
|
|
25
|
-
while leaf1ndex > 0:
|
|
26
|
-
if leaf1ndex <= 1 or leafBelow[0] == 1:
|
|
27
|
-
if leaf1ndex > leavesTotal:
|
|
28
|
-
groupsOfFolds += 1
|
|
29
|
-
else:
|
|
30
|
-
dimensionsUnconstrained = dimensionsTotal
|
|
31
|
-
gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
|
|
32
|
-
indexDimension = 0
|
|
33
|
-
while indexDimension < dimensionsTotal:
|
|
34
|
-
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
35
|
-
if leafConnectee == leaf1ndex:
|
|
36
|
-
dimensionsUnconstrained -= 1
|
|
37
|
-
else:
|
|
38
|
-
while leafConnectee != leaf1ndex:
|
|
39
|
-
gapsWhere[gap1ndexCeiling] = leafConnectee
|
|
40
|
-
if countDimensionsGapped[leafConnectee] == 0:
|
|
41
|
-
gap1ndexCeiling += 1
|
|
42
|
-
countDimensionsGapped[leafConnectee] += 1
|
|
43
|
-
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
|
|
44
|
-
indexDimension += 1
|
|
45
|
-
indexMiniGap = gap1ndex
|
|
46
|
-
while indexMiniGap < gap1ndexCeiling:
|
|
47
|
-
gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
|
|
48
|
-
if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
|
|
49
|
-
gap1ndex += 1
|
|
50
|
-
countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
|
|
51
|
-
indexMiniGap += 1
|
|
52
|
-
while leaf1ndex > 0 and gap1ndex == gapRangeStart[leaf1ndex - 1]:
|
|
53
|
-
leaf1ndex -= 1
|
|
54
|
-
leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
|
|
55
|
-
leafAbove[leafBelow[leaf1ndex]] = leafAbove[leaf1ndex]
|
|
56
|
-
if leaf1ndex > 0:
|
|
57
|
-
gap1ndex -= 1
|
|
58
|
-
leafAbove[leaf1ndex] = gapsWhere[gap1ndex]
|
|
59
|
-
leafBelow[leaf1ndex] = leafBelow[leafAbove[leaf1ndex]]
|
|
60
|
-
leafBelow[leafAbove[leaf1ndex]] = leaf1ndex
|
|
61
|
-
leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
|
|
62
|
-
gapRangeStart[leaf1ndex] = gap1ndex
|
|
63
|
-
leaf1ndex += 1
|
|
64
|
-
return groupsOfFolds
|
|
65
|
-
|
|
66
|
-
def flattenData(state: ComputationState) -> ComputationState:
|
|
67
|
-
|
|
68
|
-
if state.taskDivisions > 0:
|
|
69
|
-
return doTheNeedful(state)
|
|
70
|
-
|
|
71
|
-
state = countInitialize(state)
|
|
72
|
-
|
|
73
|
-
connectionGraph: Array3D = state.connectionGraph
|
|
74
|
-
countDimensionsGapped: Array1DLeavesTotal = state.countDimensionsGapped
|
|
75
|
-
dimensionsTotal: DatatypeLeavesTotal = state.dimensionsTotal
|
|
76
|
-
dimensionsUnconstrained: DatatypeLeavesTotal = state.dimensionsUnconstrained
|
|
77
|
-
gap1ndex: DatatypeLeavesTotal = state.gap1ndex
|
|
78
|
-
gap1ndexCeiling: DatatypeElephino = state.gap1ndexCeiling
|
|
79
|
-
gapRangeStart: Array1DElephino = state.gapRangeStart
|
|
80
|
-
gapsWhere: Array1DLeavesTotal = state.gapsWhere
|
|
81
|
-
groupsOfFolds: DatatypeFoldsTotal = state.groupsOfFolds
|
|
82
|
-
indexDimension: DatatypeLeavesTotal = state.indexDimension
|
|
83
|
-
indexMiniGap: DatatypeElephino = state.indexMiniGap
|
|
84
|
-
leaf1ndex: DatatypeElephino = state.leaf1ndex
|
|
85
|
-
leafAbove: Array1DLeavesTotal = state.leafAbove
|
|
86
|
-
leafBelow: Array1DLeavesTotal = state.leafBelow
|
|
87
|
-
leafConnectee: DatatypeElephino = state.leafConnectee
|
|
88
|
-
leavesTotal: DatatypeLeavesTotal = state.leavesTotal
|
|
89
|
-
|
|
90
|
-
groupsOfFolds = countSequential(
|
|
91
|
-
connectionGraph = connectionGraph,
|
|
92
|
-
countDimensionsGapped = countDimensionsGapped,
|
|
93
|
-
dimensionsTotal = dimensionsTotal,
|
|
94
|
-
dimensionsUnconstrained = dimensionsUnconstrained,
|
|
95
|
-
gap1ndex = gap1ndex,
|
|
96
|
-
gap1ndexCeiling = gap1ndexCeiling,
|
|
97
|
-
gapRangeStart = gapRangeStart,
|
|
98
|
-
gapsWhere = gapsWhere,
|
|
99
|
-
groupsOfFolds = groupsOfFolds,
|
|
100
|
-
indexDimension = indexDimension,
|
|
101
|
-
indexMiniGap = indexMiniGap,
|
|
102
|
-
leaf1ndex = leaf1ndex,
|
|
103
|
-
leafAbove = leafAbove,
|
|
104
|
-
leafBelow = leafBelow,
|
|
105
|
-
leafConnectee = leafConnectee,
|
|
106
|
-
leavesTotal = leavesTotal,
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
state.groupsOfFolds = state.foldGroups[state.taskIndex] = groupsOfFolds
|
|
110
|
-
|
|
111
|
-
return state
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from import
|
|
2
|
-
from mapFolding.syntheticModules.numbaCount import countInitialize, countParallel, countSequential
|
|
3
|
-
from mapFolding.theSSOT import ComputationState
|
|
4
|
-
import copy
|
|
5
|
-
|
|
6
|
-
@(ComputationState(ComputationState), _nrt=True, boundscheck=False, cache=True, error_model='numpy', fastmath=True, forceinline=True, inline='always', looplift=False, no_cfunc_wrapper=False, no_cpython_wrapper=False, nopython=True, parallel=False)
|
|
7
|
-
def doTheNeedful(computationStateInitialized: ComputationState) -> ComputationState:
|
|
8
|
-
computationStateInitialized = countInitialize(computationStateInitialized)
|
|
9
|
-
if computationStateInitialized.taskDivisions > 0:
|
|
10
|
-
return countParallel(computationStateInitialized)
|
|
11
|
-
else:
|
|
12
|
-
return countSequential(computationStateInitialized)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
mapFolding/__init__.py,sha256=hONqdWnBN1ebgrKZuMIZfI8m-1krSR66L4GTVRwBmw4,203
|
|
2
|
-
mapFolding/basecamp.py,sha256=Ik_oH-MpH8f6k-yBzwm99lfkv3pMDgFFEnSSDyiJjsQ,3861
|
|
3
|
-
mapFolding/beDRY.py,sha256=Icgj8s6Rgd_oIBdvzwr6dovywdvG3sIVELO-n74W-So,9011
|
|
4
|
-
mapFolding/filesystem.py,sha256=KqgsO-jaSWAlYib_9ovoXQY76PcQri09_73u0OqMWC8,4094
|
|
5
|
-
mapFolding/noHomeYet.py,sha256=HjxLP-7BGVkKL66T50q4BWnC0Cg2gHUeCKMFuwR2mEQ,785
|
|
6
|
-
mapFolding/oeis.py,sha256=xqnL_VyhwRBET-Kdpnf59K5W5metGbW0JiufTlVw7g0,11853
|
|
7
|
-
mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
mapFolding/theDao.py,sha256=eQvR6lDMW_dI6qhZmkTqv-Eog79ekfQjap9rg8cavE8,8629
|
|
9
|
-
mapFolding/theSSOT.py,sha256=fWEkYyCoioi_jJzu2Qwi11GBIyXBbjcFfKAf3tlL9Aw,13270
|
|
10
|
-
mapFolding/reference/flattened.py,sha256=S6D9wiFTlbeoetEqaMLOcA-R22BHOzjqPRujffNxxUM,14875
|
|
11
|
-
mapFolding/reference/hunterNumba.py,sha256=jDS0ORHkIhcJ1rzA5hT49sZHKf3rgJOoGesUCcbKFFY,6054
|
|
12
|
-
mapFolding/reference/irvineJavaPort.py,sha256=7GvBU0tnS6wpFgkYad3465do9jBQW-2bYvbCYyABPHM,3341
|
|
13
|
-
mapFolding/reference/jax.py,sha256=7ji9YWia6Kof0cjcNdiS1GG1rMbC5SBjcyVr_07AeUk,13845
|
|
14
|
-
mapFolding/reference/lunnan.py,sha256=iAbJELfW6RKNMdPcBY9b6rGQ-z1zoRf-1XCurCRMOo8,3951
|
|
15
|
-
mapFolding/reference/lunnanNumpy.py,sha256=rwVP3WIDXimpAuaxhRIuBYU56nVDTKlfGiclw_FkgUU,3765
|
|
16
|
-
mapFolding/reference/lunnanWhile.py,sha256=uRrMT23jTJvoQDlD_FzeIQe_pfMXJG6_bRvs7uhC8z0,3271
|
|
17
|
-
mapFolding/reference/rotatedEntryPoint.py,sha256=USZY3n3zwhSE68ATscUuN66t1qShuEbMI790Gz9JFTw,9352
|
|
18
|
-
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=wpgay-uqPOBd64Z4Pg6tg40j7-4pzWHGMM6v0bnmjhE,6288
|
|
19
|
-
mapFolding/someAssemblyRequired/Z0Z_workbench.py,sha256=XibNQRbX5gGfrkWVfRsW66kHlqphcqVCPz7TyJFcs90,1505
|
|
20
|
-
mapFolding/someAssemblyRequired/__init__.py,sha256=pYkG-1LM8emzTeQbGtOfiZsAiklm5DU92-WE63qB-9s,602
|
|
21
|
-
mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=sGDzg5HG21Q42M0upRD1NWzOUsd7mZ_9wUKJIQHI13o,1000
|
|
22
|
-
mapFolding/someAssemblyRequired/ingredientsNumba.py,sha256=HnWgo1KwIoevUrE5A1WZh4AVFXKQllt8L6RL46JTXEg,2787
|
|
23
|
-
mapFolding/someAssemblyRequired/synthesizeCountingFunctions.py,sha256=77iNPPsN8BmwHaYKdXcDKCwoZKS1g41CJNenQB0W-eg,252
|
|
24
|
-
mapFolding/someAssemblyRequired/synthesizeDataConverters.py,sha256=czo6Y0ABlwye01ShumObAFtkTn7PBx4Qsh9Jna5BMUw,6187
|
|
25
|
-
mapFolding/someAssemblyRequired/synthesizeNumba.py,sha256=cKXvp0BxmYayUBMQ2RJLkVoJUSvzPI1S4Wy_APRM5cI,4788
|
|
26
|
-
mapFolding/someAssemblyRequired/synthesizeNumbaJob.py,sha256=w7zLUzLrLXf2N6O75jKvXDoyTJemWB8GOdK4ryqSWbs,22700
|
|
27
|
-
mapFolding/someAssemblyRequired/synthesizeNumbaModules.py,sha256=zUclYPmAr6X5qFO3nQK1_HHqdiRq6j3EIBXjeax_b8c,4388
|
|
28
|
-
mapFolding/someAssemblyRequired/transformationTools.py,sha256=QAheMJgYWI09PBetyhnJqNhJk_hl6Zlu1TBbDjBwFSs,21001
|
|
29
|
-
mapFolding/someAssemblyRequired/whatWillBe.py,sha256=G_r1VD106gTZISyiwhuJosREfRzQd73JLAMpYg8F6O8,14641
|
|
30
|
-
mapFolding/syntheticModules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
mapFolding/syntheticModules/dataNamespaceFlattened.py,sha256=vsU4PDEMoEcZ424AzsXOJoXoVlX_bSk-pXSTlDsSN9k,2939
|
|
32
|
-
mapFolding/syntheticModules/multiprocessingCount_doTheNeedful.py,sha256=JwZzvF79mvuo2E0Lfs0NeY1QR6JP8FRuwUaRmENwDs8,8482
|
|
33
|
-
mapFolding/syntheticModules/numbaCount.py,sha256=znFV9RhZ0WqPA-r-DT92WDgZXUyhdQlrsKmnsGySuKc,4561
|
|
34
|
-
mapFolding/syntheticModules/numbaCountExample.py,sha256=Oo0Xeex89sLD15iRt3N76OKRFScKl9qwO84-d5sv6lM,11871
|
|
35
|
-
mapFolding/syntheticModules/numbaCountSequential.py,sha256=CtSA3UX2JzoN_uSo0SH7E3coKuHBWaTloQZwbExIPBw,4325
|
|
36
|
-
mapFolding/syntheticModules/numbaCount_doTheNeedful.py,sha256=J9wZ9PW5EVduOQWVze7CgpTHkUjRIvBPG8fNuT3IVpA,1145
|
|
37
|
-
mapFolding/syntheticModules/numba_doTheNeedful.py,sha256=8kgV2GGjy_nxVi9o_aAtrZzRSxsYr8HVNsVXesf4Kec,767
|
|
38
|
-
mapFolding/syntheticModules/numba_doTheNeedfulExample.py,sha256=J9wZ9PW5EVduOQWVze7CgpTHkUjRIvBPG8fNuT3IVpA,1145
|
|
39
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
tests/conftest.py,sha256=oPc1IS4RXhLQIBskhuawi4GEWhy6kXbM6D2MdX9kDhw,10833
|
|
41
|
-
tests/test_computations.py,sha256=YhadlskBh_r5RiefHRy0FlrYQ0FelYbqcSNNSkSJMIY,3368
|
|
42
|
-
tests/test_filesystem.py,sha256=7Ova6f4R6lI9rwnnu8SkZgficTYlKEhSzLp-nBRWESM,3183
|
|
43
|
-
tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
|
|
44
|
-
tests/test_other.py,sha256=CS64h5NACYmXhG3owBpPDcXv3BpYlXNeLqPcqT4quwg,4303
|
|
45
|
-
tests/test_tasks.py,sha256=K5WdCtsM8ghFHX_BMmATsNUTvCICoTHtU-K73QBA4gY,3048
|
|
46
|
-
mapfolding-0.7.1.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
47
|
-
mapfolding-0.7.1.dist-info/METADATA,sha256=czJ_D8mDCOZg1ug6kaIvrwMTKJKh2zfk7Q3FWLJcs6U,7696
|
|
48
|
-
mapfolding-0.7.1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
49
|
-
mapfolding-0.7.1.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
50
|
-
mapfolding-0.7.1.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
51
|
-
mapfolding-0.7.1.dist-info/RECORD,,
|
|
File without changes
|
/mapFolding/syntheticModules/{numba_doTheNeedfulExample.py → numba_doTheNeedfulHistoricalExample.py}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|