mapFolding 0.15.4__tar.gz → 0.16.1__tar.gz

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 (128) hide show
  1. mapfolding-0.16.1/PKG-INFO +99 -0
  2. mapfolding-0.16.1/README.md +34 -0
  3. mapfolding-0.16.1/easyRun/A000682.py +25 -0
  4. mapfolding-0.16.1/easyRun/A005316.py +21 -0
  5. mapfolding-0.16.1/easyRun/NOTcountingFolds.py +36 -0
  6. mapfolding-0.16.1/easyRun/countFolds.py +41 -0
  7. mapfolding-0.16.1/easyRun/meanders.py +71 -0
  8. mapfolding-0.16.1/mapFolding/__init__.py +48 -0
  9. mapfolding-0.16.1/mapFolding/_dataPacking.py +68 -0
  10. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/_theSSOT.py +33 -36
  11. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/_theTypes.py +21 -4
  12. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/algorithms/daoOfMapFolding.py +1 -2
  13. mapfolding-0.16.1/mapFolding/algorithms/matrixMeanders.py +101 -0
  14. mapfolding-0.16.1/mapFolding/algorithms/matrixMeandersBeDry.py +264 -0
  15. mapfolding-0.16.1/mapFolding/algorithms/matrixMeandersNumPy.py +286 -0
  16. mapfolding-0.16.1/mapFolding/algorithms/matrixMeandersPandas.py +351 -0
  17. mapfolding-0.16.1/mapFolding/algorithms/oeisIDbyFormula.py +357 -0
  18. mapfolding-0.16.1/mapFolding/algorithms/zCuzDocStoopidoeisIDbyFormula.py +92 -0
  19. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/basecamp.py +261 -113
  20. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/beDRY.py +2 -30
  21. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/dataBaskets.py +120 -4
  22. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/oeis.py +13 -33
  23. mapfolding-0.16.1/mapFolding/py.typed +0 -0
  24. mapfolding-0.16.1/mapFolding/reference/A000682facts.py +1276 -0
  25. mapfolding-0.16.1/mapFolding/reference/A005316facts.py +985 -0
  26. mapfolding-0.16.1/mapFolding/reference/matrixMeandersAnalysis/__init__.py +1 -0
  27. mapfolding-0.16.1/mapFolding/reference/matrixMeandersAnalysis/prefixNotationNotes.py +15 -0
  28. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316JavaPort.py +1 -1
  29. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316imperative.py +1 -1
  30. mapfolding-0.16.1/mapFolding/reference/meandersDumpingGround/matrixMeandersNumPyV1finalForm.py +424 -0
  31. mapfolding-0.16.1/mapFolding/someAssemblyRequired/A007822/A007822rawMaterials.py +54 -0
  32. mapfolding-0.16.1/mapFolding/someAssemblyRequired/A007822/__init__.py +0 -0
  33. mapfolding-0.16.1/mapFolding/someAssemblyRequired/A007822/makeA007822AsynchronousModules.py +197 -0
  34. mapfolding-0.16.1/mapFolding/someAssemblyRequired/A007822/makeA007822Modules.py +74 -0
  35. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/RecipeJob.py +4 -4
  36. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/__init__.py +9 -2
  37. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/_toolIfThis.py +4 -3
  38. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/_toolkitContainers.py +8 -8
  39. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/infoBooth.py +27 -30
  40. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +6 -5
  41. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +6 -4
  42. mapfolding-0.16.1/mapFolding/someAssemblyRequired/makingModules_count.py +294 -0
  43. mapfolding-0.16.1/mapFolding/someAssemblyRequired/makingModules_doTheNeedful.py +117 -0
  44. mapfolding-0.16.1/mapFolding/someAssemblyRequired/mapFolding/__init__.py +0 -0
  45. mapfolding-0.16.1/mapFolding/someAssemblyRequired/mapFolding/makeMapFoldingModules.py +220 -0
  46. mapfolding-0.16.1/mapFolding/someAssemblyRequired/meanders/__init__.py +0 -0
  47. mapfolding-0.16.1/mapFolding/someAssemblyRequired/meanders/makeMeandersModules.py +64 -0
  48. mapfolding-0.16.1/mapFolding/someAssemblyRequired/toolkitMakeModules.py +152 -0
  49. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/toolkitNumba.py +1 -1
  50. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/transformationTools.py +1 -0
  51. mapfolding-0.15.4/mapFolding/syntheticModules/algorithmA007822.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/algorithm.py +2 -3
  52. mapfolding-0.15.4/mapFolding/syntheticModules/algorithmA007822Numba.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/algorithmNumba.py +3 -6
  53. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronous.py +148 -0
  54. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronousAnnex.py +66 -0
  55. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronousAnnexNumba.py +85 -0
  56. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronousNumba.py +52 -0
  57. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronousTheorem2.py +53 -0
  58. mapfolding-0.16.1/mapFolding/syntheticModules/A007822/asynchronousTrimmed.py +47 -0
  59. mapfolding-0.15.4/mapFolding/syntheticModules/initializeStateA007822.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/initializeState.py +1 -2
  60. mapfolding-0.15.4/mapFolding/syntheticModules/theorem2A007822.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/theorem2.py +1 -2
  61. mapfolding-0.15.4/mapFolding/syntheticModules/theorem2A007822Numba.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/theorem2Numba.py +6 -4
  62. mapfolding-0.15.4/mapFolding/syntheticModules/theorem2A007822Trimmed.py → mapfolding-0.16.1/mapFolding/syntheticModules/A007822/theorem2Trimmed.py +1 -2
  63. mapfolding-0.16.1/mapFolding/syntheticModules/__init__.py +1 -0
  64. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/countParallelNumba.py +5 -2
  65. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/daoOfMapFoldingNumba.py +4 -2
  66. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/dataPacking.py +4 -2
  67. mapfolding-0.16.1/mapFolding/syntheticModules/dataPackingA007822.py +92 -0
  68. mapfolding-0.16.1/mapFolding/syntheticModules/meanders/__init__.py +1 -0
  69. mapfolding-0.16.1/mapFolding/syntheticModules/meanders/bigInt.py +62 -0
  70. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/theorem2Numba.py +3 -2
  71. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/conftest.py +28 -13
  72. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/test_computations.py +69 -62
  73. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/test_oeis.py +6 -6
  74. mapfolding-0.16.1/mapFolding/zCuzDocStoopid/__init__.py +4 -0
  75. mapfolding-0.16.1/mapFolding/zCuzDocStoopid/makeDocstrings.py +68 -0
  76. mapfolding-0.16.1/mapFolding.egg-info/PKG-INFO +99 -0
  77. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding.egg-info/SOURCES.txt +45 -9
  78. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding.egg-info/requires.txt +9 -0
  79. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding.egg-info/top_level.txt +1 -0
  80. {mapfolding-0.15.4 → mapfolding-0.16.1}/pyproject.toml +12 -3
  81. mapfolding-0.15.4/PKG-INFO +0 -78
  82. mapfolding-0.15.4/README.md +0 -21
  83. mapfolding-0.15.4/mapFolding/__init__.py +0 -93
  84. mapfolding-0.15.4/mapFolding/algorithms/matrixMeanders.py +0 -348
  85. mapfolding-0.15.4/mapFolding/algorithms/oeisIDbyFormula.py +0 -113
  86. mapfolding-0.15.4/mapFolding/someAssemblyRequired/A007822rawMaterials.py +0 -46
  87. mapfolding-0.15.4/mapFolding/someAssemblyRequired/makeAllModules.py +0 -764
  88. mapfolding-0.15.4/mapFolding/syntheticModules/dataPackingA007822.py +0 -26
  89. mapfolding-0.15.4/mapFolding.egg-info/PKG-INFO +0 -78
  90. {mapfolding-0.15.4 → mapfolding-0.16.1}/LICENSE +0 -0
  91. /mapfolding-0.15.4/mapFolding/py.typed → /mapfolding-0.16.1/easyRun/__init__.py +0 -0
  92. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/algorithms/__init__.py +0 -0
  93. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/filesystemToolkit.py +0 -0
  94. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/__init__.py +0 -0
  95. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/flattened.py +0 -0
  96. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/hunterNumba.py +0 -0
  97. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/irvineJavaPort.py +0 -0
  98. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/jaxCount.py +0 -0
  99. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/jobsCompleted/[2x19]/p2x19.py +0 -0
  100. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/jobsCompleted/__init__.py +0 -0
  101. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/jobsCompleted/p2x19/p2x19.py +0 -0
  102. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/lunnonNumpy.py +0 -0
  103. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/lunnonWhile.py +0 -0
  104. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316intOptimized.py +0 -0
  105. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316optimized128bit.py +0 -0
  106. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316primitiveOptimized.py +0 -0
  107. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316redis.py +0 -0
  108. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/A005316write2disk.py +0 -0
  109. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeanders64retired.py +0 -0
  110. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeandersBaseline.py +0 -0
  111. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineAnnex.py +0 -0
  112. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineV2.py +0 -0
  113. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeandersSimpleQueue.py +0 -0
  114. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/meandersDumpingGround/matrixMeandersSlicePop.py +0 -0
  115. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/rotatedEntryPoint.py +0 -0
  116. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/reference/total_countPlus1vsPlusN.py +0 -0
  117. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/someAssemblyRequired/getLLVMforNoReason.py +0 -0
  118. {mapfolding-0.15.4/mapFolding/syntheticModules → mapfolding-0.16.1/mapFolding/syntheticModules/A007822}/__init__.py +0 -0
  119. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/initializeState.py +0 -0
  120. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/theorem2.py +0 -0
  121. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/syntheticModules/theorem2Trimmed.py +0 -0
  122. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/__init__.py +0 -0
  123. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/test_filesystem.py +0 -0
  124. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/test_other.py +0 -0
  125. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding/tests/test_tasks.py +0 -0
  126. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding.egg-info/dependency_links.txt +0 -0
  127. {mapfolding-0.15.4 → mapfolding-0.16.1}/mapFolding.egg-info/entry_points.txt +0 -0
  128. {mapfolding-0.15.4 → mapfolding-0.16.1}/setup.cfg +0 -0
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: mapFolding
3
+ Version: 0.16.1
4
+ Summary: Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations, and analyze computational states.
5
+ Author-email: Hunter Hogan <HunterHogan@pm.me>
6
+ License: CC-BY-NC-4.0
7
+ Project-URL: Donate, https://www.patreon.com/integrated
8
+ Project-URL: Homepage, https://github.com/hunterhogan/mapFolding
9
+ Project-URL: Issues, https://github.com/hunterhogan/mapFolding/issues
10
+ Project-URL: Repository, https://github.com/hunterhogan/mapFolding.git
11
+ Keywords: A000136,A000560,A000682,A001010,A001011,A001415,A001416,A001417,A001418,A005315,A005316,A007822,A178961,A195646,A223094,A259702,A301620,AST manipulation,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
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Natural Language :: English
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Programming Language :: Python :: 3 :: Only
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: Implementation :: CPython
27
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
28
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
29
+ Classifier: Topic :: Software Development :: Code Generators
30
+ Classifier: Topic :: Software Development :: Compilers
31
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
32
+ Classifier: Topic :: Software Development :: Pre-processors
33
+ Classifier: Typing :: Typed
34
+ Requires-Python: >=3.12
35
+ Description-Content-Type: text/markdown
36
+ License-File: LICENSE
37
+ Requires-Dist: astToolkit
38
+ Requires-Dist: autoflake
39
+ Requires-Dist: hunterMakesPy
40
+ Requires-Dist: isort
41
+ Requires-Dist: numpy
42
+ Requires-Dist: platformdirs
43
+ Provides-Extra: development
44
+ Requires-Dist: memray; sys_platform == "linux" and extra == "development"
45
+ Requires-Dist: mypy; extra == "development"
46
+ Requires-Dist: pyupgrade; extra == "development"
47
+ Requires-Dist: py-spy; extra == "development"
48
+ Requires-Dist: setuptools-scm; extra == "development"
49
+ Provides-Extra: numba
50
+ Requires-Dist: numba; extra == "numba"
51
+ Requires-Dist: numba_progress; extra == "numba"
52
+ Provides-Extra: pandas
53
+ Requires-Dist: pandas; extra == "pandas"
54
+ Requires-Dist: pyarrow; extra == "pandas"
55
+ Requires-Dist: pyarrow-stubs; extra == "pandas"
56
+ Provides-Extra: testing
57
+ Requires-Dist: numba; extra == "testing"
58
+ Requires-Dist: pandas; extra == "testing"
59
+ Requires-Dist: pyarrow; extra == "testing"
60
+ Requires-Dist: pytest-cov; extra == "testing"
61
+ Requires-Dist: pytest-env; extra == "testing"
62
+ Requires-Dist: pytest-xdist; extra == "testing"
63
+ Requires-Dist: pytest; extra == "testing"
64
+ Dynamic: license-file
65
+
66
+ # mapFolding
67
+
68
+ [![pip install mapFolding](https://img.shields.io/badge/pip%20install-mapFolding-gray.svg?colorB=3b434b)](https://pypi.org/project/mapFolding/)
69
+
70
+ Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.
71
+
72
+ I don't know how to write a README.md. Furthermore, the package used to be focused on multidimensional map folding and tools for transforming the algorithm to experiment with optimizations or to explore the algorithm.
73
+
74
+ First, the tools for transforming algorithms became far more sophisticated and powerful than this package. So I moved them to [astToolkit](https://github.com/hunterhogan/astToolkit). But those got so sophisticated, that I create more than half of that package through another layer of meta-programming: [astToolFactory](https://github.com/hunterhogan/astToolFactory).
75
+
76
+ Second, when I finally understood the connections between map folding and meanders, I added meanders to this package, and applied my transformation tools to that algorithm.
77
+
78
+ I used a weaker form of this package to [compute new terms for OEIS A001415](https://oeis.org/A001415), "Number of ways of folding a 2 X n strip of stamps."
79
+ There are cool and powerful tools in here, but as of 2025 September 17, I am dissatisfied with the organization and documentation. It's annoying.
80
+
81
+ ## Finding stuff
82
+
83
+ 1. At the moment, almost every algorithm version eventually runs through "mapFolding/basecamp.py", so it's sort of an overview and you can work backwards to find more details.
84
+ 2. The directory "mapFolding/algorithms" only has "handmade" algorithms. Therefore, most logic for most computations is based on something in that directory.
85
+ 3. The directory "mapFolding/syntheticModules" has code that is generated by the transformation tools.
86
+ 4. Transformation functions are in "mapFolding/someAssemblyRequired."
87
+ 5. The directory "mapFolding/reference" has "reference" materials.
88
+ 6. "mapFolding/tests" has the tests, and I have tried to make it easy for you to add _your_ versions of the algorithms to the tests. Is it actually easy? I'll say it this way: if you were to create your own subclass of `ast.AST` it would be impossible for you to add your subclass to all of the `ast` module tests with just a few lines of code. In contrast, it is possible to fully test your algorithm with in my tests by adding between three and 25 lines of code. So, yeah, it's easy.
89
+
90
+ ## Math and programming
91
+
92
+ I'm not a mathematician. I don't have training in or professional experience as a programmer. I'm not stupid: I'm ignorant.
93
+
94
+ ## My recovery
95
+
96
+ [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
97
+ [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
98
+
99
+ [![CC-BY-NC-4.0](https://github.com/hunterhogan/mapFolding/blob/main/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
@@ -0,0 +1,34 @@
1
+ # mapFolding
2
+
3
+ [![pip install mapFolding](https://img.shields.io/badge/pip%20install-mapFolding-gray.svg?colorB=3b434b)](https://pypi.org/project/mapFolding/)
4
+
5
+ Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.
6
+
7
+ I don't know how to write a README.md. Furthermore, the package used to be focused on multidimensional map folding and tools for transforming the algorithm to experiment with optimizations or to explore the algorithm.
8
+
9
+ First, the tools for transforming algorithms became far more sophisticated and powerful than this package. So I moved them to [astToolkit](https://github.com/hunterhogan/astToolkit). But those got so sophisticated, that I create more than half of that package through another layer of meta-programming: [astToolFactory](https://github.com/hunterhogan/astToolFactory).
10
+
11
+ Second, when I finally understood the connections between map folding and meanders, I added meanders to this package, and applied my transformation tools to that algorithm.
12
+
13
+ I used a weaker form of this package to [compute new terms for OEIS A001415](https://oeis.org/A001415), "Number of ways of folding a 2 X n strip of stamps."
14
+ There are cool and powerful tools in here, but as of 2025 September 17, I am dissatisfied with the organization and documentation. It's annoying.
15
+
16
+ ## Finding stuff
17
+
18
+ 1. At the moment, almost every algorithm version eventually runs through "mapFolding/basecamp.py", so it's sort of an overview and you can work backwards to find more details.
19
+ 2. The directory "mapFolding/algorithms" only has "handmade" algorithms. Therefore, most logic for most computations is based on something in that directory.
20
+ 3. The directory "mapFolding/syntheticModules" has code that is generated by the transformation tools.
21
+ 4. Transformation functions are in "mapFolding/someAssemblyRequired."
22
+ 5. The directory "mapFolding/reference" has "reference" materials.
23
+ 6. "mapFolding/tests" has the tests, and I have tried to make it easy for you to add _your_ versions of the algorithms to the tests. Is it actually easy? I'll say it this way: if you were to create your own subclass of `ast.AST` it would be impossible for you to add your subclass to all of the `ast` module tests with just a few lines of code. In contrast, it is possible to fully test your algorithm with in my tests by adding between three and 25 lines of code. So, yeah, it's easy.
24
+
25
+ ## Math and programming
26
+
27
+ I'm not a mathematician. I don't have training in or professional experience as a programmer. I'm not stupid: I'm ignorant.
28
+
29
+ ## My recovery
30
+
31
+ [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
32
+ [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
33
+
34
+ [![CC-BY-NC-4.0](https://github.com/hunterhogan/mapFolding/blob/main/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
@@ -0,0 +1,25 @@
1
+ # ruff: noqa
2
+ # pyright: basic
3
+ from mapFolding.basecamp import NOTcountingFolds
4
+ import sys
5
+ import warnings
6
+
7
+ if sys.version_info >= (3, 14):
8
+ warnings.filterwarnings("ignore", category=FutureWarning)
9
+
10
+ def main():
11
+ oeisID = 'A000682'
12
+ n=45
13
+ print(NOTcountingFolds(oeisID, n, 'matrixNumPy'))
14
+
15
+ from mapFolding import dictionaryOEIS
16
+ if n < dictionaryOEIS[oeisID]['valueUnknown']:
17
+ print(dictionaryOEIS[oeisID]['valuesKnown'][n])
18
+
19
+ if __name__ == "__main__":
20
+ main()
21
+
22
+ r"""
23
+ deactivate && C:\apps\mapFolding\.vtail\Scripts\activate.bat && title good && cls
24
+ title running && py Z0Z_A000682.py && title I'm done || title Error
25
+ """
@@ -0,0 +1,21 @@
1
+ # ruff: noqa
2
+ # pyright: basic
3
+ from mapFolding.basecamp import A005316
4
+ import warnings
5
+
6
+ warnings.filterwarnings("ignore", category=FutureWarning)
7
+
8
+ n=25
9
+ print(A005316(n))
10
+
11
+ from mapFolding import dictionaryOEIS
12
+
13
+ if n < dictionaryOEIS['A005316']['valueUnknown']:
14
+ print(dictionaryOEIS['A005316']['valuesKnown'][n])
15
+
16
+
17
+ r"""
18
+ deactivate && C:\apps\mapFolding\.vtail\Scripts\activate.bat && title good && cls
19
+ title running && py Z0Z_A005316.py && title I'm done || title Error
20
+
21
+ """
@@ -0,0 +1,36 @@
1
+ # ruff: noqa
2
+ from mapFolding import dictionaryOEIS
3
+ from mapFolding.basecamp import NOTcountingFolds
4
+ import sys
5
+ import time
6
+
7
+ if __name__ == '__main__':
8
+ def _write() -> None:
9
+ sys.stdout.write(
10
+ f"{(match:=countTotal == dictionaryOEIS[oeisID]['valuesKnown'][n])}\t"
11
+ f"\033[{(not match)*91}m"
12
+ f"{n}\t"
13
+ f"{countTotal}\t"
14
+ f"{time.perf_counter() - timeStart:.2f}\t"
15
+ "\033[0m\n"
16
+ )
17
+
18
+ CPUlimit: bool | float | int | None = -2
19
+ # oeisID: str | None = None
20
+ oeis_n: int | None = None
21
+ flow: str | None = None
22
+
23
+ oeisID = 'A007822'
24
+
25
+ flow = 'asynchronousTrimmed'
26
+ flow = 'asynchronous'
27
+ flow = 'asynchronousNumba'
28
+ flow = 'algorithm'
29
+ flow = 'theorem2Numba'
30
+
31
+ for n in range(5,11):
32
+
33
+ timeStart = time.perf_counter()
34
+ countTotal = NOTcountingFolds(oeisID, n, flow, CPUlimit)
35
+
36
+ _write()
@@ -0,0 +1,41 @@
1
+ # ruff: noqa
2
+ # pyright: basic
3
+ from collections.abc import Sequence
4
+ from mapFolding import countFolds, dictionaryOEISMapFolding
5
+ from os import PathLike
6
+ from pathlib import PurePath
7
+ import sys
8
+ import time
9
+
10
+ if __name__ == '__main__':
11
+ def _write() -> None:
12
+ sys.stdout.write(
13
+ f"{(match:=foldsTotal == dictionaryOEISMapFolding[oeisID]['valuesKnown'][n])}\t"
14
+ f"\033[{(not match)*91}m"
15
+ f"{n}\t"
16
+ f"{foldsTotal}\t"
17
+ f"{time.perf_counter() - timeStart:.2f}\t"
18
+ "\033[0m\n"
19
+ )
20
+
21
+ listDimensions: Sequence[int] | None = None
22
+ pathLikeWriteFoldsTotal: PathLike[str] | PurePath | None = None
23
+ computationDivisions: int | str | None = None
24
+ CPUlimit: bool | float | int | None = None
25
+ # mapShape: tuple[int, ...] | None = None
26
+ flow: str | None = 'theorem2Numba'
27
+
28
+ oeisID: str = 'A001415'
29
+ for n in range(3,8):
30
+
31
+ mapShape: tuple[int, ...] = dictionaryOEISMapFolding[oeisID]['getMapShape'](n)
32
+
33
+ timeStart = time.perf_counter()
34
+ foldsTotal: int = countFolds(listDimensions=listDimensions
35
+ , pathLikeWriteFoldsTotal=pathLikeWriteFoldsTotal
36
+ , computationDivisions=computationDivisions
37
+ , CPUlimit=CPUlimit
38
+ , mapShape=mapShape
39
+ , flow=flow)
40
+
41
+ _write()
@@ -0,0 +1,71 @@
1
+ # ruff: noqa
2
+ # pyright: basic
3
+ from mapFolding import dictionaryOEIS
4
+ from mapFolding.basecamp import NOTcountingFolds
5
+ import gc
6
+ import multiprocessing
7
+ import sys
8
+ import time
9
+ import warnings
10
+
11
+ def write() -> None:
12
+ sys.stdout.write(
13
+ f"{(booleanColor:=(countTotal == dictionaryOEIS[oeisID]['valuesKnown'][n]))}\t"
14
+ f"\033[{(not booleanColor)*91}m"
15
+ f"{n}\t"
16
+ # f"{countTotal}\t"
17
+ # f"{dictionaryOEISMeanders[oeisID]['valuesKnown'][n]}\t"
18
+ f"{time.perf_counter() - timeStart:.2f}\t"
19
+ "\033[0m\n"
20
+ )
21
+
22
+ if __name__ == '__main__':
23
+ multiprocessing.set_start_method('spawn')
24
+ if sys.version_info >= (3, 14):
25
+ warnings.filterwarnings("ignore", category=FutureWarning)
26
+
27
+ flow = 'matrixPandas'
28
+ flow = 'matrixMeanders'
29
+ flow = 'matrixNumPy'
30
+
31
+ for oeisID in [
32
+ 'A005316',
33
+ 'A000682',
34
+ ]:
35
+ sys.stdout.write(f"\n{oeisID}\n")
36
+
37
+ """TODO Identifiers. improve
38
+ kOfMatrix: I don't think the paper uses 'k'. step?
39
+
40
+ ReidemeisterMove?
41
+ flipTheExtra_0b1AsUfunc: what is extra?
42
+
43
+ "strand" is an interesting word.
44
+ """
45
+
46
+ # for n in range(44,45):
47
+
48
+ # for n in range(43,56):
49
+ # for n in range(46,47):
50
+ # for n in range(43,47):
51
+ # for n in range(38,43):
52
+ # for n in range(28,38):
53
+ # for n in [*range(2, 10), *range(28,33)]:
54
+ # for n in range(28,33):
55
+ # for n in range(2, 28):
56
+ # for n in range(2, 10):
57
+ for n in range(1, 6):
58
+
59
+ gc.collect()
60
+ timeStart = time.perf_counter()
61
+ countTotal = NOTcountingFolds(oeisID, n, flow)
62
+ if n < dictionaryOEIS[oeisID]['valueUnknown']:
63
+ write()
64
+ else:
65
+ sys.stdout.write(f"{n} {countTotal} {time.perf_counter() - timeStart:.2f}\n")
66
+
67
+ r"""
68
+ deactivate && C:\apps\mapFolding\.vtail\Scripts\activate.bat && title good && cls
69
+ title running && py Z0Z_aOFn.py && title I'm done || title Error
70
+
71
+ """
@@ -0,0 +1,48 @@
1
+ """Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations, and analyze computational states."""
2
+
3
+ from mapFolding._theTypes import (
4
+ Array1DElephino as Array1DElephino,
5
+ Array1DFoldsTotal as Array1DFoldsTotal,
6
+ Array1DLeavesTotal as Array1DLeavesTotal,
7
+ Array3DLeavesTotal as Array3DLeavesTotal,
8
+ axisOfLength as axisOfLength,
9
+ DatatypeElephino as DatatypeElephino,
10
+ DatatypeFoldsTotal as DatatypeFoldsTotal,
11
+ DatatypeLeavesTotal as DatatypeLeavesTotal,
12
+ MetadataOEISid as MetadataOEISid,
13
+ MetadataOEISidManuallySet as MetadataOEISidManuallySet,
14
+ MetadataOEISidMapFolding as MetadataOEISidMapFolding,
15
+ MetadataOEISidMapFoldingManuallySet as MetadataOEISidMapFoldingManuallySet,
16
+ NumPyElephino as NumPyElephino,
17
+ NumPyFoldsTotal as NumPyFoldsTotal,
18
+ NumPyIntegerType as NumPyIntegerType,
19
+ NumPyLeavesTotal as NumPyLeavesTotal,
20
+ ShapeArray as ShapeArray,
21
+ ShapeSlicer as ShapeSlicer)
22
+
23
+ from mapFolding._theSSOT import packageSettings as packageSettings
24
+
25
+ from mapFolding.beDRY import (
26
+ getConnectionGraph as getConnectionGraph,
27
+ getLeavesTotal as getLeavesTotal,
28
+ getTaskDivisions as getTaskDivisions,
29
+ makeDataContainer as makeDataContainer,
30
+ setProcessorLimit as setProcessorLimit,
31
+ validateListDimensions as validateListDimensions)
32
+
33
+ from mapFolding.filesystemToolkit import (
34
+ getFilenameFoldsTotal as getFilenameFoldsTotal,
35
+ getPathFilenameFoldsTotal as getPathFilenameFoldsTotal,
36
+ getPathRootJobDEFAULT as getPathRootJobDEFAULT,
37
+ saveFoldsTotal as saveFoldsTotal,
38
+ saveFoldsTotalFAILearly as saveFoldsTotalFAILearly)
39
+
40
+ from mapFolding.basecamp import countFolds as countFolds
41
+
42
+ from mapFolding.oeis import (
43
+ dictionaryOEIS as dictionaryOEIS,
44
+ dictionaryOEISMapFolding as dictionaryOEISMapFolding,
45
+ getFoldsTotalKnown as getFoldsTotalKnown,
46
+ getOEISids as getOEISids,
47
+ OEIS_for_n as OEIS_for_n,
48
+ oeisIDfor_n as oeisIDfor_n)
@@ -0,0 +1,68 @@
1
+ from collections.abc import Callable
2
+ from mapFolding.dataBaskets import MapFoldingState
3
+ from typing import Any
4
+ import astToolkit
5
+ import dataclasses
6
+ import functools
7
+ import inspect
8
+
9
+ r"""Notes
10
+ Goal: create a decorator, `unRePackMapFoldingState`, that will unpack `MapFoldingState`, pass only the parameters in the decorated function, receive the
11
+ values returned by the function, and repack `MapFoldingState`.
12
+
13
+ You must use dynamic programming. If the datatype or the field name changes, for example, that should not affect the decorator.
14
+
15
+ To use in, for example, C:\apps\mapFolding\mapFolding\syntheticModules\A007822\theorem2Numba.py. Analogous to
16
+ `Z0Z_tools.waveformSpectrogramWaveform`, see
17
+ https://github.com/hunterhogan/Z0Z_tools/blob/2c393c2831382dfe6f3e742cf56db39e71126cbc/Z0Z_tools/ioAudio.py
18
+
19
+ For examples of manipulating `dataclasses`, see also:
20
+ C:\apps\mapFolding\mapFolding\someAssemblyRequired\_toolkitContainers.py and
21
+ C:\apps\mapFolding\mapFolding\someAssemblyRequired\transformationTools.py
22
+
23
+ - `TypeVar` may be useful.
24
+
25
+ - `dataclasses` has inspection tools.
26
+
27
+ - `return MapFoldingState(...` Check if the field is init=True
28
+
29
+ Prototype. Eventual home will probably be "beDry.py".
30
+ """
31
+
32
+ def unRePackMapFoldingState[CallableTargetType: Callable[..., Any]](callableTarget: CallableTargetType) -> Callable[[MapFoldingState], MapFoldingState]:
33
+ signatureTargetFunction: inspect.Signature = inspect.signature(callableTarget)
34
+ parametersTargetFunction: list[str] = list(signatureTargetFunction.parameters.keys())
35
+
36
+ fieldsMapFoldingState: tuple[dataclasses.Field[Any], ...] = dataclasses.fields(MapFoldingState)
37
+
38
+ fieldsInitializable: dict[str, dataclasses.Field[Any]] = {field.name: field for field in fieldsMapFoldingState if field.init}
39
+
40
+ @functools.wraps(callableTarget)
41
+ def decoratedFunction(mapFoldingStateInstance: MapFoldingState, **additionalKeywordArguments: Any) -> MapFoldingState:
42
+ dataclassAsDict: dict[str, Any] = dataclasses.asdict(mapFoldingStateInstance)
43
+
44
+ argumentsForTargetFunction: list[Any] = []
45
+ for parameterName in parametersTargetFunction:
46
+ if parameterName in dataclassAsDict:
47
+ argumentsForTargetFunction.append(dataclassAsDict[parameterName])
48
+ elif parameterName in additionalKeywordArguments:
49
+ argumentsForTargetFunction.append(additionalKeywordArguments[parameterName])
50
+ else:
51
+ errorMessage = f"Parameter '{parameterName}' not found in MapFoldingState or additional arguments"
52
+ raise ValueError(errorMessage)
53
+
54
+ returnedFromTargetFunction: Any = callableTarget(*argumentsForTargetFunction)
55
+
56
+ argumentsForMapFoldingStateConstructor: dict[str, Any] = {fieldName: dataclassAsDict[fieldName] for fieldName in fieldsInitializable}
57
+
58
+ if len(parametersTargetFunction) == 1:
59
+ singleParameterName: str = parametersTargetFunction[0]
60
+ if singleParameterName in fieldsInitializable:
61
+ argumentsForMapFoldingStateConstructor[singleParameterName] = returnedFromTargetFunction
62
+ elif isinstance(returnedFromTargetFunction, tuple) and len(returnedFromTargetFunction) == len(parametersTargetFunction):
63
+ updatedFieldsFromReturn: dict[str, Any] = {parameterName: returnedValue for parameterName, returnedValue in zip(parametersTargetFunction, returnedFromTargetFunction, strict=True) if parameterName in fieldsInitializable}
64
+ argumentsForMapFoldingStateConstructor.update(updatedFieldsFromReturn)
65
+
66
+ return MapFoldingState(**argumentsForMapFoldingStateConstructor)
67
+
68
+ return decoratedFunction
@@ -1,7 +1,7 @@
1
1
  """Access and configure package settings and metadata."""
2
2
 
3
3
  from hunterMakesPy import PackageSettings
4
- from mapFolding._theTypes import MetadataOEISidMapFoldingManuallySet, MetadataOEISidMeandersManuallySet
4
+ from mapFolding._theTypes import MetadataOEISidManuallySet, MetadataOEISidMapFoldingManuallySet
5
5
  from pathlib import Path
6
6
  import dataclasses
7
7
  import random
@@ -27,14 +27,14 @@ class mapFoldingPackageSettings(PackageSettings):
27
27
  Package identifier for concurrent execution operations.
28
28
  OEISidMapFoldingManuallySet : dict[str, MetadataOEISidMapFoldingManuallySet]
29
29
  Settings that are best selected by a human instead of algorithmically.
30
- OEISidMeandersManuallySet : dict[str, MetadataOEISidMeandersManuallySet]
30
+ OEISidManuallySet : dict[str, MetadataOEISidMeandersManuallySet]
31
31
  Settings that are best selected by a human instead of algorithmically for meander sequences.
32
32
  """
33
33
 
34
34
  OEISidMapFoldingManuallySet: dict[str, MetadataOEISidMapFoldingManuallySet] = dataclasses.field(default_factory=dict[str, MetadataOEISidMapFoldingManuallySet])
35
35
  """Settings that are best selected by a human instead of algorithmically."""
36
36
 
37
- OEISidMeandersManuallySet: dict[str, MetadataOEISidMeandersManuallySet] = dataclasses.field(default_factory=dict[str, MetadataOEISidMeandersManuallySet])
37
+ OEISidManuallySet: dict[str, MetadataOEISidManuallySet] = dataclasses.field(default_factory=dict[str, MetadataOEISidManuallySet])
38
38
  """Settings that are best selected by a human instead of algorithmically for meander sequences."""
39
39
 
40
40
  cacheDays: int = 30
@@ -42,50 +42,44 @@ class mapFoldingPackageSettings(PackageSettings):
42
42
 
43
43
  concurrencyPackage: str = 'multiprocessing'
44
44
  """Package identifier for concurrent execution operations."""
45
-
45
+ # ruff: noqa: S311
46
46
  # TODO I made a `TypedDict` before I knew how to make dataclasses and classes. Think about other data structures.
47
47
  OEISidMapFoldingManuallySet: dict[str, MetadataOEISidMapFoldingManuallySet] = {
48
48
  'A000136': {
49
49
  'getMapShape': lambda n: (1, n),
50
50
  'valuesBenchmark': [14],
51
- 'valuesTestParallelization': [*range(3, 7)],
52
- 'valuesTestValidation': [random.randint(2, 9)], # noqa: S311
51
+ 'valuesTestParallelization': [random.randint(3, 7)],
52
+ 'valuesTestValidation': [random.randint(2, 9)],
53
53
  },
54
54
  'A001415': {
55
55
  'getMapShape': lambda n: (2, n),
56
56
  'valuesBenchmark': [14],
57
- 'valuesTestParallelization': [*range(3, 7)],
58
- 'valuesTestValidation': [random.randint(2, 9)], # noqa: S311
57
+ 'valuesTestParallelization': [random.randint(3, 7)],
58
+ 'valuesTestValidation': [random.randint(2, 9)],
59
59
  },
60
60
  'A001416': {
61
61
  'getMapShape': lambda n: (3, n),
62
62
  'valuesBenchmark': [9],
63
- 'valuesTestParallelization': [*range(3, 5)],
64
- 'valuesTestValidation': [random.randint(2, 6)], # noqa: S311
63
+ 'valuesTestParallelization': [random.randint(3, 5)],
64
+ 'valuesTestValidation': [random.randint(2, 6)],
65
65
  },
66
66
  'A001417': {
67
67
  'getMapShape': lambda n: tuple(2 for _dimension in range(n)),
68
68
  'valuesBenchmark': [6],
69
- 'valuesTestParallelization': [*range(2, 4)],
70
- 'valuesTestValidation': [random.randint(2, 4)], # noqa: S311
69
+ 'valuesTestParallelization': [random.randint(2, 4)],
70
+ 'valuesTestValidation': [random.randint(2, 4)],
71
71
  },
72
72
  'A195646': {
73
73
  'getMapShape': lambda n: tuple(3 for _dimension in range(n)),
74
74
  'valuesBenchmark': [3],
75
- 'valuesTestParallelization': [*range(2, 3)],
75
+ 'valuesTestParallelization': [2],
76
76
  'valuesTestValidation': [2],
77
77
  },
78
78
  'A001418': {
79
79
  'getMapShape': lambda n: (n, n),
80
80
  'valuesBenchmark': [5],
81
81
  'valuesTestParallelization': [*range(2, 4)],
82
- 'valuesTestValidation': [random.randint(2, 4)], # noqa: S311
83
- },
84
- 'A007822': {
85
- 'getMapShape': lambda n: (1, 2 * n),
86
- 'valuesBenchmark': [7],
87
- 'valuesTestParallelization': [*range(2, 4)],
88
- 'valuesTestValidation': [random.randint(2, 8)], # noqa: S311
82
+ 'valuesTestValidation': [random.randint(2, 4)],
89
83
  },
90
84
  }
91
85
 
@@ -95,28 +89,31 @@ identifierPackageFALLBACK = "mapFolding"
95
89
  packageSettings = mapFoldingPackageSettings(identifierPackageFALLBACK=identifierPackageFALLBACK, OEISidMapFoldingManuallySet=OEISidMapFoldingManuallySet)
96
90
  """Global package settings."""
97
91
 
98
- # TODO integrate into packageSettings
99
- pathCache: Path = packageSettings.pathPackage / ".cache"
100
92
  """Local directory path for storing cached OEIS sequence data and metadata."""
101
- OEISidMeandersManuallySet: dict[str, MetadataOEISidMeandersManuallySet] = {
102
- 'A000560': {'valuesTestValidation': [*range(3, 12)]},
103
- 'A000682': {'valuesTestValidation': [*range(3, 12)]},
104
- 'A001010': {'valuesTestValidation': [*range(3, 11)]},
105
- 'A001011': {'valuesTestValidation': [*range(3, 7)]},
106
- 'A005315': {'valuesTestValidation': [*range(3, 9)]},
107
- 'A005316': {'valuesTestValidation': [*range(3, 13)]},
108
- 'A060206': {'valuesTestValidation': [*range(3, 9)]},
109
- 'A077460': {'valuesTestValidation': [*range(3, 8)]},
110
- 'A078591': {'valuesTestValidation': [*range(3, 10)]},
111
- 'A223094': {'valuesTestValidation': [*range(3, 11)]},
112
- 'A259702': {'valuesTestValidation': [*range(3, 13)]},
113
- 'A301620': {'valuesTestValidation': [*range(3, 11)]},
93
+ OEISidManuallySet: dict[str, MetadataOEISidManuallySet] = {
94
+ 'A000560': {'valuesTestValidation': [random.randint(3, 12)]},
95
+ 'A000682': {'valuesTestValidation': [random.randint(3, 12), 32]},
96
+ 'A001010': {'valuesTestValidation': [3, 4, random.randint(5, 11)]},
97
+ 'A001011': {'valuesTestValidation': [3, 4, random.randint(5, 7)]},
98
+ 'A005315': {'valuesTestValidation': [random.randint(3, 9)]},
99
+ 'A005316': {'valuesTestValidation': [random.randint(3, 13)]},
100
+ 'A007822': {'valuesTestValidation': [random.randint(2, 8)]}, #, 'valuesBenchmark': [7], 'valuesTestParallelization': [*range(2, 4)]},
101
+ 'A060206': {'valuesTestValidation': [random.randint(3, 9)]},
102
+ 'A077460': {'valuesTestValidation': [3, 4, random.randint(5, 8)]},
103
+ 'A078591': {'valuesTestValidation': [random.randint(3, 10)]},
104
+ 'A178961': {'valuesTestValidation': [random.randint(3, 11)]},
105
+ 'A223094': {'valuesTestValidation': [random.randint(3, 11)]},
106
+ 'A259702': {'valuesTestValidation': [random.randint(3, 13)]},
107
+ 'A301620': {'valuesTestValidation': [random.randint(3, 11)]},
114
108
  }
115
109
 
116
110
  # Recreate packageSettings with meanders settings included
117
111
  packageSettings = mapFoldingPackageSettings(
118
112
  identifierPackageFALLBACK=identifierPackageFALLBACK,
119
113
  OEISidMapFoldingManuallySet=OEISidMapFoldingManuallySet,
120
- OEISidMeandersManuallySet=OEISidMeandersManuallySet,
114
+ OEISidManuallySet=OEISidManuallySet,
121
115
  )
122
116
  """Global package settings."""
117
+
118
+ # TODO integrate into packageSettings
119
+ pathCache: Path = packageSettings.pathPackage / ".cache"
@@ -2,7 +2,8 @@
2
2
 
3
3
  from collections.abc import Callable
4
4
  from numpy import dtype, int_ as numpy_int, integer, ndarray, uint64 as numpy_uint64
5
- from typing import Any, TypeAlias, TypedDict, TypeVar
5
+ from types import EllipsisType
6
+ from typing import Any, Final, NamedTuple, TypeAlias, TypedDict, TypeVar
6
7
 
7
8
  NumPyIntegerType = TypeVar('NumPyIntegerType', bound=integer[Any], covariant=True)
8
9
  """Any NumPy integer type, which is usually between 8-bit signed and 64-bit unsigned."""
@@ -65,7 +66,7 @@ class MetadataOEISidMapFoldingManuallySet(TypedDict):
65
66
  """List of index values, 'n', to use when testing validation performance."""
66
67
 
67
68
  class MetadataOEISidMapFolding(TypedDict):
68
- """Settings for an implemented OEIS sequence."""
69
+ """Settings for an OEIS ID that may be computed by a multidimensional map folding algorithm."""
69
70
 
70
71
  description: str
71
72
  """The OEIS.org description of the integer sequence."""
@@ -85,7 +86,7 @@ class MetadataOEISidMapFolding(TypedDict):
85
86
  """The smallest value of 'n' for for which `foldsTotal` is unknown."""
86
87
 
87
88
  # ruff: noqa: ERA001
88
- class MetadataOEISidMeandersManuallySet(TypedDict):
89
+ class MetadataOEISidManuallySet(TypedDict):
89
90
  """Settings that are best selected by a human instead of algorithmically."""
90
91
 
91
92
  # valuesBenchmark: list[int]
@@ -95,7 +96,7 @@ class MetadataOEISidMeandersManuallySet(TypedDict):
95
96
  valuesTestValidation: list[int]
96
97
  """List of index values, 'n', to use when testing validation performance."""
97
98
 
98
- class MetadataOEISidMeanders(TypedDict):
99
+ class MetadataOEISid(TypedDict):
99
100
  """Settings for an implemented OEIS sequence."""
100
101
 
101
102
  description: str
@@ -112,3 +113,19 @@ class MetadataOEISidMeanders(TypedDict):
112
113
  """List of index values, 'n', to use when testing validation performance."""
113
114
  valueUnknown: int
114
115
  """The smallest value of 'n' for for which `foldsTotal` is unknown."""
116
+
117
+ # TODO Figure out how to have a SSOT for the axis order.
118
+ axisOfLength: Final[int] = 0
119
+
120
+ class ShapeArray(NamedTuple):
121
+ """Always use this to construct arrays, so you can reorder the axes merely by reordering this class."""
122
+
123
+ length: int
124
+ indices: int
125
+
126
+ class ShapeSlicer(NamedTuple):
127
+ """Always use this to construct slicers, so you can reorder the axes merely by reordering this class."""
128
+
129
+ length: EllipsisType | slice
130
+ indices: int
131
+
@@ -1,4 +1,3 @@
1
- # ruff: noqa: D100 D103
2
1
  from mapFolding.dataBaskets import MapFoldingState
3
2
 
4
3
  def activeLeafGreaterThan0(state: MapFoldingState) -> bool:
@@ -140,4 +139,4 @@ def count(state: MapFoldingState) -> MapFoldingState:
140
139
 
141
140
  def doTheNeedful(state: MapFoldingState) -> MapFoldingState:
142
141
  state = count(state)
143
- return state # noqa: RET504
142
+ return state