mapFolding 0.12.1__py3-none-any.whl → 0.12.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 (34) hide show
  1. mapFolding/__init__.py +42 -18
  2. mapFolding/_theSSOT.py +137 -0
  3. mapFolding/basecamp.py +28 -18
  4. mapFolding/beDRY.py +21 -19
  5. mapFolding/dataBaskets.py +170 -18
  6. mapFolding/datatypes.py +109 -1
  7. mapFolding/filesystemToolkit.py +38 -33
  8. mapFolding/oeis.py +209 -93
  9. mapFolding/someAssemblyRequired/RecipeJob.py +120 -9
  10. mapFolding/someAssemblyRequired/__init__.py +35 -38
  11. mapFolding/someAssemblyRequired/_toolIfThis.py +78 -16
  12. mapFolding/someAssemblyRequired/_toolkitContainers.py +121 -43
  13. mapFolding/someAssemblyRequired/infoBooth.py +37 -2
  14. mapFolding/someAssemblyRequired/makeAllModules.py +712 -0
  15. mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +102 -39
  16. mapFolding/someAssemblyRequired/toolkitNumba.py +171 -19
  17. mapFolding/someAssemblyRequired/transformationTools.py +84 -40
  18. mapfolding-0.12.2.dist-info/METADATA +167 -0
  19. mapfolding-0.12.2.dist-info/RECORD +53 -0
  20. {mapfolding-0.12.1.dist-info → mapfolding-0.12.2.dist-info}/WHEEL +1 -1
  21. tests/__init__.py +28 -44
  22. tests/conftest.py +66 -61
  23. tests/test_computations.py +39 -82
  24. tests/test_filesystem.py +25 -1
  25. tests/test_oeis.py +30 -1
  26. tests/test_other.py +27 -0
  27. tests/test_tasks.py +31 -1
  28. mapFolding/someAssemblyRequired/Z0Z_makeAllModules.py +0 -433
  29. mapFolding/theSSOT.py +0 -34
  30. mapfolding-0.12.1.dist-info/METADATA +0 -184
  31. mapfolding-0.12.1.dist-info/RECORD +0 -53
  32. {mapfolding-0.12.1.dist-info → mapfolding-0.12.2.dist-info}/entry_points.txt +0 -0
  33. {mapfolding-0.12.1.dist-info → mapfolding-0.12.2.dist-info}/licenses/LICENSE +0 -0
  34. {mapfolding-0.12.1.dist-info → mapfolding-0.12.2.dist-info}/top_level.txt +0 -0
@@ -1,184 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mapFolding
3
- Version: 0.12.1
4
- Summary: Map folding algorithm with code transformation framework for optimizing numerical computations
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: Repository, https://github.com/hunterhogan/mapFolding.git
10
- Project-URL: Issues, https://github.com/hunterhogan/mapFolding/issues
11
- Keywords: A000136,A001415,A001416,A001417,A001418,A195646,algorithmic optimization,AST manipulation,code generation,code transformation,combinatorics,computational geometry,dataclass transformation,folding pattern enumeration,just-in-time compilation,map folding,Numba optimization,OEIS,performance optimization,source code analysis,stamp folding
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 :: OS Independent
19
- Classifier: Programming Language :: Python
20
- Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Topic :: Scientific/Engineering :: Mathematics
24
- Classifier: Topic :: Scientific/Engineering :: Information Analysis
25
- Classifier: Topic :: Software Development :: Code Generators
26
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
- Classifier: Topic :: Software Development :: Compilers
28
- Classifier: Typing :: Typed
29
- Requires-Python: >=3.12
30
- Description-Content-Type: text/markdown
31
- License-File: LICENSE
32
- Requires-Dist: astToolkit>=0.3.0
33
- Requires-Dist: autoflake
34
- Requires-Dist: numba_progress
35
- Requires-Dist: numba
36
- Requires-Dist: numpy
37
- Requires-Dist: platformdirs
38
- Requires-Dist: python_minifier
39
- Requires-Dist: sympy
40
- Requires-Dist: tomli
41
- Requires-Dist: Z0Z_tools
42
- Provides-Extra: testing
43
- Requires-Dist: mypy; extra == "testing"
44
- Requires-Dist: pytest; extra == "testing"
45
- Requires-Dist: pytest-cov; extra == "testing"
46
- Requires-Dist: pytest-env; extra == "testing"
47
- Requires-Dist: pytest-xdist; extra == "testing"
48
- Requires-Dist: pyupgrade; extra == "testing"
49
- Requires-Dist: ruff; extra == "testing"
50
- Dynamic: license-file
51
-
52
- # mapFolding: High-Performance Algorithm Playground for Computational Enthusiasts 🗺️
53
-
54
- [![pip install mapFolding](https://img.shields.io/badge/pip%20install-mapFolding-gray.svg?colorB=3b434b)](https://pypi.org/project/mapFolding/)
55
- [![Python Tests](https://github.com/hunterhogan/mapFolding/actions/workflows/pythonTests.yml/badge.svg)](https://github.com/hunterhogan/mapFolding/actions/workflows/pythonTests.yml)
56
- [![License: CC-BY-NC-4.0](https://img.shields.io/badge/License-CC_BY--NC_4.0-3b434b)](https://creativecommons.org/licenses/by-nc/4.0/)
57
-
58
- **This package is for you if:**
59
-
60
- - You're fascinated by computational algorithms and their optimization
61
- - You want to explore AST transformation techniques for Python performance tuning
62
- - You're interested in solving mathematical puzzles through code
63
- - You're learning about Numba and advanced Python optimization
64
-
65
- ## What Does This Package Actually Do?
66
-
67
- `mapFolding` solves a specific mathematical problem: counting the number of distinct ways to fold a rectangular map. While this may sound niche, it's a fascinating computational challenge that demonstrates:
68
-
69
- 1. How to transform readable algorithms into blazingly fast implementations
70
- 2. Advanced techniques for Python optimization using AST manipulation
71
- 3. Numba acceleration with specialized compilation strategies
72
- 4. Algorithms for problems that grow combinatorially
73
-
74
- The package has achieved new computational records, including first-ever calculations for large maps that were previously infeasible.
75
-
76
- ```python
77
- # Compute the number of ways to fold a 5×5 grid:
78
- from mapFolding import oeisIDfor_n
79
- foldsTotal = oeisIDfor_n('A001418', 5)
80
- ```
81
-
82
- ## Key Benefits for Computational Enthusiasts
83
-
84
- ### 1. Algorithm Transformation Laboratory
85
-
86
- See how the same algorithm evolves from readable Python to highly-optimized implementations:
87
-
88
- ```python
89
- # The intuitive, readable version:
90
- def countFolds(mapShape):
91
- # ...implement readable algorithm...
92
-
93
- # The transformed, optimized version (auto-generated):
94
- @numba.jit(nopython=True, parallel=True, fastmath=True)
95
- def countFolds_optimized(shape_param):
96
- # ...blazingly fast implementation...
97
- ```
98
-
99
- ### 2. Code Generation Framework
100
-
101
- Study and extend a complete Python code transformation assembly line:
102
-
103
- - AST analysis and manipulation
104
- - Dataclass decomposition ("shattering")
105
- - Automatic import management
106
- - Type specialization for numerical computing
107
-
108
- ### 3. Exhaustive Test Framework
109
-
110
- Leverage a sophisticated test suite for validating your own optimizations:
111
-
112
- ```python
113
- # Test your own recipe implementation with just a few lines:
114
- @pytest.fixture
115
- def myCustomRecipeFixture(useThisDispatcher, pathTmpTesting):
116
- myRecipe = RecipeSynthesizeFlow(
117
- # Your custom configuration here
118
- )
119
- # ...transformation code...
120
- return customDispatcher
121
-
122
- def test_myCustomImplementation(myCustomRecipeFixture):
123
- # Automatic validation against known values
124
- ```
125
-
126
- ## Installation and Getting Started
127
-
128
- ```sh
129
- pip install mapFolding
130
- ```
131
-
132
- Try a quick calculation:
133
-
134
- ```python
135
- from mapFolding import oeisIDfor_n
136
-
137
- # Calculate ways to fold a 2×4 map
138
- result = oeisIDfor_n('A001415', 4) # Returns 8
139
- print(f"A 2×4 map can be folded {result} different ways")
140
- ```
141
-
142
- ## Mathematical Background (For the Curious)
143
-
144
- The map folding problem was introduced by Lunnon in 1971 and connects to combinatorial geometry, computational complexity, and integer sequence analysis. The calculations provide entries to the Online Encyclopedia of Integer Sequences (OEIS).
145
-
146
- This package implements several OEIS sequences, including:
147
-
148
- - A001415: Number of ways to fold a 2×n strip (now calculated up to n=20!)
149
- - A001418: Number of ways to fold an n×n square grid
150
-
151
- ## Explore the Repository
152
-
153
- The repository structure reveals the package's educational value:
154
-
155
- - `reference/`: Historical implementations and algorithm evolution
156
- - `someAssemblyRequired/`: Code transformation framework
157
- - `tests/`: Comprehensive test suite with fixtures for your own implementations
158
-
159
- ## Who Is This For, Really?
160
-
161
- If you've read this far and are intrigued by computational puzzles, algorithm optimization, or Python performance techniques, this package offers a playground for exploration. It's particularly valuable for:
162
-
163
- - Computer science students studying algorithm optimization
164
- - Python developers exploring Numba and AST manipulation
165
- - Computational mathematicians interested in combinatorial problems
166
- - Anyone fascinated by the intersection of mathematics and computing
167
-
168
- Whether you use it to solve map folding problems or to study its optimization techniques, `mapFolding` offers a unique window into advanced Python programming approaches.
169
-
170
- ## My recovery
171
-
172
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
173
- [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
174
-
175
- ## How to code
176
-
177
- Coding One Step at a Time:
178
-
179
- 0. WRITE CODE.
180
- 1. Don't write stupid code that's hard to revise.
181
- 2. Write good code.
182
- 3. When revising, write better code.
183
-
184
- [![CC-BY-NC-4.0](https://github.com/hunterhogan/mapFolding/blob/main/CC-BY-NC-4.0.svg)](https://creativecommons.org/licenses/by-nc/4.0/)
@@ -1,53 +0,0 @@
1
- mapFolding/__init__.py,sha256=5aecz_WZCLtBsArV68h30OEQxrylPPm0oVfQMt0N94A,1948
2
- mapFolding/basecamp.py,sha256=3MMWSN8eW4W_dZe_q7Vs5yqmazNFoml0VpcJNY2feho,8243
3
- mapFolding/beDRY.py,sha256=kQrgBhJkXEy-J-Zyu4RHILK6gRm72a7cON7a1LewgwI,14004
4
- mapFolding/daoOfMapFolding.py,sha256=ncTIiBfTsM8SNVx9qefZ0bBcBtviWLSk4iPv3Z9nGiE,5442
5
- mapFolding/dataBaskets.py,sha256=crfmmYJGeJ7QLCzuYi4rtVOtzCDRoOiTNfPfHbc6Foo,5620
6
- mapFolding/datatypes.py,sha256=dqOAa2RbiGcsRl9X4qo4tdMamgOoZVnewrMjY4mHXS4,773
7
- mapFolding/filesystemToolkit.py,sha256=O9VQ0tSXlrGUhU3qN7uWxOTAZfuQb3fcRkTrfRZrGXo,9854
8
- mapFolding/oeis.py,sha256=ENTFLTQ2gfet16AA0CHy55mq5Qc0FBiix3IEpdymaV8,17115
9
- mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- mapFolding/theSSOT.py,sha256=7CyB3FnDWyNovTuUPRvSIfF7GxQc3aZoIsIwF1-4OyE,1456
11
- mapFolding/reference/__init__.py,sha256=GKcSgYE49NcTISx-JZbELXyq-eRkMeTL5g4DXInWFw0,2206
12
- mapFolding/reference/flattened.py,sha256=QK1xG9SllqCoi68e86Hyl9d9ATUAAFNpTQI-3zmcp5I,16072
13
- mapFolding/reference/hunterNumba.py,sha256=iLfyqwGdAh6c5GbapnKsWhAsNsR3O-fyGGHAdohluLw,7258
14
- mapFolding/reference/irvineJavaPort.py,sha256=UEfIX4QbPLl5jnyfYIyX5YRR3_rYvPUikK8jLehsFko,4076
15
- mapFolding/reference/jaxCount.py,sha256=TuDNKOnyhQfuixKmIxO9Algv7dvy7KMGhgsV3h96FGE,14853
16
- mapFolding/reference/lunnonNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
17
- mapFolding/reference/lunnonWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
18
- mapFolding/reference/rotatedEntryPoint.py,sha256=5ughpKUT2JQhoAKgoDUdYNjgWQYPGV8v-7dWEAdDmfE,10274
19
- mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
20
- mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
21
- mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
22
- mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
23
- mapFolding/someAssemblyRequired/RecipeJob.py,sha256=oDOg5FVGTlnZQFW1K0OVucoHbApjsLTpPXy9GtMbjp4,4339
24
- mapFolding/someAssemblyRequired/Z0Z_makeAllModules.py,sha256=-YAScEzC13nvECZloNYZo-uvZOriLQUiSYaMxMmjsA8,28843
25
- mapFolding/someAssemblyRequired/__init__.py,sha256=ndEXbwc6SSGnAyYkgL2I4nvDGQa8EbJu_f9l9NJwTsw,2931
26
- mapFolding/someAssemblyRequired/_toolIfThis.py,sha256=cOQC6ldgFdn7djpLR-Qo8mj_rePTrpal6_cg_rR4Lzs,3010
27
- mapFolding/someAssemblyRequired/_toolkitContainers.py,sha256=XoOxTijpbYJK2hFPzSqOrd-UOG0_FQzhS_n240hsUMo,9763
28
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=9RPU6vK_eUg64GtVFI_nZnvUryXw8gfHJs9NyDYHIvg,2745
29
- mapFolding/someAssemblyRequired/infoBooth.py,sha256=RbYswVvjE0mfORepk4tUzScMCb7WYf0GFMs0u-MUmn0,635
30
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py,sha256=nJlqE-PVbylfUa8NxfgjouYfpWlBFtmgPv1JW0S0pB4,13905
31
- mapFolding/someAssemblyRequired/toolkitNumba.py,sha256=F4DriKPj9TeEJ1qB9H74ekJfMfw2vJvW1zeJXHtxE0E,6680
32
- mapFolding/someAssemblyRequired/transformationTools.py,sha256=Gt-kB1JqXfLgiM_SGjUZxcx8MoZo6d7pYaoNmTbrgfY,7853
33
- mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
34
- mapFolding/syntheticModules/countParallel.py,sha256=OK_IB9w4yy9MMAiGvkei5ezPm_00v2nYjPrQZ_IlELg,7733
35
- mapFolding/syntheticModules/daoOfMapFolding.py,sha256=cfWPABtXyCxJ0BwPI7rhfLh_2UYV_XKAL8lJ4GLNXaQ,5896
36
- mapFolding/syntheticModules/dataPacking.py,sha256=m_eOZ7sMXIQ9jY5EvC3qgitQTY60n6rksy0ACMJOIC8,2292
37
- mapFolding/syntheticModules/initializeCount.py,sha256=nWSlJMMfIM3DvZxMn6ISQusUJqRYAjKQyLF5hwLEdBQ,3119
38
- mapFolding/syntheticModules/theorem2.py,sha256=9jrbZNNX4BWYZW1S0JjvRY2k7RU7I1RNUMV7JdCt1ZY,3017
39
- mapFolding/syntheticModules/theorem2Numba.py,sha256=-cKjNyxgUMFhEyFVs0VJ7hw4LfrV0WSNK5tPYbQ1oNU,3369
40
- mapFolding/syntheticModules/theorem2Trimmed.py,sha256=DHW3NxBdtABQYBKm2WRvfQ5kzc2_UwGI2h4ePuYEJoM,2685
41
- mapfolding-0.12.1.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
42
- tests/__init__.py,sha256=5VhHf0JJ2_DSh58zJ0rR5UkpoCon-0IkdljspTCzZ04,1950
43
- tests/conftest.py,sha256=eumQRoDuWVrhsjDxWXGhW0N7lH0ZZ9XD-5q81bWFqOs,10874
44
- tests/test_computations.py,sha256=HNpfs9Yz3rdfJInD15Jwd6DYsSR5TCwnR5EW0n7KbeI,5682
45
- tests/test_filesystem.py,sha256=imlcetleJc4G9pDZTgS1j8UAs7ADbRxXVuNPecJAvqc,2964
46
- tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
47
- tests/test_other.py,sha256=DT7YE82YCHrSjdxhpY4UJnXmZvDm1b4e1QpZV3LyzcM,3747
48
- tests/test_tasks.py,sha256=pEDukf2SVTOMEsn82JpAWKQzn1ZCTlkhLzQ5hYLg2yY,2780
49
- mapfolding-0.12.1.dist-info/METADATA,sha256=t1Kp8tQ-xZP-VCuxz5dMWu47UJafTcDu0kG7Pmaxi8g,7617
50
- mapfolding-0.12.1.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
51
- mapfolding-0.12.1.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
52
- mapfolding-0.12.1.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
53
- mapfolding-0.12.1.dist-info/RECORD,,