mapFolding 0.11.1__py3-none-any.whl → 0.11.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/__init__.py +18 -58
- mapFolding/basecamp.py +13 -10
- mapFolding/beDRY.py +113 -2
- mapFolding/dataBaskets.py +24 -2
- mapFolding/{toolboxFilesystem.py → filesystemToolkit.py} +3 -3
- mapFolding/infoBooth.py +96 -0
- mapFolding/oeis.py +3 -2
- mapFolding/someAssemblyRequired/RecipeJob.py +3 -4
- mapFolding/someAssemblyRequired/Z0Z_makeSomeModules.py +182 -17
- mapFolding/someAssemblyRequired/__init__.py +3 -3
- mapFolding/someAssemblyRequired/_toolIfThis.py +5 -5
- mapFolding/someAssemblyRequired/{_toolboxContainers.py → _toolkitContainers.py} +6 -7
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +8 -7
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +3 -2
- mapFolding/someAssemblyRequired/transformationTools.py +11 -10
- mapFolding/syntheticModules/countParallel.py +98 -0
- mapFolding/syntheticModules/dataPacking.py +1 -1
- mapFolding/syntheticModules/numbaCount.py +189 -188
- mapFolding/theDao.py +1 -1
- mapFolding/theSSOT.py +4 -243
- {mapfolding-0.11.1.dist-info → mapfolding-0.11.2.dist-info}/METADATA +16 -8
- mapfolding-0.11.2.dist-info/RECORD +56 -0
- {mapfolding-0.11.1.dist-info → mapfolding-0.11.2.dist-info}/WHEEL +1 -1
- tests/conftest.py +7 -9
- tests/test_computations.py +1 -1
- tests/test_filesystem.py +1 -2
- tests/test_other.py +1 -1
- tests/test_tasks.py +1 -3
- mapfolding-0.11.1.dist-info/RECORD +0 -54
- /mapFolding/someAssemblyRequired/{toolboxNumba.py → toolkitNumba.py} +0 -0
- {mapfolding-0.11.1.dist-info → mapfolding-0.11.2.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.11.1.dist-info → mapfolding-0.11.2.dist-info}/licenses/LICENSE +0 -0
- {mapfolding-0.11.1.dist-info → mapfolding-0.11.2.dist-info}/top_level.txt +0 -0
|
@@ -1,201 +1,202 @@
|
|
|
1
1
|
from concurrent.futures import Future as ConcurrentFuture, ProcessPoolExecutor
|
|
2
2
|
from copy import deepcopy
|
|
3
|
-
from mapFolding
|
|
3
|
+
from mapFolding import ComputationState
|
|
4
|
+
from mapFolding import Array1DElephino, Array1DFoldsTotal, Array1DLeavesTotal, Array3D, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal
|
|
4
5
|
from numba import jit
|
|
5
6
|
|
|
6
7
|
def countInitialize(state: ComputationState) -> ComputationState:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
8
|
+
while state.gap1ndex == 0:
|
|
9
|
+
if state.leaf1ndex <= 1 or state.leafBelow[0] == 1:
|
|
10
|
+
state.dimensionsUnconstrained = state.dimensionsTotal
|
|
11
|
+
state.gap1ndexCeiling = state.gapRangeStart[state.leaf1ndex - 1]
|
|
12
|
+
state.indexDimension = 0
|
|
13
|
+
while state.indexDimension < state.dimensionsTotal:
|
|
14
|
+
state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex]
|
|
15
|
+
if state.leafConnectee == state.leaf1ndex:
|
|
16
|
+
state.dimensionsUnconstrained -= 1
|
|
17
|
+
else:
|
|
18
|
+
while state.leafConnectee != state.leaf1ndex:
|
|
19
|
+
state.gapsWhere[state.gap1ndexCeiling] = state.leafConnectee
|
|
20
|
+
if state.countDimensionsGapped[state.leafConnectee] == 0:
|
|
21
|
+
state.gap1ndexCeiling += 1
|
|
22
|
+
state.countDimensionsGapped[state.leafConnectee] += 1
|
|
23
|
+
state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leafBelow[state.leafConnectee]]
|
|
24
|
+
state.indexDimension += 1
|
|
25
|
+
if not state.dimensionsUnconstrained:
|
|
26
|
+
state.indexLeaf = 0
|
|
27
|
+
while state.indexLeaf < state.leaf1ndex:
|
|
28
|
+
state.gapsWhere[state.gap1ndexCeiling] = state.indexLeaf
|
|
29
|
+
state.gap1ndexCeiling += 1
|
|
30
|
+
state.indexLeaf += 1
|
|
31
|
+
state.indexMiniGap = state.gap1ndex
|
|
32
|
+
while state.indexMiniGap < state.gap1ndexCeiling:
|
|
33
|
+
state.gapsWhere[state.gap1ndex] = state.gapsWhere[state.indexMiniGap]
|
|
34
|
+
if state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] == state.dimensionsUnconstrained:
|
|
35
|
+
state.gap1ndex += 1
|
|
36
|
+
state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] = 0
|
|
37
|
+
state.indexMiniGap += 1
|
|
38
|
+
if state.leaf1ndex > 0:
|
|
39
|
+
state.gap1ndex -= 1
|
|
40
|
+
state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
|
|
41
|
+
state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
|
|
42
|
+
state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leaf1ndex
|
|
43
|
+
state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
|
|
44
|
+
state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
|
|
45
|
+
state.leaf1ndex += 1
|
|
46
|
+
return state
|
|
46
47
|
|
|
47
48
|
@jit(_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)
|
|
48
49
|
def countParallel(leavesTotal: DatatypeLeavesTotal, taskDivisions: DatatypeLeavesTotal, connectionGraph: Array3D, dimensionsTotal: DatatypeLeavesTotal, countDimensionsGapped: Array1DLeavesTotal, dimensionsUnconstrained: DatatypeLeavesTotal, gapRangeStart: Array1DElephino, gapsWhere: Array1DLeavesTotal, leafAbove: Array1DLeavesTotal, leafBelow: Array1DLeavesTotal, foldGroups: Array1DFoldsTotal, gap1ndex: DatatypeElephino, gap1ndexCeiling: DatatypeElephino, groupsOfFolds: DatatypeFoldsTotal, indexDimension: DatatypeLeavesTotal, indexMiniGap: DatatypeElephino, leaf1ndex: DatatypeLeavesTotal, leafConnectee: DatatypeLeavesTotal, taskIndex: DatatypeLeavesTotal) -> DatatypeFoldsTotal:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
50
|
+
while leaf1ndex > 0:
|
|
51
|
+
if leaf1ndex <= 1 or leafBelow[0] == 1:
|
|
52
|
+
if leaf1ndex > leavesTotal:
|
|
53
|
+
groupsOfFolds += 1
|
|
54
|
+
else:
|
|
55
|
+
dimensionsUnconstrained = dimensionsTotal
|
|
56
|
+
gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
|
|
57
|
+
indexDimension = 0
|
|
58
|
+
while indexDimension < dimensionsTotal:
|
|
59
|
+
if connectionGraph[indexDimension, leaf1ndex, leaf1ndex] == leaf1ndex:
|
|
60
|
+
dimensionsUnconstrained -= 1
|
|
61
|
+
else:
|
|
62
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
63
|
+
while leafConnectee != leaf1ndex:
|
|
64
|
+
if leaf1ndex != taskDivisions or leafConnectee % taskDivisions == taskIndex:
|
|
65
|
+
gapsWhere[gap1ndexCeiling] = leafConnectee
|
|
66
|
+
if countDimensionsGapped[leafConnectee] == 0:
|
|
67
|
+
gap1ndexCeiling += 1
|
|
68
|
+
countDimensionsGapped[leafConnectee] += 1
|
|
69
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
|
|
70
|
+
indexDimension += 1
|
|
71
|
+
indexMiniGap = gap1ndex
|
|
72
|
+
while indexMiniGap < gap1ndexCeiling:
|
|
73
|
+
gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
|
|
74
|
+
if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
|
|
75
|
+
gap1ndex += 1
|
|
76
|
+
countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
|
|
77
|
+
indexMiniGap += 1
|
|
78
|
+
while leaf1ndex > 0 and gap1ndex == gapRangeStart[leaf1ndex - 1]:
|
|
79
|
+
leaf1ndex -= 1
|
|
80
|
+
leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
|
|
81
|
+
leafAbove[leafBelow[leaf1ndex]] = leafAbove[leaf1ndex]
|
|
82
|
+
if leaf1ndex > 0:
|
|
83
|
+
gap1ndex -= 1
|
|
84
|
+
leafAbove[leaf1ndex] = gapsWhere[gap1ndex]
|
|
85
|
+
leafBelow[leaf1ndex] = leafBelow[leafAbove[leaf1ndex]]
|
|
86
|
+
leafBelow[leafAbove[leaf1ndex]] = leaf1ndex
|
|
87
|
+
leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
|
|
88
|
+
gapRangeStart[leaf1ndex] = gap1ndex
|
|
89
|
+
leaf1ndex += 1
|
|
90
|
+
foldGroups[taskIndex] = groupsOfFolds
|
|
91
|
+
return groupsOfFolds
|
|
91
92
|
|
|
92
93
|
@jit(_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)
|
|
93
94
|
def countSequential(mapShape: tuple[DatatypeLeavesTotal, ...], leavesTotal: DatatypeLeavesTotal, taskDivisions: DatatypeLeavesTotal, concurrencyLimit: DatatypeElephino, connectionGraph: Array3D, dimensionsTotal: DatatypeLeavesTotal, countDimensionsGapped: Array1DLeavesTotal, dimensionsUnconstrained: DatatypeLeavesTotal, gapRangeStart: Array1DElephino, gapsWhere: Array1DLeavesTotal, leafAbove: Array1DLeavesTotal, leafBelow: Array1DLeavesTotal, foldGroups: Array1DFoldsTotal, foldsTotal: DatatypeFoldsTotal, gap1ndex: DatatypeElephino, gap1ndexCeiling: DatatypeElephino, groupsOfFolds: DatatypeFoldsTotal, indexDimension: DatatypeLeavesTotal, indexLeaf: DatatypeLeavesTotal, indexMiniGap: DatatypeElephino, leaf1ndex: DatatypeLeavesTotal, leafConnectee: DatatypeLeavesTotal, taskIndex: DatatypeLeavesTotal) -> tuple[tuple[DatatypeLeavesTotal, ...], DatatypeLeavesTotal, DatatypeLeavesTotal, DatatypeElephino, Array3D, DatatypeLeavesTotal, Array1DLeavesTotal, DatatypeLeavesTotal, Array1DElephino, Array1DLeavesTotal, Array1DLeavesTotal, Array1DLeavesTotal, Array1DFoldsTotal, DatatypeFoldsTotal, DatatypeElephino, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal, DatatypeLeavesTotal, DatatypeElephino, DatatypeLeavesTotal, DatatypeLeavesTotal, DatatypeLeavesTotal]:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
95
|
+
while leaf1ndex > 0:
|
|
96
|
+
if leaf1ndex <= 1 or leafBelow[0] == 1:
|
|
97
|
+
if leaf1ndex > leavesTotal:
|
|
98
|
+
groupsOfFolds += 1
|
|
99
|
+
else:
|
|
100
|
+
dimensionsUnconstrained = dimensionsTotal
|
|
101
|
+
gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
|
|
102
|
+
indexDimension = 0
|
|
103
|
+
while indexDimension < dimensionsTotal:
|
|
104
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
|
|
105
|
+
if leafConnectee == leaf1ndex:
|
|
106
|
+
dimensionsUnconstrained -= 1
|
|
107
|
+
else:
|
|
108
|
+
while leafConnectee != leaf1ndex:
|
|
109
|
+
gapsWhere[gap1ndexCeiling] = leafConnectee
|
|
110
|
+
if countDimensionsGapped[leafConnectee] == 0:
|
|
111
|
+
gap1ndexCeiling += 1
|
|
112
|
+
countDimensionsGapped[leafConnectee] += 1
|
|
113
|
+
leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
|
|
114
|
+
indexDimension += 1
|
|
115
|
+
indexMiniGap = gap1ndex
|
|
116
|
+
while indexMiniGap < gap1ndexCeiling:
|
|
117
|
+
gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
|
|
118
|
+
if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
|
|
119
|
+
gap1ndex += 1
|
|
120
|
+
countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
|
|
121
|
+
indexMiniGap += 1
|
|
122
|
+
while leaf1ndex > 0 and gap1ndex == gapRangeStart[leaf1ndex - 1]:
|
|
123
|
+
leaf1ndex -= 1
|
|
124
|
+
leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
|
|
125
|
+
leafAbove[leafBelow[leaf1ndex]] = leafAbove[leaf1ndex]
|
|
126
|
+
if leaf1ndex == 3 and groupsOfFolds:
|
|
127
|
+
groupsOfFolds *= 2
|
|
128
|
+
break
|
|
129
|
+
if leaf1ndex > 0:
|
|
130
|
+
gap1ndex -= 1
|
|
131
|
+
leafAbove[leaf1ndex] = gapsWhere[gap1ndex]
|
|
132
|
+
leafBelow[leaf1ndex] = leafBelow[leafAbove[leaf1ndex]]
|
|
133
|
+
leafBelow[leafAbove[leaf1ndex]] = leaf1ndex
|
|
134
|
+
leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
|
|
135
|
+
gapRangeStart[leaf1ndex] = gap1ndex
|
|
136
|
+
leaf1ndex += 1
|
|
137
|
+
foldGroups[taskIndex] = groupsOfFolds
|
|
138
|
+
return (mapShape, leavesTotal, taskDivisions, concurrencyLimit, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, foldsTotal, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexLeaf, indexMiniGap, leaf1ndex, leafConnectee, taskIndex)
|
|
138
139
|
|
|
139
140
|
def doTheNeedful(state: ComputationState) -> ComputationState:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
141
|
+
state = countInitialize(state)
|
|
142
|
+
if state.taskDivisions > 0:
|
|
143
|
+
dictionaryConcurrency: dict[int, ConcurrentFuture[ComputationState]] = {}
|
|
144
|
+
stateParallel = deepcopy(state)
|
|
145
|
+
with ProcessPoolExecutor(stateParallel.concurrencyLimit) as concurrencyManager:
|
|
146
|
+
for indexSherpa in range(stateParallel.taskDivisions):
|
|
147
|
+
state = deepcopy(stateParallel)
|
|
148
|
+
state.taskIndex = indexSherpa
|
|
149
|
+
mapShape: tuple[DatatypeLeavesTotal, ...] = state.mapShape
|
|
150
|
+
leavesTotal: DatatypeLeavesTotal = state.leavesTotal
|
|
151
|
+
taskDivisions: DatatypeLeavesTotal = state.taskDivisions
|
|
152
|
+
concurrencyLimit: DatatypeElephino = state.concurrencyLimit
|
|
153
|
+
connectionGraph: Array3D = state.connectionGraph
|
|
154
|
+
dimensionsTotal: DatatypeLeavesTotal = state.dimensionsTotal
|
|
155
|
+
countDimensionsGapped: Array1DLeavesTotal = state.countDimensionsGapped
|
|
156
|
+
dimensionsUnconstrained: DatatypeLeavesTotal = state.dimensionsUnconstrained
|
|
157
|
+
gapRangeStart: Array1DElephino = state.gapRangeStart
|
|
158
|
+
gapsWhere: Array1DLeavesTotal = state.gapsWhere
|
|
159
|
+
leafAbove: Array1DLeavesTotal = state.leafAbove
|
|
160
|
+
leafBelow: Array1DLeavesTotal = state.leafBelow
|
|
161
|
+
foldGroups: Array1DFoldsTotal = state.foldGroups
|
|
162
|
+
foldsTotal: DatatypeFoldsTotal = state.foldsTotal
|
|
163
|
+
gap1ndex: DatatypeElephino = state.gap1ndex
|
|
164
|
+
gap1ndexCeiling: DatatypeElephino = state.gap1ndexCeiling
|
|
165
|
+
groupsOfFolds: DatatypeFoldsTotal = state.groupsOfFolds
|
|
166
|
+
indexDimension: DatatypeLeavesTotal = state.indexDimension
|
|
167
|
+
indexLeaf: DatatypeLeavesTotal = state.indexLeaf
|
|
168
|
+
indexMiniGap: DatatypeElephino = state.indexMiniGap
|
|
169
|
+
leaf1ndex: DatatypeLeavesTotal = state.leaf1ndex
|
|
170
|
+
leafConnectee: DatatypeLeavesTotal = state.leafConnectee
|
|
171
|
+
taskIndex: DatatypeLeavesTotal = state.taskIndex
|
|
172
|
+
dictionaryConcurrency[indexSherpa] = concurrencyManager.submit(countParallel, leavesTotal, taskDivisions, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexMiniGap, leaf1ndex, leafConnectee, taskIndex)
|
|
173
|
+
for indexSherpa in range(stateParallel.taskDivisions):
|
|
174
|
+
stateParallel.foldGroups[indexSherpa] = dictionaryConcurrency[indexSherpa].result()
|
|
175
|
+
state = stateParallel
|
|
176
|
+
else:
|
|
177
|
+
mapShape: tuple[DatatypeLeavesTotal, ...] = state.mapShape
|
|
178
|
+
leavesTotal: DatatypeLeavesTotal = state.leavesTotal
|
|
179
|
+
taskDivisions: DatatypeLeavesTotal = state.taskDivisions
|
|
180
|
+
concurrencyLimit: DatatypeElephino = state.concurrencyLimit
|
|
181
|
+
connectionGraph: Array3D = state.connectionGraph
|
|
182
|
+
dimensionsTotal: DatatypeLeavesTotal = state.dimensionsTotal
|
|
183
|
+
countDimensionsGapped: Array1DLeavesTotal = state.countDimensionsGapped
|
|
184
|
+
dimensionsUnconstrained: DatatypeLeavesTotal = state.dimensionsUnconstrained
|
|
185
|
+
gapRangeStart: Array1DElephino = state.gapRangeStart
|
|
186
|
+
gapsWhere: Array1DLeavesTotal = state.gapsWhere
|
|
187
|
+
leafAbove: Array1DLeavesTotal = state.leafAbove
|
|
188
|
+
leafBelow: Array1DLeavesTotal = state.leafBelow
|
|
189
|
+
foldGroups: Array1DFoldsTotal = state.foldGroups
|
|
190
|
+
foldsTotal: DatatypeFoldsTotal = state.foldsTotal
|
|
191
|
+
gap1ndex: DatatypeElephino = state.gap1ndex
|
|
192
|
+
gap1ndexCeiling: DatatypeElephino = state.gap1ndexCeiling
|
|
193
|
+
groupsOfFolds: DatatypeFoldsTotal = state.groupsOfFolds
|
|
194
|
+
indexDimension: DatatypeLeavesTotal = state.indexDimension
|
|
195
|
+
indexLeaf: DatatypeLeavesTotal = state.indexLeaf
|
|
196
|
+
indexMiniGap: DatatypeElephino = state.indexMiniGap
|
|
197
|
+
leaf1ndex: DatatypeLeavesTotal = state.leaf1ndex
|
|
198
|
+
leafConnectee: DatatypeLeavesTotal = state.leafConnectee
|
|
199
|
+
taskIndex: DatatypeLeavesTotal = state.taskIndex
|
|
200
|
+
mapShape, leavesTotal, taskDivisions, concurrencyLimit, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, foldsTotal, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexLeaf, indexMiniGap, leaf1ndex, leafConnectee, taskIndex = countSequential(mapShape, leavesTotal, taskDivisions, concurrencyLimit, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, foldsTotal, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexLeaf, indexMiniGap, leaf1ndex, leafConnectee, taskIndex)
|
|
201
|
+
state = ComputationState(mapShape=mapShape, leavesTotal=leavesTotal, taskDivisions=taskDivisions, concurrencyLimit=concurrencyLimit, countDimensionsGapped=countDimensionsGapped, dimensionsUnconstrained=dimensionsUnconstrained, gapRangeStart=gapRangeStart, gapsWhere=gapsWhere, leafAbove=leafAbove, leafBelow=leafBelow, foldGroups=foldGroups, foldsTotal=foldsTotal, gap1ndex=gap1ndex, gap1ndexCeiling=gap1ndexCeiling, groupsOfFolds=groupsOfFolds, indexDimension=indexDimension, indexLeaf=indexLeaf, indexMiniGap=indexMiniGap, leaf1ndex=leaf1ndex, leafConnectee=leafConnectee, taskIndex=taskIndex)
|
|
202
|
+
return state
|
mapFolding/theDao.py
CHANGED
|
@@ -20,7 +20,7 @@ concurrency parameters.
|
|
|
20
20
|
"""
|
|
21
21
|
from concurrent.futures import Future as ConcurrentFuture, ProcessPoolExecutor
|
|
22
22
|
from copy import deepcopy
|
|
23
|
-
from mapFolding.
|
|
23
|
+
from mapFolding.beDRY import ComputationState
|
|
24
24
|
from multiprocessing import set_start_method as multiprocessing_set_start_method
|
|
25
25
|
|
|
26
26
|
# When to use multiprocessing.set_start_method https://github.com/hunterhogan/mapFolding/issues/6
|