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.
Files changed (36) hide show
  1. mapFolding/beDRY.py +77 -81
  2. mapFolding/noHomeYet.py +2 -2
  3. mapFolding/oeis.py +2 -2
  4. mapFolding/someAssemblyRequired/Z0Z_workbench.py +347 -30
  5. mapFolding/someAssemblyRequired/__init__.py +4 -3
  6. mapFolding/someAssemblyRequired/getLLVMforNoReason.py +0 -1
  7. mapFolding/someAssemblyRequired/ingredientsNumba.py +87 -2
  8. mapFolding/someAssemblyRequired/synthesizeDataConverters.py +34 -52
  9. mapFolding/someAssemblyRequired/{synthesizeNumbaJob.py → synthesizeNumbaJobVESTIGIAL.py} +18 -21
  10. mapFolding/someAssemblyRequired/transformationTools.py +546 -208
  11. mapFolding/syntheticModules/numbaCount_doTheNeedful.py +197 -12
  12. mapFolding/theDao.py +23 -16
  13. mapFolding/theSSOT.py +28 -43
  14. {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/METADATA +6 -7
  15. mapfolding-0.8.0.dist-info/RECORD +41 -0
  16. {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/WHEEL +1 -1
  17. tests/conftest.py +2 -3
  18. tests/test_filesystem.py +0 -2
  19. tests/test_other.py +2 -3
  20. tests/test_tasks.py +0 -4
  21. mapFolding/someAssemblyRequired/synthesizeCountingFunctions.py +0 -7
  22. mapFolding/someAssemblyRequired/synthesizeNumba.py +0 -91
  23. mapFolding/someAssemblyRequired/synthesizeNumbaModules.py +0 -91
  24. mapFolding/someAssemblyRequired/whatWillBe.py +0 -357
  25. mapFolding/syntheticModules/__init__.py +0 -0
  26. mapFolding/syntheticModules/dataNamespaceFlattened.py +0 -30
  27. mapFolding/syntheticModules/multiprocessingCount_doTheNeedful.py +0 -216
  28. mapFolding/syntheticModules/numbaCount.py +0 -90
  29. mapFolding/syntheticModules/numbaCountSequential.py +0 -111
  30. mapFolding/syntheticModules/numba_doTheNeedful.py +0 -12
  31. mapfolding-0.7.1.dist-info/RECORD +0 -51
  32. /mapFolding/syntheticModules/{numbaCountExample.py → numbaCountHistoricalExample.py} +0 -0
  33. /mapFolding/syntheticModules/{numba_doTheNeedfulExample.py → numba_doTheNeedfulHistoricalExample.py} +0 -0
  34. {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/LICENSE +0 -0
  35. {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/entry_points.txt +0 -0
  36. {mapfolding-0.7.1.dist-info → mapfolding-0.8.0.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,198 @@
1
- from mapFolding import indexMy
2
- from mapFolding.syntheticModules.numbaCount import countInitialize, countSequential, countParallel
3
- from numba import uint16, int64, jit
4
- from numpy import ndarray, dtype, integer
5
- from typing import Any
6
-
7
- @jit((uint16[:, :, ::1], int64[::1], uint16[::1], uint16[::1], uint16[::1], uint16[:, ::1]), _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)
8
- def doTheNeedful(connectionGraph: ndarray[tuple[int, int, int], dtype[integer[Any]]], foldGroups: ndarray[tuple[int], dtype[integer[Any]]], gapsWhere: ndarray[tuple[int], dtype[integer[Any]]], mapShape: ndarray[tuple[int], dtype[integer[Any]]], my: ndarray[tuple[int], dtype[integer[Any]]], track: ndarray[tuple[int, int], dtype[integer[Any]]]) -> None:
9
- countInitialize(connectionGraph, gapsWhere, my, track)
10
- if my[indexMy.taskDivisions] > 0:
11
- countParallel(connectionGraph, foldGroups, gapsWhere, my, track)
1
+ from concurrent.futures import Future as ConcurrentFuture, ProcessPoolExecutor
2
+ from copy import deepcopy
3
+ from mapFolding.theSSOT import Array1DElephino, Array1DFoldsTotal, Array1DLeavesTotal, Array3D, ComputationState, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal
4
+ from numba import jit
5
+
6
+ def countInitialize(state: ComputationState) -> ComputationState:
7
+ while state.leaf1ndex > 0:
8
+ if state.leaf1ndex <= 1 or state.leafBelow[0] == 1:
9
+ state.dimensionsUnconstrained = state.dimensionsTotal
10
+ state.gap1ndexCeiling = state.gapRangeStart[state.leaf1ndex - 1]
11
+ state.indexDimension = 0
12
+ while state.indexDimension < state.dimensionsTotal:
13
+ state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex]
14
+ if state.leafConnectee == state.leaf1ndex:
15
+ state.dimensionsUnconstrained -= 1
16
+ else:
17
+ while state.leafConnectee != state.leaf1ndex:
18
+ state.gapsWhere[state.gap1ndexCeiling] = state.leafConnectee
19
+ if state.countDimensionsGapped[state.leafConnectee] == 0:
20
+ state.gap1ndexCeiling += 1
21
+ state.countDimensionsGapped[state.leafConnectee] += 1
22
+ state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leafBelow[state.leafConnectee]]
23
+ state.indexDimension += 1
24
+ if not state.dimensionsUnconstrained:
25
+ indexLeaf = 0
26
+ while indexLeaf < state.leaf1ndex:
27
+ state.gapsWhere[state.gap1ndexCeiling] = indexLeaf
28
+ state.gap1ndexCeiling += 1
29
+ indexLeaf += 1
30
+ state.indexMiniGap = state.gap1ndex
31
+ while state.indexMiniGap < state.gap1ndexCeiling:
32
+ state.gapsWhere[state.gap1ndex] = state.gapsWhere[state.indexMiniGap]
33
+ if state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] == state.dimensionsUnconstrained:
34
+ state.gap1ndex += 1
35
+ state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] = 0
36
+ state.indexMiniGap += 1
37
+ if state.leaf1ndex > 0:
38
+ state.gap1ndex -= 1
39
+ state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
40
+ state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
41
+ state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leaf1ndex
42
+ state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
43
+ state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
44
+ state.leaf1ndex += 1
45
+ if state.gap1ndex > 0:
46
+ break
47
+ return state
48
+
49
+ @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)
50
+ def countParallel(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: DatatypeLeavesTotal, gap1ndexCeiling: DatatypeElephino, groupsOfFolds: DatatypeFoldsTotal, indexDimension: DatatypeLeavesTotal, indexLeaf: DatatypeLeavesTotal, indexMiniGap: DatatypeElephino, leaf1ndex: DatatypeElephino, leafConnectee: DatatypeElephino, taskIndex: DatatypeLeavesTotal) -> DatatypeFoldsTotal:
51
+ while leaf1ndex > 0:
52
+ if leaf1ndex <= 1 or leafBelow[0] == 1:
53
+ if leaf1ndex > leavesTotal:
54
+ groupsOfFolds += 1
55
+ else:
56
+ dimensionsUnconstrained = dimensionsTotal
57
+ gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
58
+ indexDimension = 0
59
+ while indexDimension < dimensionsTotal:
60
+ if connectionGraph[indexDimension, leaf1ndex, leaf1ndex] == leaf1ndex:
61
+ dimensionsUnconstrained -= 1
62
+ else:
63
+ leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
64
+ while leafConnectee != leaf1ndex:
65
+ if leaf1ndex != taskDivisions or leafConnectee % taskDivisions == taskIndex:
66
+ gapsWhere[gap1ndexCeiling] = leafConnectee
67
+ if countDimensionsGapped[leafConnectee] == 0:
68
+ gap1ndexCeiling += 1
69
+ countDimensionsGapped[leafConnectee] += 1
70
+ leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
71
+ indexDimension += 1
72
+ indexMiniGap = gap1ndex
73
+ while indexMiniGap < gap1ndexCeiling:
74
+ gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
75
+ if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
76
+ gap1ndex += 1
77
+ countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
78
+ indexMiniGap += 1
79
+ while leaf1ndex > 0 and gap1ndex == gapRangeStart[leaf1ndex - 1]:
80
+ leaf1ndex -= 1
81
+ leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
82
+ leafAbove[leafBelow[leaf1ndex]] = leafAbove[leaf1ndex]
83
+ if leaf1ndex > 0:
84
+ gap1ndex -= 1
85
+ leafAbove[leaf1ndex] = gapsWhere[gap1ndex]
86
+ leafBelow[leaf1ndex] = leafBelow[leafAbove[leaf1ndex]]
87
+ leafBelow[leafAbove[leaf1ndex]] = leaf1ndex
88
+ leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
89
+ gapRangeStart[leaf1ndex] = gap1ndex
90
+ leaf1ndex += 1
91
+ foldGroups[taskIndex] = groupsOfFolds
92
+ return groupsOfFolds
93
+
94
+ @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)
95
+ 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: DatatypeLeavesTotal, gap1ndexCeiling: DatatypeElephino, groupsOfFolds: DatatypeFoldsTotal, indexDimension: DatatypeLeavesTotal, indexLeaf: DatatypeLeavesTotal, indexMiniGap: DatatypeElephino, leaf1ndex: DatatypeElephino, leafConnectee: DatatypeElephino, taskIndex: DatatypeLeavesTotal) -> tuple[tuple[DatatypeLeavesTotal, ...], DatatypeLeavesTotal, DatatypeLeavesTotal, DatatypeElephino, Array3D, DatatypeLeavesTotal, Array1DLeavesTotal, DatatypeLeavesTotal, Array1DElephino, Array1DLeavesTotal, Array1DLeavesTotal, Array1DLeavesTotal, Array1DFoldsTotal, DatatypeFoldsTotal, DatatypeLeavesTotal, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal, DatatypeLeavesTotal, DatatypeElephino, DatatypeElephino, DatatypeElephino, DatatypeLeavesTotal]:
96
+ while leaf1ndex > 0:
97
+ if leaf1ndex <= 1 or leafBelow[0] == 1:
98
+ if leaf1ndex > leavesTotal:
99
+ groupsOfFolds += 1
100
+ else:
101
+ dimensionsUnconstrained = dimensionsTotal
102
+ gap1ndexCeiling = gapRangeStart[leaf1ndex - 1]
103
+ indexDimension = 0
104
+ while indexDimension < dimensionsTotal:
105
+ leafConnectee = connectionGraph[indexDimension, leaf1ndex, leaf1ndex]
106
+ if leafConnectee == leaf1ndex:
107
+ dimensionsUnconstrained -= 1
108
+ else:
109
+ while leafConnectee != leaf1ndex:
110
+ gapsWhere[gap1ndexCeiling] = leafConnectee
111
+ if countDimensionsGapped[leafConnectee] == 0:
112
+ gap1ndexCeiling += 1
113
+ countDimensionsGapped[leafConnectee] += 1
114
+ leafConnectee = connectionGraph[indexDimension, leaf1ndex, leafBelow[leafConnectee]]
115
+ indexDimension += 1
116
+ indexMiniGap = gap1ndex
117
+ while indexMiniGap < gap1ndexCeiling:
118
+ gapsWhere[gap1ndex] = gapsWhere[indexMiniGap]
119
+ if countDimensionsGapped[gapsWhere[indexMiniGap]] == dimensionsUnconstrained:
120
+ gap1ndex += 1
121
+ countDimensionsGapped[gapsWhere[indexMiniGap]] = 0
122
+ indexMiniGap += 1
123
+ while leaf1ndex > 0 and gap1ndex == gapRangeStart[leaf1ndex - 1]:
124
+ leaf1ndex -= 1
125
+ leafBelow[leafAbove[leaf1ndex]] = leafBelow[leaf1ndex]
126
+ leafAbove[leafBelow[leaf1ndex]] = leafAbove[leaf1ndex]
127
+ if leaf1ndex > 0:
128
+ gap1ndex -= 1
129
+ leafAbove[leaf1ndex] = gapsWhere[gap1ndex]
130
+ leafBelow[leaf1ndex] = leafBelow[leafAbove[leaf1ndex]]
131
+ leafBelow[leafAbove[leaf1ndex]] = leaf1ndex
132
+ leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
133
+ gapRangeStart[leaf1ndex] = gap1ndex
134
+ leaf1ndex += 1
135
+ foldGroups[taskIndex] = groupsOfFolds
136
+ return (mapShape, leavesTotal, taskDivisions, concurrencyLimit, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, foldsTotal, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexLeaf, indexMiniGap, leaf1ndex, leafConnectee, taskIndex)
137
+
138
+ def doTheNeedful(state: ComputationState) -> ComputationState:
139
+ state = countInitialize(state)
140
+ if state.taskDivisions > 0:
141
+ dictionaryConcurrency: dict[int, ConcurrentFuture[ComputationState]] = {}
142
+ with ProcessPoolExecutor(state.concurrencyLimit) as concurrencyManager:
143
+ for indexSherpa in range(state.taskDivisions):
144
+ stateParallel = deepcopy(state)
145
+ stateParallel.taskIndex = indexSherpa
146
+ mapShape: tuple[DatatypeLeavesTotal, ...] = stateParallel.mapShape
147
+ leavesTotal: DatatypeLeavesTotal = stateParallel.leavesTotal
148
+ taskDivisions: DatatypeLeavesTotal = stateParallel.taskDivisions
149
+ concurrencyLimit: DatatypeElephino = stateParallel.concurrencyLimit
150
+ connectionGraph: Array3D = stateParallel.connectionGraph
151
+ dimensionsTotal: DatatypeLeavesTotal = stateParallel.dimensionsTotal
152
+ countDimensionsGapped: Array1DLeavesTotal = stateParallel.countDimensionsGapped
153
+ dimensionsUnconstrained: DatatypeLeavesTotal = stateParallel.dimensionsUnconstrained
154
+ gapRangeStart: Array1DElephino = stateParallel.gapRangeStart
155
+ gapsWhere: Array1DLeavesTotal = stateParallel.gapsWhere
156
+ leafAbove: Array1DLeavesTotal = stateParallel.leafAbove
157
+ leafBelow: Array1DLeavesTotal = stateParallel.leafBelow
158
+ foldGroups: Array1DFoldsTotal = stateParallel.foldGroups
159
+ foldsTotal: DatatypeFoldsTotal = stateParallel.foldsTotal
160
+ gap1ndex: DatatypeLeavesTotal = stateParallel.gap1ndex
161
+ gap1ndexCeiling: DatatypeElephino = stateParallel.gap1ndexCeiling
162
+ groupsOfFolds: DatatypeFoldsTotal = stateParallel.groupsOfFolds
163
+ indexDimension: DatatypeLeavesTotal = stateParallel.indexDimension
164
+ indexLeaf: DatatypeLeavesTotal = stateParallel.indexLeaf
165
+ indexMiniGap: DatatypeElephino = stateParallel.indexMiniGap
166
+ leaf1ndex: DatatypeElephino = stateParallel.leaf1ndex
167
+ leafConnectee: DatatypeElephino = stateParallel.leafConnectee
168
+ taskIndex: DatatypeLeavesTotal = stateParallel.taskIndex
169
+ dictionaryConcurrency[indexSherpa] = concurrencyManager.submit(countParallel, mapShape, leavesTotal, taskDivisions, concurrencyLimit, connectionGraph, dimensionsTotal, countDimensionsGapped, dimensionsUnconstrained, gapRangeStart, gapsWhere, leafAbove, leafBelow, foldGroups, foldsTotal, gap1ndex, gap1ndexCeiling, groupsOfFolds, indexDimension, indexLeaf, indexMiniGap, leaf1ndex, leafConnectee, taskIndex)
170
+ for indexSherpa in range(state.taskDivisions):
171
+ state.foldGroups[indexSherpa] = dictionaryConcurrency[indexSherpa].result()
12
172
  else:
13
- countSequential(connectionGraph, foldGroups, gapsWhere, my, track)
173
+ mapShape: tuple[DatatypeLeavesTotal, ...] = state.mapShape
174
+ leavesTotal: DatatypeLeavesTotal = state.leavesTotal
175
+ taskDivisions: DatatypeLeavesTotal = state.taskDivisions
176
+ concurrencyLimit: DatatypeElephino = state.concurrencyLimit
177
+ connectionGraph: Array3D = state.connectionGraph
178
+ dimensionsTotal: DatatypeLeavesTotal = state.dimensionsTotal
179
+ countDimensionsGapped: Array1DLeavesTotal = state.countDimensionsGapped
180
+ dimensionsUnconstrained: DatatypeLeavesTotal = state.dimensionsUnconstrained
181
+ gapRangeStart: Array1DElephino = state.gapRangeStart
182
+ gapsWhere: Array1DLeavesTotal = state.gapsWhere
183
+ leafAbove: Array1DLeavesTotal = state.leafAbove
184
+ leafBelow: Array1DLeavesTotal = state.leafBelow
185
+ foldGroups: Array1DFoldsTotal = state.foldGroups
186
+ foldsTotal: DatatypeFoldsTotal = state.foldsTotal
187
+ gap1ndex: DatatypeLeavesTotal = state.gap1ndex
188
+ gap1ndexCeiling: DatatypeElephino = state.gap1ndexCeiling
189
+ groupsOfFolds: DatatypeFoldsTotal = state.groupsOfFolds
190
+ indexDimension: DatatypeLeavesTotal = state.indexDimension
191
+ indexLeaf: DatatypeLeavesTotal = state.indexLeaf
192
+ indexMiniGap: DatatypeElephino = state.indexMiniGap
193
+ leaf1ndex: DatatypeElephino = state.leaf1ndex
194
+ leafConnectee: DatatypeElephino = state.leafConnectee
195
+ taskIndex: DatatypeLeavesTotal = state.taskIndex
196
+ 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)
197
+ 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)
198
+ return state
mapFolding/theDao.py CHANGED
@@ -1,12 +1,18 @@
1
- from concurrent.futures import ProcessPoolExecutor
1
+ from concurrent.futures import Future as ConcurrentFuture, ProcessPoolExecutor
2
+ from copy import deepcopy
2
3
  from mapFolding.theSSOT import ComputationState
3
- import concurrent.futures
4
- import copy
5
- import multiprocessing
4
+ from multiprocessing import set_start_method as multiprocessing_set_start_method
5
+
6
+ """
7
+ - A "leaf" is a unit square in the map
8
+ - A "gap" is a potential position where a new leaf can be folded
9
+ - Connections track how leaves can connect above/below each other
10
+ - Leaves are enumerated starting from 1, not 0; hence, leaf1ndex not leafIndex
11
+ """
6
12
 
7
13
  # When to use multiprocessing.set_start_method https://github.com/hunterhogan/mapFolding/issues/6
8
14
  if __name__ == '__main__':
9
- multiprocessing.set_start_method('spawn')
15
+ multiprocessing_set_start_method('spawn')
10
16
 
11
17
  def activeLeafConnectedToItself(state: ComputationState) -> bool:
12
18
  return state.leafConnectee == state.leaf1ndex
@@ -23,7 +29,7 @@ def activeLeafIsTheFirstLeaf(state: ComputationState) -> bool:
23
29
  def allDimensionsAreUnconstrained(state: ComputationState) -> bool:
24
30
  return not state.dimensionsUnconstrained
25
31
 
26
- def backtrack(state: ComputationState) -> ComputationState:
32
+ def undoLastLeafPlacement(state: ComputationState) -> ComputationState:
27
33
  state.leaf1ndex -= 1
28
34
  state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leafBelow[state.leaf1ndex]
29
35
  state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leafAbove[state.leaf1ndex]
@@ -103,7 +109,7 @@ def loopUpToDimensionsTotal(state: ComputationState) -> bool:
103
109
  def noGapsHere(state: ComputationState) -> bool:
104
110
  return (state.leaf1ndex > 0) and (state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1])
105
111
 
106
- def placeLeaf(state: ComputationState) -> ComputationState:
112
+ def insertLeafAtGap(state: ComputationState) -> ComputationState:
107
113
  state.gap1ndex -= 1
108
114
  state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
109
115
  state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
@@ -143,7 +149,7 @@ def countInitialize(state: ComputationState) -> ComputationState:
143
149
  state = filterCommonGaps(state)
144
150
  state = incrementIndexMiniGap(state)
145
151
  if thereIsAnActiveLeaf(state):
146
- state = placeLeaf(state)
152
+ state = insertLeafAtGap(state)
147
153
  if state.gap1ndex > 0:
148
154
  break
149
155
  return state
@@ -170,9 +176,9 @@ def countParallel(state: ComputationState) -> ComputationState:
170
176
  state = filterCommonGaps(state)
171
177
  state = incrementIndexMiniGap(state)
172
178
  while noGapsHere(state):
173
- state = backtrack(state)
179
+ state = undoLastLeafPlacement(state)
174
180
  if thereIsAnActiveLeaf(state):
175
- state = placeLeaf(state)
181
+ state = insertLeafAtGap(state)
176
182
  state.foldGroups[state.taskIndex] = state.groupsOfFolds
177
183
  return state
178
184
 
@@ -197,23 +203,24 @@ def countSequential(state: ComputationState) -> ComputationState:
197
203
  state = filterCommonGaps(state)
198
204
  state = incrementIndexMiniGap(state)
199
205
  while noGapsHere(state):
200
- state = backtrack(state)
206
+ state = undoLastLeafPlacement(state)
201
207
  if thereIsAnActiveLeaf(state):
202
- state = placeLeaf(state)
208
+ state = insertLeafAtGap(state)
203
209
  state.foldGroups[state.taskIndex] = state.groupsOfFolds
204
210
  return state
205
211
 
206
212
  def doTheNeedful(state: ComputationState) -> ComputationState:
207
213
  state = countInitialize(state)
208
214
  if state.taskDivisions > 0:
209
- dictionaryConcurrency: dict[int, concurrent.futures.Future[ComputationState]] = {}
215
+ dictionaryConcurrency: dict[int, ConcurrentFuture[ComputationState]] = {}
210
216
  with ProcessPoolExecutor(state.concurrencyLimit) as concurrencyManager:
211
217
  for indexSherpa in range(state.taskDivisions):
212
- stateParallel = copy.deepcopy(state)
218
+ stateParallel = deepcopy(state)
213
219
  stateParallel.taskIndex = indexSherpa
214
220
  dictionaryConcurrency[indexSherpa] = concurrencyManager.submit(countParallel, stateParallel)
215
221
  for indexSherpa in range(state.taskDivisions):
216
222
  state.foldGroups[indexSherpa] = dictionaryConcurrency[indexSherpa].result().foldGroups[indexSherpa]
217
- return state
218
223
  else:
219
- return countSequential(state)
224
+ state = countSequential(state)
225
+
226
+ return state
mapFolding/theSSOT.py CHANGED
@@ -20,12 +20,11 @@ Identifiers: scope and resolution, LEGB (Local, Enclosing, Global, Builtin)
20
20
  """
21
21
 
22
22
  # I _think_, in theSSOT, I have abstracted the flow settings to only these couple of lines:
23
+ # Figure out dynamic flow control to synthesized modules https://github.com/hunterhogan/mapFolding/issues/4
23
24
  packageFlowSynthetic = 'numba'
24
- # packageFlowSynthetic = 'multiprocessing'
25
- Z0Z_packageFlow = 'algorithm'
26
- # https://github.com/hunterhogan/mapFolding/issues/4
27
- # Z0Z_packageFlow = packageFlowSynthetic
28
-
25
+ # Z0Z_packageFlow = 'algorithm'
26
+ Z0Z_packageFlow = packageFlowSynthetic
27
+ Z0Z_concurrencyPackage = 'multiprocessing'
29
28
  # =============================================================================
30
29
  # The Wrong Way The Wrong Way The Wrong Way The Wrong Way The Wrong Way
31
30
  # Evaluate When Packaging Evaluate When Packaging Evaluate When Packaging
@@ -38,8 +37,7 @@ moduleOfSyntheticModulesPACKAGING: Final[str] = 'syntheticModules'
38
37
  dataclassModulePACKAGING: str = 'theSSOT'
39
38
  dataclassIdentifierPACKAGING: str = 'ComputationState'
40
39
  dataclassInstancePACKAGING: str = 'state'
41
- dataclassInstance_Pre_ParallelPACKAGING = dataclassInstancePACKAGING + 'PARALLEL'
42
- dataclassInstance_Post_ParallelPACKAGING = dataclassInstancePACKAGING + 'COMPLETE'
40
+ dataclassInstanceTaskDistributionPACKAGING = dataclassInstancePACKAGING + 'Parallel'
43
41
 
44
42
  sourceInitializeCallablePACKAGING = 'countInitialize'
45
43
  sourceSequentialCallablePACKAGING = 'countSequential'
@@ -48,7 +46,7 @@ sourceParallelCallablePACKAGING = 'countParallel'
48
46
  try:
49
47
  thePackageNamePACKAGING: str = tomli_load(Path("../pyproject.toml").open('rb'))["project"]["name"]
50
48
  except Exception:
51
- thePackageNamePACKAGING: str = "mapFolding"
49
+ thePackageNamePACKAGING = "mapFolding"
52
50
 
53
51
  # =============================================================================
54
52
  # The Wrong Way The Wrong Way The Wrong Way The Wrong Way The Wrong Way
@@ -62,14 +60,9 @@ def getPathPackageINSTALLING() -> Path:
62
60
  pathPackage = pathPackage.parent
63
61
  return pathPackage
64
62
 
65
- # =============================================================================
66
- # The Wrong Way The Wrong Way The Wrong Way The Wrong Way The Wrong Way
67
- # Hardcoding Hardcoding Hardcoding Hardcoding Hardcoding Hardcoding Hardcoding
68
-
69
63
  # =============================================================================
70
64
  # The right way, perhaps.
71
65
 
72
- # =====================
73
66
  # Create enduring identifiers from the hopefully transient identifiers above.
74
67
  thePackageName: Final[str] = thePackageNamePACKAGING
75
68
  thePathPackage: Path = getPathPackageINSTALLING()
@@ -94,16 +87,17 @@ theDispatcherCallable: str = dispatcherCallablePACKAGING
94
87
  theDataclassModule: str = dataclassModulePACKAGING
95
88
  theDataclassIdentifier: str = dataclassIdentifierPACKAGING
96
89
  theDataclassInstance: str = dataclassInstancePACKAGING
97
- theDataclassInstance_Pre_Parallel: str = dataclassInstance_Pre_ParallelPACKAGING
98
- theDataclassInstance_Post_Parallel: str = dataclassInstance_Post_ParallelPACKAGING
90
+ theDataclassInstanceTaskDistribution: str = dataclassInstanceTaskDistributionPACKAGING
99
91
 
100
92
  theFileExtension: str = fileExtensionINSTALLING
101
93
 
102
94
  theModuleOfSyntheticModules: Final[str] = moduleOfSyntheticModulesPACKAGING
103
95
 
104
96
  # =============================================================================
105
- # The right way.
97
+
98
+ # Figure out dynamic flow control to synthesized modules https://github.com/hunterhogan/mapFolding/issues/4
106
99
  concurrencyPackage: str = Z0Z_packageFlow
100
+ concurrencyPackage = Z0Z_concurrencyPackage
107
101
 
108
102
  # =============================================================================
109
103
  # The relatively flexible type system needs a different paradigm, but I don't
@@ -141,16 +135,16 @@ class ComputationState:
141
135
  taskDivisions: DatatypeLeavesTotal
142
136
  concurrencyLimit: DatatypeElephino
143
137
 
144
- connectionGraph: Array3D = dataclasses.field(init=False, metadata={'description': 'A 3D array representing the connection graph of the map.'})
138
+ connectionGraph: Array3D = dataclasses.field(init=False)
145
139
  dimensionsTotal: DatatypeLeavesTotal = dataclasses.field(init=False)
146
140
 
147
- countDimensionsGapped: Array1DLeavesTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
148
- dimensionsUnconstrained: DatatypeLeavesTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
149
- gapRangeStart: Array1DElephino = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
150
- gapsWhere: Array1DLeavesTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
151
- leafAbove: Array1DLeavesTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
152
- leafBelow: Array1DLeavesTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
153
- foldGroups: Array1DFoldsTotal = dataclasses.field(default=None) # pyright: ignore[reportAssignmentType]
141
+ countDimensionsGapped: Array1DLeavesTotal = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
142
+ dimensionsUnconstrained: DatatypeLeavesTotal = dataclasses.field(default=None, init=True) # type: ignore[assignment, reportAssignmentType]
143
+ gapRangeStart: Array1DElephino = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
144
+ gapsWhere: Array1DLeavesTotal = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
145
+ leafAbove: Array1DLeavesTotal = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
146
+ leafBelow: Array1DLeavesTotal = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
147
+ foldGroups: Array1DFoldsTotal = dataclasses.field(default=None, init=True) # type: ignore[arg-type, reportAssignmentType]
154
148
 
155
149
  foldsTotal: DatatypeFoldsTotal = DatatypeFoldsTotal(0)
156
150
  gap1ndex: DatatypeLeavesTotal = DatatypeLeavesTotal(0)
@@ -161,10 +155,10 @@ class ComputationState:
161
155
  indexMiniGap: DatatypeElephino = DatatypeElephino(0)
162
156
  leaf1ndex: DatatypeElephino = DatatypeElephino(1)
163
157
  leafConnectee: DatatypeElephino = DatatypeElephino(0)
164
- taskIndex: DatatypeLeavesTotal = dataclasses.field(default=DatatypeLeavesTotal(0), metadata={'myType': DatatypeLeavesTotal})
165
- # taskIndex: DatatypeLeavesTotal = DatatypeLeavesTotal(0)
158
+ taskIndex: DatatypeLeavesTotal = DatatypeLeavesTotal(0)
159
+ # Efficient translation of Python scalar types to Numba types https://github.com/hunterhogan/mapFolding/issues/8
166
160
 
167
- def __post_init__(self):
161
+ def __post_init__(self) -> None:
168
162
  from mapFolding.beDRY import makeConnectionGraph, makeDataContainer
169
163
  self.dimensionsTotal = DatatypeLeavesTotal(len(self.mapShape))
170
164
  self.connectionGraph = makeConnectionGraph(self.mapShape, self.leavesTotal, numpyLeavesTotal)
@@ -189,14 +183,9 @@ class ComputationState:
189
183
  if self.leafBelow is None:
190
184
  self.leafBelow = makeDataContainer(leavesTotalAsInt + 1, numpyLeavesTotal)
191
185
 
192
- def getFoldsTotal(self):
186
+ def getFoldsTotal(self) -> None:
193
187
  self.foldsTotal = DatatypeFoldsTotal(self.foldGroups[0:-1].sum() * self.leavesTotal)
194
188
 
195
- # factory? constructor?
196
- # state.taskIndex = state.taskIndex.type(indexSherpa)
197
- # self.fieldName = self.fieldName.fieldType(indexSherpa)
198
- # state.taskIndex.toMyType(indexSherpa)
199
-
200
189
  # =============================================================================
201
190
  # The most right way I know how to implement.
202
191
 
@@ -208,8 +197,7 @@ def getSourceAlgorithm() -> ModuleType:
208
197
  moduleImported: ModuleType = importlib_import_module(theLogicalPathModuleSourceAlgorithm)
209
198
  return moduleImported
210
199
 
211
- # dynamically set the return type https://github.com/hunterhogan/mapFolding/issues/5
212
- def getAlgorithmDispatcher():
200
+ def getAlgorithmDispatcher() -> Callable[[ComputationState], ComputationState]:
213
201
  moduleImported: ModuleType = getSourceAlgorithm()
214
202
  dispatcherCallable = getattr(moduleImported, theDispatcherCallable)
215
203
  return dispatcherCallable
@@ -238,7 +226,7 @@ def getNumpyDtypeDefault() -> type[signedinteger[Any]]:
238
226
  # =============================================================================
239
227
  # The coping way.
240
228
 
241
- class FREAKOUT(Exception): pass
229
+ class raiseIfNoneGitHubIssueNumber3(Exception): pass
242
230
 
243
231
  # =============================================================================
244
232
  # Temporary or transient or something; probably still the wrong way
@@ -266,13 +254,8 @@ def getPackageDispatcher() -> Callable[[ComputationState], ComputationState]:
266
254
  # NOTE but this part, if the package flow is synthetic, probably needs to be delegated
267
255
  # to the authority for creating _that_ synthetic flow.
268
256
 
269
- # Automated system
270
- # moduleImported: ModuleType = importlib_import_module(theLogicalPathModuleDispatcher)
271
- # dispatcherCallable = getattr(moduleImported, theDispatcherCallable)
272
-
273
- # Hardcoded while I am refactoring "someAssemblyRequired"
274
- from mapFolding.syntheticModules.numbaCountSequential import flattenData
275
- dispatcherCallable = flattenData
257
+ moduleImported: ModuleType = importlib_import_module(theLogicalPathModuleDispatcher)
258
+ dispatcherCallable = getattr(moduleImported, theDispatcherCallable)
276
259
  return dispatcherCallable
277
260
 
278
261
  """Technical concepts I am likely using and likely want to use more effectively:
@@ -281,8 +264,10 @@ def getPackageDispatcher() -> Callable[[ComputationState], ComputationState]:
281
264
  - Lazy Initialization
282
265
  - Separate configuration from business logic
283
266
 
267
+ ----
284
268
  theSSOT and yourSSOT
285
269
 
270
+ ----
286
271
  delay realization/instantiation until a concrete value is desired
287
272
  moment of truth: when the value is needed, not when the value is defined
288
273
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mapFolding
3
- Version: 0.7.1
3
+ Version: 0.8.0
4
4
  Summary: Count distinct ways to fold a map (or a strip of stamps)
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License: CC-BY-NC-4.0
@@ -38,12 +38,11 @@ Requires-Dist: tomli
38
38
  Requires-Dist: Z0Z_tools
39
39
  Provides-Extra: testing
40
40
  Requires-Dist: mypy; extra == "testing"
41
+ Requires-Dist: pytest; extra == "testing"
41
42
  Requires-Dist: pytest-cov; extra == "testing"
42
43
  Requires-Dist: pytest-env; extra == "testing"
43
44
  Requires-Dist: pytest-xdist; extra == "testing"
44
- Requires-Dist: pytest; extra == "testing"
45
45
  Requires-Dist: pyupgrade; extra == "testing"
46
- Requires-Dist: updateCitation; extra == "testing"
47
46
 
48
47
  # mapFolding: Algorithms for enumerating distinct map/stamp folding patterns 🗺️
49
48
 
@@ -113,14 +112,14 @@ Available OEIS sequences:
113
112
 
114
113
  ### 4. **Customizing your algorithm**
115
114
 
116
- - mapFolding\someAssemblyRequired\synthesizeNumbaJob.py (and/or synthesizeNumba____.py, as applicable)
115
+ - Renovations in progress: ~~mapFolding\someAssemblyRequired\synthesizeNumbaJob.py (and/or synthesizeNumba____.py, as applicable)~~
117
116
  - Synthesize a Numba-optimized module for a specific mapShape
118
117
  - Synthesize _from_ a module in mapFolding\syntheticModules or from any source you select
119
118
  - Use the existing transformation options
120
119
  - Or create new ways of transforming the algorithm from its source to a specific job
121
- - mapFolding\someAssemblyRequired\makeJob.py
120
+ - Renovations in progress: ~~mapFolding\someAssemblyRequired\makeJob.py~~
122
121
  - Initialize data for a specific mapShape
123
- - mapFolding\someAssemblyRequired\synthesizeNumbaModules.py (and/or synthesizeNumba____.py, as applicable)
122
+ - Renovations in progress: ~~mapFolding\someAssemblyRequired\synthesizeNumbaModules.py (and/or synthesizeNumba____.py, as applicable)~~
124
123
  - Synthesize one or more Numba-optimized modules for parallel or sequential computation
125
124
  - Overwrite the modules in mapFolding\syntheticModules or save the module(s) to a custom path
126
125
  - Synthesize _from_ the algorithm(s) in mapFolding\theDao.py or from any source you select
@@ -131,7 +130,7 @@ Available OEIS sequences:
131
130
  - Modify the algorithms for initializing values, parallel computation, and/or sequential computation
132
131
  - Use the modified algorithm(s) in synthesizeNumbaModules.py, above, to create Numba-optimized version(s)
133
132
  - Then use a Numba-optimized version in synthesizeNumbaJob.py, above, to create a hyper-optimized version for a specific mapShape
134
- - mapFolding\theSSOT.py (and/or theSSOTnumba.py and/ or theSSOT____.py, if they exist)
133
+ - mapFolding\theSSOT.py
135
134
  - Modify broad settings or find functions to modify broad settings, such as data structures and their data types
136
135
  - Create new settings or groups of settings
137
136
  - mapFolding\beDRY.py
@@ -0,0 +1,41 @@
1
+ mapFolding/__init__.py,sha256=hONqdWnBN1ebgrKZuMIZfI8m-1krSR66L4GTVRwBmw4,203
2
+ mapFolding/basecamp.py,sha256=Ik_oH-MpH8f6k-yBzwm99lfkv3pMDgFFEnSSDyiJjsQ,3861
3
+ mapFolding/beDRY.py,sha256=nn0AEGzrroM3wp91Fts7mmx1VQgG14s0EZsXR-Uy5x8,9049
4
+ mapFolding/filesystem.py,sha256=KqgsO-jaSWAlYib_9ovoXQY76PcQri09_73u0OqMWC8,4094
5
+ mapFolding/noHomeYet.py,sha256=DAppmTJG95Ip1qF1uVLU_vXGz4Lmonp8OYfGXtmOnTE,785
6
+ mapFolding/oeis.py,sha256=ZNt3UBklmpfjdmgbA7pO-ezz2prafr2JvdkpIDapi1w,11853
7
+ mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ mapFolding/theDao.py,sha256=E-hisOy_1_iQqS6w4c7S-C-sIgIcwnAPFqooeWuinVY,9008
9
+ mapFolding/theSSOT.py,sha256=r7_9t0dOo_IfBMqmkm1WXOzMfZjyPNco0hl1g9uU_2Y,12710
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=g4VkNKp2ts0koqcMSPNbE_ySR2-23Y-5CJBDpvbT6XU,16853
20
+ mapFolding/someAssemblyRequired/__init__.py,sha256=G1uIo1RWcdBjeFPXFwa69kizsZFzkDR55B2uyyY5z7E,680
21
+ mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=2kGRji3FGaALZwUZ6qlEjS7QxOkJK1Si-mAnsWePs_Q,983
22
+ mapFolding/someAssemblyRequired/ingredientsNumba.py,sha256=u5621TzZW7Sp8BXedq0yooyYoFwDDsd9smoqObzRf8g,7359
23
+ mapFolding/someAssemblyRequired/synthesizeDataConverters.py,sha256=J1qLKxqCMQd5JhcrTg9fvpPCfhb5TLz2wXY-J9z-TH8,5792
24
+ mapFolding/someAssemblyRequired/synthesizeNumbaJobVESTIGIAL.py,sha256=3yRCEMIf9UCswu6wQvdUK9H3MW6Ossn-wg5eOq8LWz8,22362
25
+ mapFolding/someAssemblyRequired/transformationTools.py,sha256=u2ah47kOqvVGKifuk7rZe4bSm3Z681nJzp73IXavYw4,36297
26
+ mapFolding/syntheticModules/numbaCountHistoricalExample.py,sha256=Oo0Xeex89sLD15iRt3N76OKRFScKl9qwO84-d5sv6lM,11871
27
+ mapFolding/syntheticModules/numbaCount_doTheNeedful.py,sha256=52RuwJVH2fROvWU2dT8wYcQvLgRuvkNZPq01kujCC_U,15725
28
+ mapFolding/syntheticModules/numba_doTheNeedfulHistoricalExample.py,sha256=J9wZ9PW5EVduOQWVze7CgpTHkUjRIvBPG8fNuT3IVpA,1145
29
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ tests/conftest.py,sha256=rRlXOhihwheHyQ8ggjRBbmgPVERxWjupajguVBzBkVE,10783
31
+ tests/test_computations.py,sha256=YhadlskBh_r5RiefHRy0FlrYQ0FelYbqcSNNSkSJMIY,3368
32
+ tests/test_filesystem.py,sha256=Kou0gj5T72oISao6umYfU6L_W5Hi7QS9_IxTv2hU0Pw,3147
33
+ tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
34
+ tests/test_other.py,sha256=1uuApByNWPiTf0zaro2dETkvyWQFfMweU_ge4aJuVgM,4244
35
+ tests/test_tasks.py,sha256=hkZygihT8bCEO2zc-2VcxReQrZJBwgLNbYx0YP4lTDg,2853
36
+ mapfolding-0.8.0.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
37
+ mapfolding-0.8.0.dist-info/METADATA,sha256=AA0b9jY45EztgHbZQq8SbpBExcDpnmhotXZB4DDO_2A,7670
38
+ mapfolding-0.8.0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
39
+ mapfolding-0.8.0.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
40
+ mapfolding-0.8.0.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
41
+ mapfolding-0.8.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/conftest.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from collections.abc import Callable, Generator, Sequence
2
- from mapFolding.theSSOT import getAlgorithmDispatcher, getSourceAlgorithm, getPackageDispatcher, theModuleOfSyntheticModules, FREAKOUT
2
+ from mapFolding.theSSOT import getAlgorithmDispatcher, getSourceAlgorithm, getPackageDispatcher, theModuleOfSyntheticModules, raiseIfNoneGitHubIssueNumber3
3
3
  from mapFolding.beDRY import getLeavesTotal, validateListDimensions, makeDataContainer
4
4
  from mapFolding.oeis import oeisIDsImplemented, settingsOEIS
5
5
  from pathlib import Path
@@ -10,7 +10,6 @@ import random
10
10
  import shutil
11
11
  import unittest.mock
12
12
  import uuid
13
- # TODO learn how to run tests and coverage analysis without `env = ["NUMBA_DISABLE_JIT=1"]`
14
13
 
15
14
  # SSOT for test data paths and filenames
16
15
  pathDataSamples = Path("tests/dataSamples")
@@ -215,7 +214,7 @@ def syntheticDispatcherFixture(useThisDispatcher: Callable[..., Any]) -> Callabl
215
214
  dispatcherSynthetic = stuff
216
215
 
217
216
  if dispatcherSynthetic is None:
218
- raise FREAKOUT
217
+ raise raiseIfNoneGitHubIssueNumber3
219
218
 
220
219
  dispatcherSpec = importlib.util.spec_from_file_location(dispatcherSynthetic.callableSynthesized, dispatcherSynthetic.pathFilenameForMe)
221
220
  if dispatcherSpec is None:
tests/test_filesystem.py CHANGED
@@ -3,9 +3,7 @@ from mapFolding.filesystem import getFilenameFoldsTotal, getPathFilenameFoldsTot
3
3
  from mapFolding.beDRY import validateListDimensions
4
4
  from mapFolding.theSSOT import getPathJobRootDEFAULT
5
5
  from pathlib import Path
6
- from typing import Any
7
6
  import io
8
- import numpy
9
7
  import pytest
10
8
  import unittest.mock
11
9
 
tests/test_other.py CHANGED
@@ -42,8 +42,8 @@ import sys
42
42
  (tuple([3, 5, 7]), [3, 5, 7], (3, 5, 7)), # tuple sequence type
43
43
  ])
44
44
  def test_listDimensionsAsParameter(listDimensions: None | list[str] | list[int] | list[float] | list[None] | list[bool] | list[list[int]] | list[complex] | range | tuple[int, ...],
45
- expected_intInnit: type[ValueError] | list[int] | type[TypeError],
46
- expected_validateListDimensions: type[ValueError] | type[NotImplementedError] | tuple[int, ...] | type[TypeError]) -> None:
45
+ expected_intInnit: type[ValueError] | list[int] | type[TypeError],
46
+ expected_validateListDimensions: type[ValueError] | type[NotImplementedError] | tuple[int, ...] | type[TypeError]) -> None:
47
47
  """Test both validateListDimensions and getLeavesTotal with the same inputs."""
48
48
  standardizedEqualToCallableReturn(expected_intInnit, intInnit, listDimensions)
49
49
  standardizedEqualToCallableReturn(expected_validateListDimensions, validateListDimensions, listDimensions)
@@ -56,7 +56,6 @@ def test_getLeavesTotal_edge_cases() -> None:
56
56
  # Input preservation
57
57
  mapShape = (2, 3)
58
58
  standardizedEqualToCallableReturn(6, getLeavesTotal, mapShape)
59
- # Remove the lambda entirely for a simpler approach
60
59
  assert mapShape == (2, 3), "Input tuple was modified"
61
60
 
62
61
  @pytest.mark.parametrize("nameOfTest,callablePytest", PytestFor_intInnit())
tests/test_tasks.py CHANGED
@@ -12,10 +12,6 @@ import pytest
12
12
  if __name__ == '__main__':
13
13
  multiprocessing.set_start_method('spawn')
14
14
 
15
-
16
- # TODO add a test. `C` = number of logical cores available. `n = C + 1`. Ensure that `[2,n]` is computed correctly.
17
- # Or, probably smarter: limit the number of cores, then run a test with C+1.
18
-
19
15
  def test_countFoldsComputationDivisionsInvalid(mapShapeTestFunctionality: tuple[int, ...]) -> None:
20
16
  standardizedEqualToCallableReturn(ValueError, countFolds, mapShapeTestFunctionality, None, {"wrong": "value"})
21
17