mapFolding 0.15.0__py3-none-any.whl → 0.15.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.
Files changed (37) hide show
  1. mapFolding/__init__.py +1 -0
  2. mapFolding/_oeisFormulas/A001010.py +19 -0
  3. mapFolding/_oeisFormulas/A001011.py +5 -0
  4. mapFolding/_oeisFormulas/Z0Z_aOFn.py +15 -3
  5. mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py +13 -16
  6. mapFolding/_theTypes.py +1 -1
  7. mapFolding/basecamp.py +89 -9
  8. mapFolding/daoOfMapFolding.py +2 -1
  9. mapFolding/oeis.py +1 -5
  10. mapFolding/reference/jaxCount.py +1 -1
  11. mapFolding/reference/rotatedEntryPoint.py +1 -1
  12. mapFolding/someAssemblyRequired/A007822rawMaterials.py +46 -0
  13. mapFolding/someAssemblyRequired/makeAllModules.py +185 -203
  14. mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +2 -2
  15. mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +2 -2
  16. mapFolding/syntheticModules/algorithmA007822.py +166 -0
  17. mapFolding/syntheticModules/algorithmA007822Numba.py +95 -0
  18. mapFolding/syntheticModules/{countParallel.py → countParallelNumba.py} +4 -6
  19. mapFolding/syntheticModules/{daoOfMapFolding.py → daoOfMapFoldingNumba.py} +4 -5
  20. mapFolding/syntheticModules/dataPacking.py +2 -1
  21. mapFolding/syntheticModules/dataPackingA007822.py +28 -0
  22. mapFolding/syntheticModules/{initializeCount.py → initializeState.py} +1 -1
  23. mapFolding/syntheticModules/initializeStateA007822.py +69 -0
  24. mapFolding/syntheticModules/theorem2.py +2 -1
  25. mapFolding/syntheticModules/theorem2A007822.py +70 -0
  26. mapFolding/syntheticModules/theorem2A007822Numba.py +66 -0
  27. mapFolding/syntheticModules/theorem2A007822Trimmed.py +64 -0
  28. mapFolding/syntheticModules/theorem2Numba.py +4 -4
  29. mapFolding/syntheticModules/theorem2Trimmed.py +2 -1
  30. mapFolding/tests/test_computations.py +29 -4
  31. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/METADATA +2 -2
  32. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/RECORD +36 -27
  33. mapFolding/_A007822.py +0 -181
  34. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/WHEEL +0 -0
  35. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/entry_points.txt +0 -0
  36. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/licenses/LICENSE +0 -0
  37. {mapfolding-0.15.0.dist-info → mapfolding-0.15.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,64 @@
1
+ from mapFolding.dataBaskets import MapFoldingState
2
+
3
+ def count(state: MapFoldingState) -> MapFoldingState:
4
+ while state.leaf1ndex > 4:
5
+ if state.leafBelow[0] == 1:
6
+ if state.leaf1ndex > state.leavesTotal:
7
+ state.indexLeaf = 0
8
+ leafConnectee = 0
9
+ while leafConnectee < state.leavesTotal + 1:
10
+ leafNumber = int(state.leafBelow[state.indexLeaf])
11
+ state.leafComparison[leafConnectee] = (leafNumber - state.indexLeaf + state.leavesTotal) % state.leavesTotal
12
+ state.indexLeaf = leafNumber
13
+ leafConnectee += 1
14
+ indexInMiddle = state.leavesTotal // 2
15
+ state.indexMiniGap = 0
16
+ while state.indexMiniGap < state.leavesTotal + 1:
17
+ ImaSymmetricFold = True
18
+ leafConnectee = 0
19
+ while leafConnectee < indexInMiddle:
20
+ if state.leafComparison[(state.indexMiniGap + leafConnectee) % (state.leavesTotal + 1)] != state.leafComparison[(state.indexMiniGap + state.leavesTotal + 1 - 2 - leafConnectee) % (state.leavesTotal + 1)]:
21
+ ImaSymmetricFold = False
22
+ break
23
+ leafConnectee += 1
24
+ if ImaSymmetricFold:
25
+ state.groupsOfFolds += 1
26
+ state.indexMiniGap += 1
27
+ else:
28
+ state.dimensionsUnconstrained = state.dimensionsTotal
29
+ state.gap1ndexCeiling = state.gapRangeStart[state.leaf1ndex - 1]
30
+ state.indexDimension = 0
31
+ while state.indexDimension < state.dimensionsTotal:
32
+ state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex]
33
+ if state.leafConnectee == state.leaf1ndex:
34
+ state.dimensionsUnconstrained -= 1
35
+ else:
36
+ while state.leafConnectee != state.leaf1ndex:
37
+ state.gapsWhere[state.gap1ndexCeiling] = state.leafConnectee
38
+ if state.countDimensionsGapped[state.leafConnectee] == 0:
39
+ state.gap1ndexCeiling += 1
40
+ state.countDimensionsGapped[state.leafConnectee] += 1
41
+ state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leafBelow[state.leafConnectee]]
42
+ state.indexDimension += 1
43
+ state.indexMiniGap = state.gap1ndex
44
+ while state.indexMiniGap < state.gap1ndexCeiling:
45
+ state.gapsWhere[state.gap1ndex] = state.gapsWhere[state.indexMiniGap]
46
+ if state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] == state.dimensionsUnconstrained:
47
+ state.gap1ndex += 1
48
+ state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] = 0
49
+ state.indexMiniGap += 1
50
+ while state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1]:
51
+ state.leaf1ndex -= 1
52
+ state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leafBelow[state.leaf1ndex]
53
+ state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leafAbove[state.leaf1ndex]
54
+ state.gap1ndex -= 1
55
+ state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
56
+ state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
57
+ state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leaf1ndex
58
+ state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
59
+ state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
60
+ state.leaf1ndex += 1
61
+ else:
62
+ state.groupsOfFolds *= 2
63
+ state.groupsOfFolds = (state.groupsOfFolds + 1) // 2
64
+ return state
@@ -1,5 +1,4 @@
1
- from mapFolding.dataBaskets import (
2
- Array1DElephino, Array1DLeavesTotal, Array3DLeavesTotal, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal)
1
+ from mapFolding.dataBaskets import Array1DElephino, Array1DLeavesTotal, Array3DLeavesTotal, DatatypeElephino, DatatypeFoldsTotal, DatatypeLeavesTotal
3
2
  from numba import jit
4
3
 
5
4
  @jit(cache=True, error_model='numpy', fastmath=True, forceinline=True)
@@ -42,5 +41,6 @@ def count(groupsOfFolds: DatatypeFoldsTotal, gap1ndex: DatatypeElephino, gap1nde
42
41
  leafAbove[leafBelow[leaf1ndex]] = leaf1ndex
43
42
  gapRangeStart[leaf1ndex] = gap1ndex
44
43
  leaf1ndex += 1
45
- groupsOfFolds *= 2
46
- return (groupsOfFolds, gap1ndex, gap1ndexCeiling, indexDimension, indexMiniGap, leaf1ndex, leafConnectee, dimensionsUnconstrained, countDimensionsGapped, gapRangeStart, gapsWhere, leafAbove, leafBelow, connectionGraph, dimensionsTotal, leavesTotal)
44
+ else:
45
+ groupsOfFolds *= 2
46
+ return (groupsOfFolds, gap1ndex, gap1ndexCeiling, indexDimension, indexMiniGap, leaf1ndex, leafConnectee, dimensionsUnconstrained, countDimensionsGapped, gapRangeStart, gapsWhere, leafAbove, leafBelow, connectionGraph, dimensionsTotal, leavesTotal)
@@ -39,5 +39,6 @@ def count(state: MapFoldingState) -> MapFoldingState:
39
39
  state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
40
40
  state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
41
41
  state.leaf1ndex += 1
42
- state.groupsOfFolds *= 2
42
+ else:
43
+ state.groupsOfFolds *= 2
43
44
  return state
@@ -30,7 +30,7 @@ from mapFolding.dataBaskets import MapFoldingState
30
30
  from mapFolding.oeis import dictionaryOEIS
31
31
  from mapFolding.someAssemblyRequired.makeAllModules import parametersNumbaLight
32
32
  from mapFolding.someAssemblyRequired.RecipeJob import RecipeJobTheorem2
33
- from mapFolding.syntheticModules.initializeCount import initializeGroupsOfFolds
33
+ from mapFolding.syntheticModules.initializeState import transitionOnGroupsOfFolds
34
34
  from mapFolding.tests.conftest import registrarRecordsTemporaryFilesystemObject, standardizedEqualToCallableReturn
35
35
  from pathlib import Path, PurePosixPath
36
36
  from typing import Literal
@@ -41,8 +41,8 @@ import pytest
41
41
  if __name__ == '__main__':
42
42
  multiprocessing.set_start_method('spawn')
43
43
 
44
- @pytest.mark.parametrize('flow', ['daoOfMapFolding', 'theorem2', 'theorem2Trimmed', 'theorem2numba'])
45
- def test_flowControl(mapShapeTestCountFolds: tuple[int, ...], flow: Literal['daoOfMapFolding', 'theorem2', 'theorem2numba']) -> None:
44
+ @pytest.mark.parametrize('flow', ['daoOfMapFolding', 'numba', 'theorem2', 'theorem2numba', 'theorem2Trimmed'])
45
+ def test_flowControl(mapShapeTestCountFolds: tuple[int, ...], flow: str) -> None:
46
46
  """Validate that different computational flows produce identical results.
47
47
 
48
48
  (AI generated docstring)
@@ -86,6 +86,31 @@ def test_aOFn_calculate_value(oeisID: str) -> None:
86
86
  for n in dictionaryOEIS[oeisID]['valuesTestValidation']:
87
87
  standardizedEqualToCallableReturn(dictionaryOEIS[oeisID]['valuesKnown'][n], oeisIDfor_n, oeisID, n)
88
88
 
89
+ @pytest.mark.parametrize('flow', ['numba', 'theorem2', 'theorem2numba', 'theorem2Trimmed'])
90
+ def test_flowControlByOEISid(flow: str) -> None:
91
+ """Crappy.
92
+
93
+ I'm making this while pushing through pain, so it's not great but it's a step in the right direction.
94
+
95
+ Notes for future me:
96
+
97
+ `oeisID` is a fixture: don't use it here.
98
+
99
+ `OEISid` matches `test_flowControlByOEISid`. It's pseudo-hardcoded to A007822 because that's currently the only OEISid that needs this test.
100
+ I tried:
101
+ `def test_flowControlByOEISid(OEISid: str | None, flow: str) -> None:`
102
+
103
+ But that's wrong.
104
+
105
+ So, I'm changing the local identifier `OEISid` back to `oeisID` because I use `oeisID` everywhere else.
106
+ """
107
+
108
+ oeisID = 'A007822'
109
+
110
+ for n in dictionaryOEIS[oeisID]['valuesTestValidation']:
111
+ mapShape = dictionaryOEIS[oeisID]['getMapShape'](n)
112
+ standardizedEqualToCallableReturn(dictionaryOEIS[oeisID]['valuesKnown'][n], countFolds, None, None, None, None, mapShape, oeisID, None, flow)
113
+
89
114
  @pytest.mark.parametrize('pathFilename_tmpTesting', ['.py'], indirect=True)
90
115
  def test_writeJobNumba(oneTestCuzTestsOverwritingTests: tuple[int, ...], pathFilename_tmpTesting: Path) -> None:
91
116
  """Test dynamic code generation and execution for computational modules.
@@ -111,7 +136,7 @@ def test_writeJobNumba(oneTestCuzTestsOverwritingTests: tuple[int, ...], pathFil
111
136
  from mapFolding.someAssemblyRequired.makeJobTheorem2Numba import makeJobNumba # noqa: PLC0415
112
137
  from mapFolding.someAssemblyRequired.toolkitNumba import SpicesJobNumba # noqa: PLC0415
113
138
  mapShape = oneTestCuzTestsOverwritingTests
114
- state = initializeGroupsOfFolds(MapFoldingState(mapShape))
139
+ state = transitionOnGroupsOfFolds(MapFoldingState(mapShape))
115
140
 
116
141
  pathFilenameModule = pathFilename_tmpTesting.absolute()
117
142
  pathFilenameFoldsTotal = pathFilenameModule.with_suffix('.foldsTotalTesting')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapFolding
3
- Version: 0.15.0
3
+ Version: 0.15.2
4
4
  Summary: Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License: CC-BY-NC-4.0
@@ -8,7 +8,7 @@ Project-URL: Donate, https://www.patreon.com/integrated
8
8
  Project-URL: Homepage, https://github.com/hunterhogan/mapFolding
9
9
  Project-URL: Issues, https://github.com/hunterhogan/mapFolding/issues
10
10
  Project-URL: Repository, https://github.com/hunterhogan/mapFolding.git
11
- Keywords: A000136,A000560,A000682,A001415,A001416,A001417,A001418,A005315,A005316,A007822,A195646,A223094,A259702,A301620,abstract syntax tree,algorithmic combinatorics,algorithmic optimization,arch configurations,AST manipulation,automated code generation,bit-packed arrays,bitwise state machines,cache-efficient algorithms,closed meandric numbers,code generation,code optimization,code synthesis,code transformation,codon optimization,combinatorial computing,combinatorial enumeration,combinatorial geometry,combinatorial mathematics,combinatorial problem solver,combinatorics,computational combinatorics,computational geometry,crossing patterns,curve crossings,dataclass transformation,discrete mathematics,dynamic compilation,enumerative combinatorics,folding pattern enumeration,folding problems,GPU acceleration,high-performance computing,integer sequences,JIT compilation,just-in-time compilation,kernel optimization,labeled stamp folding,low-level computation,map folding,mapFolding,mathematical algorithms,mathematical modeling,mathematical optimization,mathematical patterns,mathematical software,mathematical tool,mathematical visualization,meander enumeration,meanders,meandric systems,memory-efficient enumeration,metaprogramming,Numba optimization,numerical algorithms,numerical computation,OEIS,open meandric systems,paper folding mathematics,parallel computing,pattern recognition,performance optimization,permutation patterns,permutations,post-setup optimization,pyproject,Python optimization,scientific computing,semi-meanders,sequence analysis,sequence calculator,sequence enumeration,sequence explorer,sequence generation,source code analysis,stamp folding,symbolic computation,symmetric foldings,topological combinatorics,topological patterns,typed Python
11
+ Keywords: A000136,A000560,A000682,A001010,A001011,A001415,A001416,A001417,A001418,A005315,A005316,A007822,A195646,A223094,A259702,A301620,AST manipulation,GPU acceleration,JIT compilation,Numba optimization,OEIS,Python optimization,abstract syntax tree,algorithmic combinatorics,algorithmic optimization,arch configurations,automated code generation,bit-packed arrays,bitwise state machines,cache-efficient algorithms,closed meandric numbers,code generation,code optimization,code synthesis,code transformation,codon optimization,combinatorial computing,combinatorial enumeration,combinatorial geometry,combinatorial mathematics,combinatorial problem solver,combinatorics,computational combinatorics,computational geometry,crossing patterns,curve crossings,dataclass transformation,discrete mathematics,dynamic compilation,enumerative combinatorics,folding pattern enumeration,folding problems,high-performance computing,integer sequences,just-in-time compilation,kernel optimization,labeled stamp folding,low-level computation,map folding,mapFolding,mathematical algorithms,mathematical modeling,mathematical optimization,mathematical patterns,mathematical software,mathematical tool,mathematical visualization,meander enumeration,meanders,meandric systems,memory-efficient enumeration,metaprogramming,numerical algorithms,numerical computation,open meandric systems,paper folding mathematics,parallel computing,pattern recognition,performance optimization,permutation patterns,permutations,post-setup optimization,pyproject,scientific computing,semi-meanders,sequence analysis,sequence calculator,sequence enumeration,sequence explorer,sequence generation,source code analysis,stamp folding,symbolic computation,symmetric foldings,topological combinatorics,topological patterns,typed Python
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Environment :: Console
14
14
  Classifier: Intended Audience :: Developers
@@ -1,24 +1,25 @@
1
- mapFolding/_A007822.py,sha256=Ge2PsiLvnz6jOjEGCV95cuQNRFQQT7hdHhdlePaEzyQ,6939
2
- mapFolding/__init__.py,sha256=mtABkOaPaJSdabbrGrVOzYV330UrSU6ObgOqKtd4p3M,3665
1
+ mapFolding/__init__.py,sha256=UqUsMLADRoBiWI7YTwQqdP7gnoQ2HrerquHXPRTPeFM,3703
3
2
  mapFolding/_theSSOT.py,sha256=s2yx72OMJIQEFM_x-UpPuS8uzGEyt9hS4aCKU2GWERA,4832
4
- mapFolding/_theTypes.py,sha256=Y51kXvBExzjOABGKr8gP6qCsP-wHnJ7eGajoPmWa09c,3678
5
- mapFolding/basecamp.py,sha256=Uzy9GmU3o0vCKieVr2d_R2Mmx4gNsso8tXjkO0rXIlQ,9426
3
+ mapFolding/_theTypes.py,sha256=wzr05TeV6gp7OlMNKvmP2yR5LI94BrBUWHe_7zXJRyM,3677
4
+ mapFolding/basecamp.py,sha256=GtuP4WXG2s345RYLiRibt3d-MbH9qyJ7j-uWRR3UyfQ,12976
6
5
  mapFolding/beDRY.py,sha256=iYATcrYrAWkKaAecjA_awELBtZP5Q3snU4053dIsEwU,13941
7
- mapFolding/daoOfMapFolding.py,sha256=ncTIiBfTsM8SNVx9qefZ0bBcBtviWLSk4iPv3Z9nGiE,5442
6
+ mapFolding/daoOfMapFolding.py,sha256=yLqaAqMwHIVFAtig3T46aZZQLAjCtQzYoAi0iMs_2CY,5482
8
7
  mapFolding/dataBaskets.py,sha256=04tVULSbWbPkKkLjTofWfVOr6gWcs38XILvU0-ftHIU,15191
9
8
  mapFolding/filesystemToolkit.py,sha256=Ex5tyugRQurXIgUNVtkQYfWMq8fM4e-izX01MBXU5_8,11006
10
- mapFolding/oeis.py,sha256=8dEqY2yJ2H3dZ8Gj1oTgYoNGmxviXwQRewMxyUNrCV0,19214
9
+ mapFolding/oeis.py,sha256=nP_-cSNMkEsC0VWD93AqTO4lA7VFfkVsG-c3DnkwsaU,19093
11
10
  mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
11
  mapFolding/_oeisFormulas/A000136.py,sha256=G_vqOdb6s_YBbrCkHKjQDnlYfOZ4suXRtie6bRI7hhE,105
13
12
  mapFolding/_oeisFormulas/A000560.py,sha256=sN5-BAjL0oDk7YXZ2kx7ffBDX-gC28mmOj4CxHkM36c,113
14
13
  mapFolding/_oeisFormulas/A000682.py,sha256=w1u9ECjqw32IA_crWkdcFt_iojfmA7Js1ps8AEYb6es,516
14
+ mapFolding/_oeisFormulas/A001010.py,sha256=-QjtVNo34EqOeQjOufuI32b7e6gn1aj5I5j_I_aAlyo,431
15
+ mapFolding/_oeisFormulas/A001011.py,sha256=IlPvOdz0tSGSKTxKXTFYD41fO1N0TtUwwgvewbbteQs,177
15
16
  mapFolding/_oeisFormulas/A005315.py,sha256=g1P52zUuWCLFbTb_i6U75sVzXfUGaCM3rJonXNRgVr4,109
16
17
  mapFolding/_oeisFormulas/A005316.py,sha256=3B4_2TT_ip3CcYngEaFS-rTNDx-x2TZ0r_J0f8IMJbQ,234
17
18
  mapFolding/_oeisFormulas/A223094.py,sha256=z7t6RcRQlhXdbYImIER15KwG1_W7iV4MNIRDx9Q_Efs,284
18
19
  mapFolding/_oeisFormulas/A259702.py,sha256=9hUs8jzwOnJGmBsueS1yGsLjau4YVa0Yd9lYMG8UFso,123
19
20
  mapFolding/_oeisFormulas/A301620.py,sha256=pY0OJsCLhIEDHQUKpeSMTZ2SUFvcqt83uCOPE_lZCsw,225
20
- mapFolding/_oeisFormulas/Z0Z_aOFn.py,sha256=HadJifbcq8s5KrdhlPCP9r3gsh6AZHyN_M4_JTNoXiY,728
21
- mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py,sha256=yww1A9MCyCEdomzD1lqgf0aYdbY3ztspSRPoJD0t7uE,1766
21
+ mapFolding/_oeisFormulas/Z0Z_aOFn.py,sha256=bx2C5hkQH9BK20ARLWpqgAzARFU8aNI3N1s9FoQX4eU,967
22
+ mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py,sha256=c2PdVz2UdrHl3cnOVqrxr1VcquIb1jijuj4bZlIOYHk,1816
22
23
  mapFolding/_oeisFormulas/__init__.py,sha256=n83beVb7HHplXYAM5HveaIAuR7KrJG99OaNHJGMb_uc,44
23
24
  mapFolding/_oeisFormulas/matrixMeanders.py,sha256=Qk7S2dTpfZp-5bg--Qsspb2voOTBeLLQd7J_iQH3OpE,7356
24
25
  mapFolding/_oeisFormulas/matrixMeandersAnnex.py,sha256=UdSZCI9PtiuPCFTT6kLQZY7uoalaOkYzcR5VXUN8v1U,5793
@@ -33,47 +34,55 @@ mapFolding/reference/__init__.py,sha256=GKcSgYE49NcTISx-JZbELXyq-eRkMeTL5g4DXInW
33
34
  mapFolding/reference/flattened.py,sha256=0eHgLFIeIeVUsI5zF5oSy5iWYrjOMzxr7KjDxiTe01k,16078
34
35
  mapFolding/reference/hunterNumba.py,sha256=iLfyqwGdAh6c5GbapnKsWhAsNsR3O-fyGGHAdohluLw,7258
35
36
  mapFolding/reference/irvineJavaPort.py,sha256=XnsL4g33LRrYwAhcrAVt-ujsP6QD6fbyCsGYzcm9g_k,3724
36
- mapFolding/reference/jaxCount.py,sha256=TuDNKOnyhQfuixKmIxO9Algv7dvy7KMGhgsV3h96FGE,14853
37
+ mapFolding/reference/jaxCount.py,sha256=t8ons45zyWNJQ-nmn1qbhNsTkTnRzf7ATauaYvIlkRI,14853
37
38
  mapFolding/reference/lunnonNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
38
39
  mapFolding/reference/lunnonWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
39
40
  mapFolding/reference/matrixMeandersBaseline.py,sha256=8Z98MMfhTCdoa75HWZz4DO166EiHZCu5eHeFzhgK42s,3003
40
41
  mapFolding/reference/matrixMeandersBaselineAnnex.py,sha256=d2Oh4JZxz53ox_ArhIxpMTOuA7rtE9wnEPojpFcnlfc,5817
41
42
  mapFolding/reference/matrixMeandersSimpleQueue.py,sha256=pOfaS315OKIBG9GSqSJwUDcEhfnV2XduM9IPqHrBvJg,4083
42
43
  mapFolding/reference/matrixMeandersSlicePop.py,sha256=XyiesSQAH1dRplYx_CdR1FzcXvgmmxzj27V4aIqPp7o,5353
43
- mapFolding/reference/rotatedEntryPoint.py,sha256=5ughpKUT2JQhoAKgoDUdYNjgWQYPGV8v-7dWEAdDmfE,10274
44
+ mapFolding/reference/rotatedEntryPoint.py,sha256=3IJU7Hc2PDSE71wmSkDs4Z3t0Px9NBSzmCsVrgQuQyU,10274
44
45
  mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
45
46
  mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
46
47
  mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
47
48
  mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
49
+ mapFolding/someAssemblyRequired/A007822rawMaterials.py,sha256=I1lZyQ_4H7Ey07diN-0Ai7c-NUaV4ffFsZCUWdELXjc,1701
48
50
  mapFolding/someAssemblyRequired/RecipeJob.py,sha256=yGGPHq9JX-Gf7QlJz50EPpkO7sADwGvSZNA1aC_F_PQ,9866
49
51
  mapFolding/someAssemblyRequired/__init__.py,sha256=UNDh6O86jT5ywlw9LgeWsUHwOfNvoMJRDAzYXbwCbeM,5779
50
52
  mapFolding/someAssemblyRequired/_toolIfThis.py,sha256=VDZC10Xo3E1Y5n6FmaBBbOBR-rinV9DFkpgw8zrDyzg,6339
51
53
  mapFolding/someAssemblyRequired/_toolkitContainers.py,sha256=Xbo1QJT8KtrWcAvQ-eLzOEzR8N78WfF43fJKGRIebA4,13625
52
54
  mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=tY0-2K0BFkwLAAjSrFJLPoG8CevDHOFc3OH3TxXANzg,2806
53
55
  mapFolding/someAssemblyRequired/infoBooth.py,sha256=GWiqnHbqk7te_pvVuk4G_gbFa_W2aeSx19w4pakvqfM,2300
54
- mapFolding/someAssemblyRequired/makeAllModules.py,sha256=o22qQ35N9M3N3kra16IayOpXMI1bkwVNQ5c04_rxMGw,44295
55
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py,sha256=jh2tEqIWEVf015BkaMp5qx5IfGeECyJJzUZkUUw4J_E,17192
56
- mapFolding/someAssemblyRequired/makeJobTheorem2codon.py,sha256=q35Fsu1J3Alc9HLs4XvQ6r_caZJ4M69PHXFI0-NXaHY,11322
56
+ mapFolding/someAssemblyRequired/makeAllModules.py,sha256=mNIT-qUJt75qJLTCVElbZPIZNH36qOG3akAJ57JerTo,44490
57
+ mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py,sha256=wflkPttFID9vao4C4CohoUCYgbMWD7GhZ7TO9h5mwtE,17196
58
+ mapFolding/someAssemblyRequired/makeJobTheorem2codon.py,sha256=EPcrnHrK_TBqVB5uLvHz-XLcjaNYUhfQZCNaROCS1Oo,11326
57
59
  mapFolding/someAssemblyRequired/toolkitNumba.py,sha256=nCCVsGidAlcKRVAvA__hu4bXtat3B-cO9YloKtqOAc4,14919
58
60
  mapFolding/someAssemblyRequired/transformationTools.py,sha256=nPGZsvb5GquaCCxdDh_XzNIZYSiVJpWKd7wfhfRvxnk,11512
59
61
  mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
60
- mapFolding/syntheticModules/countParallel.py,sha256=_-OoZ07-5oC3WeB603tXUGT9c9-kmsDVtcluMTM8y1U,7784
61
- mapFolding/syntheticModules/daoOfMapFolding.py,sha256=OYaMwdyFzlll0OYlUwxQSvyLHgI4QzkDGkCPen1TFJ4,5946
62
- mapFolding/syntheticModules/dataPacking.py,sha256=vAi4vsGCwU_q8r3XpqW6LyuTba17ProT941pKbiWjCk,2320
63
- mapFolding/syntheticModules/initializeCount.py,sha256=nWSlJMMfIM3DvZxMn6ISQusUJqRYAjKQyLF5hwLEdBQ,3119
64
- mapFolding/syntheticModules/theorem2.py,sha256=9jrbZNNX4BWYZW1S0JjvRY2k7RU7I1RNUMV7JdCt1ZY,3017
65
- mapFolding/syntheticModules/theorem2Numba.py,sha256=qfHlyiOxP1lLNvYg4zsrcLfKnynWAdu5dYGyrGPDtlM,3407
66
- mapFolding/syntheticModules/theorem2Trimmed.py,sha256=DHW3NxBdtABQYBKm2WRvfQ5kzc2_UwGI2h4ePuYEJoM,2685
62
+ mapFolding/syntheticModules/algorithmA007822.py,sha256=0Nsi-l9it4Wd9TACEecvOh02as_6gZJ9IsLcbVhZLFE,7078
63
+ mapFolding/syntheticModules/algorithmA007822Numba.py,sha256=Tiychj5ST0Mxsw7KVp9Movdor5-deRb0tnfTbXA_RTc,7226
64
+ mapFolding/syntheticModules/countParallelNumba.py,sha256=6sHWzGc6ch3HjKVB8krvaBec_KoHv3gpfN_F5Vl1SP8,7870
65
+ mapFolding/syntheticModules/daoOfMapFoldingNumba.py,sha256=5oMb8pttNKslN6wss9JIQXSnmjgE2q_2-3fIrh1pEW0,6033
66
+ mapFolding/syntheticModules/dataPacking.py,sha256=ZsEtbT3UCH2gscpK_N5ypGGUAyFA9_SrQaAnhr3BqjI,2413
67
+ mapFolding/syntheticModules/dataPackingA007822.py,sha256=6XxYMaZ0_WNm1IJ2HbjZBD14ouLCvrMFApW5u3paJBs,2474
68
+ mapFolding/syntheticModules/initializeState.py,sha256=OTiVi1Ywnlwk8tbwSIFjPJa_yBCINoapaCzGXDAJq_k,3121
69
+ mapFolding/syntheticModules/initializeStateA007822.py,sha256=7Qd-ggF5RcSKXyCnw7PehEVuAlfED6rnqlJokqmSuJ4,4348
70
+ mapFolding/syntheticModules/theorem2.py,sha256=QeXkBScihDatBk4iEMOMSntvhyJISb0G8zwZMQe7JFc,3031
71
+ mapFolding/syntheticModules/theorem2A007822.py,sha256=SaJpHt0juljfHYR1XZMYHkYmLCHu-bpGhf3fky39RUc,4258
72
+ mapFolding/syntheticModules/theorem2A007822Numba.py,sha256=E8U5_AF0uns-pDzJFMwfW44iCPDfUd5MsQM4jLCM1Os,4641
73
+ mapFolding/syntheticModules/theorem2A007822Trimmed.py,sha256=gaTWsTJoDgCf-cW3gyheU9j2cj_R8CNvrnAp7lzv_8s,3926
74
+ mapFolding/syntheticModules/theorem2Numba.py,sha256=AFe-KI97ilPgPFA22ASAhfUetaTA249K7By_vqu1Crs,3416
75
+ mapFolding/syntheticModules/theorem2Trimmed.py,sha256=geKX3So1SqhENlKeEO2dV6S3rGsxBp-AItB4hRbwbBI,2699
67
76
  mapFolding/tests/__init__.py,sha256=QVCHSMFVvTxV3mAyYOLkMFAFyBJ514zdoVnDmpBJnTo,1336
68
77
  mapFolding/tests/conftest.py,sha256=VZ9l0Vd2d-hdp6cVBmsTkYA7FZIH0cEgdeJx844oe3A,14624
69
- mapFolding/tests/test_computations.py,sha256=OjX7zECx2Hr6RsIi0hZZSzaiQJa7GBRLUpiASofNp-A,6541
78
+ mapFolding/tests/test_computations.py,sha256=I1FJ5YRat16TCn_YfgiQQgej1bfE986WhV6k0YRXKhA,7461
70
79
  mapFolding/tests/test_filesystem.py,sha256=0rYQ62f4e3HOoymXrxDWbqNEBJQ7DGN8RUOMI84tE2Q,3892
71
80
  mapFolding/tests/test_oeis.py,sha256=ejqaOMB61c1oUEBblPPBG9hFFXffpKuIS0CJMe7Rd1o,5497
72
81
  mapFolding/tests/test_other.py,sha256=ScBiJ78LnyAaW-RhxcouX6Xw10wgpSdqfvT4LO3WjnQ,4766
73
82
  mapFolding/tests/test_tasks.py,sha256=_pr9JRWjjNKA7sww70XvkJJdGPruBVzubM63RmD_Du0,4013
74
- mapfolding-0.15.0.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
75
- mapfolding-0.15.0.dist-info/METADATA,sha256=WqiwVl5WhvaaFlYtmq-toz5XCfcZYSSef1jY1awHxZk,5144
76
- mapfolding-0.15.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
- mapfolding-0.15.0.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
78
- mapfolding-0.15.0.dist-info/top_level.txt,sha256=aG3bjFBoxxuaV3Iu1wZAd241Ubs3cdaJtKYBQBDIjsg,11
79
- mapfolding-0.15.0.dist-info/RECORD,,
83
+ mapfolding-0.15.2.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
84
+ mapfolding-0.15.2.dist-info/METADATA,sha256=zT2XInHtZfx3eI_QvuO3YWp-Pm8TtJzHGuN8gBqJkTc,5160
85
+ mapfolding-0.15.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
86
+ mapfolding-0.15.2.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
87
+ mapfolding-0.15.2.dist-info/top_level.txt,sha256=aG3bjFBoxxuaV3Iu1wZAd241Ubs3cdaJtKYBQBDIjsg,11
88
+ mapfolding-0.15.2.dist-info/RECORD,,
mapFolding/_A007822.py DELETED
@@ -1,181 +0,0 @@
1
- from mapFolding import Array1DLeavesTotal, makeDataContainer, NumPyLeavesTotal
2
- from mapFolding.dataBaskets import MapFoldingState
3
- from mapFolding.oeis import dictionaryOEIS
4
- import numpy
5
- import sys
6
- import time
7
-
8
- def activeLeafGreaterThan0(state: MapFoldingState) -> bool:
9
- return state.leaf1ndex > 0
10
-
11
- def activeLeafGreaterThanLeavesTotal(state: MapFoldingState) -> bool:
12
- return state.leaf1ndex > state.leavesTotal
13
-
14
- def activeLeafIsTheFirstLeaf(state: MapFoldingState) -> bool:
15
- return state.leaf1ndex <= 1
16
-
17
- def activeLeafIsUnconstrainedInAllDimensions(state: MapFoldingState) -> bool:
18
- return not state.dimensionsUnconstrained
19
-
20
- def activeLeafUnconstrainedInThisDimension(state: MapFoldingState) -> MapFoldingState:
21
- state.dimensionsUnconstrained -= 1
22
- return state
23
-
24
- def filterCommonGaps(state: MapFoldingState) -> MapFoldingState:
25
- state.gapsWhere[state.gap1ndex] = state.gapsWhere[state.indexMiniGap]
26
- if state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] == state.dimensionsUnconstrained:
27
- state = incrementActiveGap(state)
28
- state.countDimensionsGapped[state.gapsWhere[state.indexMiniGap]] = 0
29
- return state
30
-
31
- def gapAvailable(state: MapFoldingState) -> bool:
32
- return state.leaf1ndex > 0
33
-
34
- def incrementActiveGap(state: MapFoldingState) -> MapFoldingState:
35
- state.gap1ndex += 1
36
- return state
37
-
38
- def incrementGap1ndexCeiling(state: MapFoldingState) -> MapFoldingState:
39
- state.gap1ndexCeiling += 1
40
- return state
41
-
42
- def incrementIndexMiniGap(state: MapFoldingState) -> MapFoldingState:
43
- state.indexMiniGap += 1
44
- return state
45
-
46
- def initializeIndexMiniGap(state: MapFoldingState) -> MapFoldingState:
47
- state.indexMiniGap = state.gap1ndex
48
- return state
49
-
50
- def initializeVariablesToFindGaps(state: MapFoldingState) -> MapFoldingState:
51
- state.dimensionsUnconstrained = state.dimensionsTotal
52
- state.gap1ndexCeiling = state.gapRangeStart[state.leaf1ndex - 1]
53
- state.indexDimension = 0
54
- return state
55
-
56
- def insertActiveLeaf(state: MapFoldingState) -> MapFoldingState:
57
- state.indexLeaf = 0
58
- while state.indexLeaf < state.leaf1ndex:
59
- state.gapsWhere[state.gap1ndexCeiling] = state.indexLeaf
60
- state.gap1ndexCeiling += 1
61
- state.indexLeaf += 1
62
- return state
63
-
64
- def insertActiveLeafAtGap(state: MapFoldingState) -> MapFoldingState:
65
- state.gap1ndex -= 1
66
- state.leafAbove[state.leaf1ndex] = state.gapsWhere[state.gap1ndex]
67
- state.leafBelow[state.leaf1ndex] = state.leafBelow[state.leafAbove[state.leaf1ndex]]
68
- state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leaf1ndex
69
- state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leaf1ndex
70
- state.gapRangeStart[state.leaf1ndex] = state.gap1ndex
71
- state.leaf1ndex += 1
72
- return state
73
-
74
- def leafBelowSentinelIs1(state: MapFoldingState) -> bool:
75
- return state.leafBelow[0] == 1
76
-
77
- def leafConnecteeIsActiveLeaf(state: MapFoldingState) -> bool:
78
- return state.leafConnectee == state.leaf1ndex
79
-
80
- def lookForGaps(state: MapFoldingState) -> MapFoldingState:
81
- state.gapsWhere[state.gap1ndexCeiling] = state.leafConnectee
82
- if state.countDimensionsGapped[state.leafConnectee] == 0:
83
- state = incrementGap1ndexCeiling(state)
84
- state.countDimensionsGapped[state.leafConnectee] += 1
85
- return state
86
-
87
- def lookupLeafConnecteeInConnectionGraph(state: MapFoldingState) -> MapFoldingState:
88
- state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leaf1ndex]
89
- return state
90
-
91
- def loopingLeavesConnectedToActiveLeaf(state: MapFoldingState) -> bool:
92
- return state.leafConnectee != state.leaf1ndex
93
-
94
- def loopingThroughTheDimensions(state: MapFoldingState) -> bool:
95
- return state.indexDimension < state.dimensionsTotal
96
-
97
- def loopingToActiveGapCeiling(state: MapFoldingState) -> bool:
98
- return state.indexMiniGap < state.gap1ndexCeiling
99
-
100
- def noGapsHere(state: MapFoldingState) -> bool:
101
- return (state.leaf1ndex > 0) and (state.gap1ndex == state.gapRangeStart[state.leaf1ndex - 1])
102
-
103
- def tryAnotherLeafConnectee(state: MapFoldingState) -> MapFoldingState:
104
- state.leafConnectee = state.connectionGraph[state.indexDimension, state.leaf1ndex, state.leafBelow[state.leafConnectee]]
105
- return state
106
-
107
- def tryNextDimension(state: MapFoldingState) -> MapFoldingState:
108
- state.indexDimension += 1
109
- return state
110
-
111
- def undoLastLeafPlacement(state: MapFoldingState) -> MapFoldingState:
112
- state.leaf1ndex -= 1
113
- state.leafBelow[state.leafAbove[state.leaf1ndex]] = state.leafBelow[state.leaf1ndex]
114
- state.leafAbove[state.leafBelow[state.leaf1ndex]] = state.leafAbove[state.leaf1ndex]
115
- return state
116
-
117
- def filterAsymmetricFolds(state: MapFoldingState) -> MapFoldingState:
118
- lengthLeafBelow = len(state.leafBelow)
119
-
120
- indexLeaf: int = 0
121
- for leafConnectee in range(lengthLeafBelow):
122
- leafNumber = int(state.leafBelow[indexLeaf])
123
- state.leafComparison[leafConnectee] = (leafNumber - indexLeaf + lengthLeafBelow - 1) % (lengthLeafBelow - 1)
124
- indexLeaf = leafNumber
125
-
126
- indexInMiddle = (lengthLeafBelow - 1) // 2
127
- for delta in range(lengthLeafBelow):
128
- ImaSymmetricFold = True
129
- for leafConnectee in range(indexInMiddle):
130
- if state.leafComparison[(delta + leafConnectee) % lengthLeafBelow] != state.leafComparison[(delta + lengthLeafBelow - 2 - leafConnectee) % lengthLeafBelow]:
131
- ImaSymmetricFold = False
132
- break
133
- if ImaSymmetricFold:
134
- state.groupsOfFolds += 1
135
-
136
- return state
137
-
138
- def count(state: MapFoldingState) -> MapFoldingState:
139
- while activeLeafGreaterThan0(state):
140
- if activeLeafIsTheFirstLeaf(state) or leafBelowSentinelIs1(state):
141
- if activeLeafGreaterThanLeavesTotal(state):
142
- state = filterAsymmetricFolds(state)
143
- else:
144
- state = initializeVariablesToFindGaps(state)
145
- while loopingThroughTheDimensions(state):
146
- state = lookupLeafConnecteeInConnectionGraph(state)
147
- if leafConnecteeIsActiveLeaf(state):
148
- state = activeLeafUnconstrainedInThisDimension(state)
149
- else:
150
- while loopingLeavesConnectedToActiveLeaf(state):
151
- state = lookForGaps(state)
152
- state = tryAnotherLeafConnectee(state)
153
- state = tryNextDimension(state)
154
- if activeLeafIsUnconstrainedInAllDimensions(state):
155
- state = insertActiveLeaf(state)
156
- state = initializeIndexMiniGap(state)
157
- while loopingToActiveGapCeiling(state):
158
- state = filterCommonGaps(state)
159
- state = incrementIndexMiniGap(state)
160
- while noGapsHere(state):
161
- state = undoLastLeafPlacement(state)
162
- if gapAvailable(state):
163
- state = insertActiveLeafAtGap(state)
164
- return state
165
-
166
- def doTheNeedful(state: MapFoldingState) -> MapFoldingState:
167
- state = count(state)
168
- state.groupsOfFolds = (state.groupsOfFolds + 1) // 2
169
- return state
170
-
171
- def Z0Z_flowNeedsFixing(mapShape: tuple[int, ...]) -> int:
172
- return doTheNeedful(MapFoldingState(mapShape)).groupsOfFolds
173
-
174
- if __name__ == '__main__':
175
- for n in range(3, 7):
176
- mapShape = dictionaryOEIS['A007822']['getMapShape'](n)
177
-
178
- state = MapFoldingState(mapShape)
179
- timeStart = time.perf_counter()
180
- foldsTotal = doTheNeedful(state).groupsOfFolds
181
- sys.stdout.write(f"{foldsTotal == dictionaryOEIS['A007822']['valuesKnown'][n]} {n} {foldsTotal = } {time.perf_counter() - timeStart:.2f}\n")