mapFolding 0.8.1__py3-none-any.whl → 0.8.3__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 (32) hide show
  1. mapFolding/__init__.py +5 -1
  2. mapFolding/basecamp.py +2 -2
  3. mapFolding/beDRY.py +24 -31
  4. mapFolding/oeis.py +2 -2
  5. mapFolding/reference/__init__.py +45 -0
  6. mapFolding/reference/flattened.py +20 -2
  7. mapFolding/reference/hunterNumba.py +24 -0
  8. mapFolding/reference/irvineJavaPort.py +12 -0
  9. mapFolding/reference/{jax.py → jaxCount.py} +46 -27
  10. mapFolding/reference/jobsCompleted/[2x19]/p2x19.py +197 -0
  11. mapFolding/reference/jobsCompleted/__init__.py +50 -0
  12. mapFolding/reference/jobsCompleted/p2x19/p2x19.py +29 -0
  13. mapFolding/reference/lunnanNumpy.py +16 -1
  14. mapFolding/reference/lunnanWhile.py +15 -1
  15. mapFolding/reference/rotatedEntryPoint.py +18 -0
  16. mapFolding/reference/total_countPlus1vsPlusN.py +226 -203
  17. mapFolding/someAssemblyRequired/getLLVMforNoReason.py +20 -1
  18. mapFolding/someAssemblyRequired/synthesizeNumbaFlow.py +52 -37
  19. mapFolding/someAssemblyRequired/transformDataStructures.py +11 -5
  20. mapFolding/someAssemblyRequired/transformationTools.py +40 -42
  21. mapFolding/syntheticModules/__init__.py +1 -0
  22. mapFolding/theSSOT.py +69 -127
  23. {mapfolding-0.8.1.dist-info → mapfolding-0.8.3.dist-info}/METADATA +56 -31
  24. mapfolding-0.8.3.dist-info/RECORD +43 -0
  25. {mapfolding-0.8.1.dist-info → mapfolding-0.8.3.dist-info}/WHEEL +1 -1
  26. tests/conftest.py +43 -33
  27. tests/test_computations.py +7 -7
  28. tests/test_other.py +5 -4
  29. mapfolding-0.8.1.dist-info/RECORD +0 -39
  30. {mapfolding-0.8.1.dist-info → mapfolding-0.8.3.dist-info}/entry_points.txt +0 -0
  31. {mapfolding-0.8.1.dist-info → mapfolding-0.8.3.dist-info}/licenses/LICENSE +0 -0
  32. {mapfolding-0.8.1.dist-info → mapfolding-0.8.3.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapFolding
3
- Version: 0.8.1
3
+ Version: 0.8.3
4
4
  Summary: Map folding algorithm with code transformation framework for optimizing numerical computations
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  License: CC-BY-NC-4.0
@@ -92,58 +92,83 @@ Use `getOEISids` to get the most up-to-date list of available OEIS IDs.
92
92
  (mapFolding) C:\apps\mapFolding> getOEISids
93
93
 
94
94
  Available OEIS sequences:
95
- A001415: Number of ways of folding a 2 X n strip of stamps.
95
+ A001415: Number of ways of folding a 2 X n strip of stamps. (Now extended to n=20!)
96
96
  A001416: Number of ways of folding a 3 X n strip of stamps.
97
97
  A001417: Number of ways of folding a 2 X 2 X ... X 2 n-dimensional map.
98
98
  A001418: Number of ways of folding an n X n sheet of stamps.
99
99
  A195646: Number of ways of folding a 3 X 3 X ... X 3 n-dimensional map.
100
100
  ```
101
101
 
102
- ### 2. **Algorithm Zoo** 🦒
102
+ ### 2. **Algorithm Zoo: A Historical and Performance Journey** 🦒
103
103
 
104
- - **Lunnon's 1971 Algorithm**: A painstakingly debugged version of [the original typo-riddled code](https://github.com/hunterhogan/mapFolding/blob/mapFolding/reference/foldings.txt)
105
- - The /reference directory.
106
- - **Numba-JIT Accelerated**: Up to 1000× faster than pure Python ([benchmarks](https://github.com/hunterhogan/mapFolding/blob/mapFolding/notes/Speed%20highlights.md))
104
+ This package offers a comprehensive collection of map folding algorithm implementations that showcase its evolution from historical origins to high-performance computation:
107
105
 
108
- ### 3. **For Researchers and Power Users** 🔬
106
+ - **Historical Implementations**:
107
+ - Carefully restored versions of Lunnon's 1971 original [algorithm](https://github.com/hunterhogan/mapFolding/blob/mapFolding/reference/foldings.txt) with corrections
108
+ - Atlas Autocode reconstruction in the `reference/foldings.AA` file
109
109
 
110
- This package provides a sophisticated code transformation framework that can turn readable algorithm implementations into highly-optimized computational engines:
110
+ - **Direct Translations**:
111
+ - Python translations following the original control flow (`lunnanWhile.py`)
112
+ - NumPy-based vectorized implementations (`lunnanNumpy.py`)
111
113
 
112
- - **Algorithmic Exploration**: Study the core algorithm in `theDao.py`, which uses a functional state-transformation approach with clear, isolated functions
113
- - **Performance Optimization**: Generate specialized implementations with the `someAssemblyRequired` transformation pipeline:
114
- - AST-based code analysis and manipulation
115
- - Dataclass "shattering" to decompose complex state objects into primitive components
116
- - Just-in-time compilation with Numba and various optimization profiles
117
- - LLVM IR extraction for low-level algorithmic analysis
114
+ - **Modern Implementations**:
115
+ - Java port adaptations (`irvineJavaPort.py`) providing cleaner procedural implementations
116
+ - Experimental JAX version (`jaxCount.py`) exploring GPU acceleration potential
117
+ - Semantically decomposed version (`flattened.py`) with clear function boundaries
118
118
 
119
- - **Extensible Design**: The transformation framework is abstract and generic, enabling:
120
- - Creation of new optimization targets beyond the included Numba implementation
121
- - Customization of compilation parameters and optimization levels
122
- - Development of specialized algorithms for specific map dimensions
119
+ - **Performance Optimized**:
120
+ - Numba-JIT accelerated implementations up to 1000× faster than pure Python (see [benchmarks](https://github.com/hunterhogan/mapFolding/blob/mapFolding/notes/Speed%20highlights.md))
121
+ - Algorithmic optimizations showcasing subtle yet powerful performance differences (`total_countPlus1vsPlusN.py`)
122
+ - **New Computations**: First-ever calculations for 2×19 and 2×20 maps in the `reference/jobsCompleted/` directory
123
123
 
124
- ### 4. **Customization and Extension Guide**
124
+ The `reference` directory serves as both a historical archive and an educational resource for understanding algorithm evolution.
125
125
 
126
- The package architecture supports multiple levels of customization:
126
+ ### 3. **Algorithmic Transformation: From Readability to Speed** 🔬
127
127
 
128
- - **Basic Usage**: Work with the high-level API in `basecamp.py` for standard computations
129
- - **Algorithm Modification**:
128
+ The package provides a sophisticated transformation framework that bridges the gap between human-readable algorithms and high-performance computation:
129
+
130
+ - **Core Algorithm Understanding**:
131
+ - Study the functional state-transformation approach in `theDao.py` with clear, isolated functions
132
+ - Explore the semantic decomposition in `reference/flattened.py` to understand algorithm sections
133
+
134
+ - **Code Transformation Pipeline**:
135
+ - **AST Manipulation**: Analyzes and transforms the algorithm's abstract syntax tree
136
+ - **Dataclass "Shattering"**: Decomposes complex state objects into primitive components
137
+ - **Optimization Applications**: Applies domain-specific optimizations for numerical computation
138
+ - **LLVM Integration**: Extracts LLVM IR for low-level algorithmic analysis
139
+
140
+ - **Performance Breakthroughs**:
141
+ - Learn why nearly identical algorithms can have dramatically different performance (`total_countPlus1vsPlusN.py`)
142
+ - See how memory layout and increment strategy impact computation speed
143
+ - Understand the batching technique that yields order-of-magnitude improvements
144
+
145
+ ### 4. **Multi-Level Architecture: From Simple API to Full Customization**
146
+
147
+ The package's architecture supports multiple levels of engagement:
148
+
149
+ - **Basic Usage**:
150
+ - Work with the high-level API in `basecamp.py` for standard computations
151
+ - Access OEIS sequence calculations with minimal code
152
+
153
+ - **Algorithm Exploration**:
154
+ - Compare different implementations in the `reference` directory to understand trade-offs
130
155
  - Modify the core algorithm in `theDao.py` while preserving its functional approach
131
156
  - Configure system-wide settings in `theSSOT.py` to adjust data types and performance characteristics
132
- - Use utility functions in `beDRY.py` for common operations
133
157
 
134
158
  - **Advanced Transformation**:
135
- - The `someAssemblyRequired` package provides tools to transform code at the AST level:
136
- - `transformationTools.py` contains utilities for AST manipulation and code generation
137
- - `transformDataStructures.py` handles complex data structure transformations
138
- - `ingredientsNumba.py` provides Numba-specific configuration profiles
139
- - `synthesizeNumbaFlow.py` orchestrates the transformation process
159
+ - Use the `someAssemblyRequired` package to transform algorithms at the AST level
160
+ - Create optimized variants with different compilation settings using:
161
+ - `transformationTools.py` for AST manipulation
162
+ - `transformDataStructures.py` for complex data structure transformations
163
+ - `ingredientsNumba.py` for Numba-specific optimization profiles
164
+ - `synthesizeNumbaFlow.py` to orchestrate the transformation process
140
165
 
141
166
  - **Custom Deployment**:
142
167
  - Generate specialized implementations for specific dimensions
143
- - Create optimized modules that can be executed as standalone scripts
144
- - Extract LLVM IR for further analysis or optimization
168
+ - Create optimized standalone modules for production use
169
+ - Extract LLVM IR for further analysis and optimization
145
170
 
146
- The package's multi-level design allows you to start with simple API calls and progressively delve deeper into optimization as your computational needs grow.
171
+ The package's multi-level design allows you to start with simple API calls and progressively explore deeper optimization techniques as your computational needs grow.
147
172
 
148
173
  ## Map-folding Video
149
174
 
@@ -0,0 +1,43 @@
1
+ mapFolding/__init__.py,sha256=XRcskvsF7PTdsNOWWeR1FhQLA3fyBUScCqdfxYhAy8c,1998
2
+ mapFolding/basecamp.py,sha256=uPwbb_fi8zqqBbVjb355qanSNUqqJ9aefcf_nrvA7qI,4510
3
+ mapFolding/beDRY.py,sha256=UhH52BryHQNRjphf_PirtMkV45rhdemdC9PmnpACq7I,9397
4
+ mapFolding/filesystem.py,sha256=-pYpWugd0p3TrAz7xf9YIJW-pn1X-iRCGtJgEAF9Rns,5923
5
+ mapFolding/noHomeYet.py,sha256=UKZeWlyn0SKlF9dhYoud7E6gWXpiSEekZOOoJp88WeI,1362
6
+ mapFolding/oeis.py,sha256=TbY8KtAGbQlT6eEsa_7HVMF7bMLN-aBFKclyTMHfqHk,12615
7
+ mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ mapFolding/theDao.py,sha256=Blzm5j24x1BE2nvgXjdzHEeuc2na6kAH9b_eP6PcwlI,9836
9
+ mapFolding/theSSOT.py,sha256=DH0so-BVQm8RrBrqhehRC9spmb5Gg1vFegbMSeeoMcM,12236
10
+ mapFolding/reference/__init__.py,sha256=UIEU8BJR_YDzjFQcLel3XtHzOCJiOUGlGiWzOzbvhik,2206
11
+ mapFolding/reference/flattened.py,sha256=QK1xG9SllqCoi68e86Hyl9d9ATUAAFNpTQI-3zmcp5I,16072
12
+ mapFolding/reference/hunterNumba.py,sha256=espFiX92EPZ1Ub1YQVoBnNYvh2kFg1HR6Qa4djx8Ixg,7253
13
+ mapFolding/reference/irvineJavaPort.py,sha256=UEfIX4QbPLl5jnyfYIyX5YRR3_rYvPUikK8jLehsFko,4076
14
+ mapFolding/reference/jaxCount.py,sha256=TuDNKOnyhQfuixKmIxO9Algv7dvy7KMGhgsV3h96FGE,14853
15
+ mapFolding/reference/lunnanNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
16
+ mapFolding/reference/lunnanWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
17
+ mapFolding/reference/rotatedEntryPoint.py,sha256=5ughpKUT2JQhoAKgoDUdYNjgWQYPGV8v-7dWEAdDmfE,10274
18
+ mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
19
+ mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
20
+ mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
21
+ mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
22
+ mapFolding/someAssemblyRequired/__init__.py,sha256=xA5a-nZjXIwcqEOig5PEZSxde4_m3JJ5Pb0CN4aiRjw,2488
23
+ mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=CDbesDJSQE-P8uznXIAttRw9f413UpUt-RowK38hqbY,2735
24
+ mapFolding/someAssemblyRequired/ingredientsNumba.py,sha256=g6Z7t35NpoDskzm0OLwTQhHw5CYiYktVYxI2NhCQHww,8435
25
+ mapFolding/someAssemblyRequired/synthesizeNumbaFlow.py,sha256=scEozf2dy4pvrRMtQSycZf3RkNJtYLGKQVDhN6_H8_4,11812
26
+ mapFolding/someAssemblyRequired/synthesizeNumbaJobVESTIGIAL.py,sha256=RBSrtr7US2P7mkY-EA-b2WIOxjs2b0WJaCln1ERxOcI,22314
27
+ mapFolding/someAssemblyRequired/transformDataStructures.py,sha256=ssgnGpO4Z8tfdep-lzeodua8ZxA0qvjIwDGv6wbP_ew,8605
28
+ mapFolding/someAssemblyRequired/transformationTools.py,sha256=_m4i6TylMBCkh-f-LPAtUIzHhZm4nhyuQOceK3yNwIo,41067
29
+ mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
30
+ mapFolding/syntheticModules/numbaCount_doTheNeedful.py,sha256=52RuwJVH2fROvWU2dT8wYcQvLgRuvkNZPq01kujCC_U,15725
31
+ mapfolding-0.8.3.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
32
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ tests/conftest.py,sha256=hTpUTW7MtYGP5aeQnnoZMKgTEGCKdLJ8Fnmnv9d4NJw,11115
34
+ tests/test_computations.py,sha256=RHHByyuC8w-qbaag4Iqo_QNYm_7A-9BslbstMOdbZbU,3329
35
+ tests/test_filesystem.py,sha256=Kou0gj5T72oISao6umYfU6L_W5Hi7QS9_IxTv2hU0Pw,3147
36
+ tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
37
+ tests/test_other.py,sha256=AzsCXiX8x5WJ7i0SocWQY6lT30IJg1lKoybx03X2eqU,4281
38
+ tests/test_tasks.py,sha256=hkZygihT8bCEO2zc-2VcxReQrZJBwgLNbYx0YP4lTDg,2853
39
+ mapfolding-0.8.3.dist-info/METADATA,sha256=LPHFjXnPJA3N4TmHLA7EAEL20sRrjMatn-kxmL1_118,9286
40
+ mapfolding-0.8.3.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
41
+ mapfolding-0.8.3.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
42
+ mapfolding-0.8.3.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
43
+ mapfolding-0.8.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.1)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/conftest.py CHANGED
@@ -1,8 +1,14 @@
1
+ from importlib import import_module as importlib_import_module
1
2
  from collections.abc import Callable, Generator, Sequence
2
- from mapFolding.theSSOT import getAlgorithmDispatcher, getSourceAlgorithm, getPackageDispatcher, theModuleOfSyntheticModules, raiseIfNoneGitHubIssueNumber3
3
+ from types import ModuleType
4
+
5
+ import numpy
6
+ from mapFolding.theSSOT import ComputationState, The, getPackageDispatcher
3
7
  from mapFolding.beDRY import getLeavesTotal, validateListDimensions, makeDataContainer
4
8
  from mapFolding.oeis import oeisIDsImplemented, settingsOEIS
5
- from pathlib import Path
9
+ from mapFolding.someAssemblyRequired import RecipeSynthesizeFlow
10
+ from mapFolding.someAssemblyRequired.synthesizeNumbaFlow import makeNumbaFlow
11
+ from pathlib import Path, PurePosixPath
6
12
  from typing import Any, ContextManager
7
13
  import importlib.util
8
14
  import pytest
@@ -13,7 +19,6 @@ import uuid
13
19
 
14
20
  # SSOT for test data paths and filenames
15
21
  pathDataSamples = Path("tests/dataSamples")
16
- # NOTE `tmp` is not a diminutive form of temporary: it signals a technical term. And "temp" is strongly disfavored.
17
22
  pathTmpRoot: Path = pathDataSamples / "tmp"
18
23
 
19
24
  # The registrar maintains the register of temp files
@@ -142,7 +147,7 @@ def mockBenchmarkTimer() -> Generator[unittest.mock.MagicMock | unittest.mock.As
142
147
  def mockFoldingFunction() -> Callable[..., Callable[..., None]]:
143
148
  """Creates a mock function that simulates _countFolds behavior."""
144
149
  def make_mock(foldsValue: int, listDimensions: list[int]) -> Callable[..., None]:
145
- mock_array = makeDataContainer(2)
150
+ mock_array = makeDataContainer(2, numpy.int32)
146
151
  mock_array[0] = foldsValue
147
152
  mapShape = validateListDimensions(listDimensions)
148
153
  mock_array[-1] = getLeavesTotal(mapShape)
@@ -192,6 +197,11 @@ def useThisDispatcher() -> Generator[Callable[..., None], Any, None]:
192
197
  yield patchDispatcher
193
198
  basecamp.getPackageDispatcher = dispatcherOriginal
194
199
 
200
+ def getAlgorithmDispatcher() -> Callable[[ComputationState], ComputationState]:
201
+ moduleImported: ModuleType = importlib_import_module(The.logicalPathModuleSourceAlgorithm)
202
+ dispatcherCallable = getattr(moduleImported, The.dispatcherCallable)
203
+ return dispatcherCallable
204
+
195
205
  @pytest.fixture
196
206
  def useAlgorithmSourceDispatcher(useThisDispatcher: Callable[..., Any]) -> Generator[None, None, None]:
197
207
  """Temporarily patches getDispatcherCallable to return the algorithm dispatcher."""
@@ -199,35 +209,35 @@ def useAlgorithmSourceDispatcher(useThisDispatcher: Callable[..., Any]) -> Gener
199
209
  yield
200
210
 
201
211
  @pytest.fixture
202
- def syntheticDispatcherFixture(useThisDispatcher: Callable[..., Any]) -> Callable[..., Any]:
203
- listCallablesInline = listNumbaCallableDispatchees
204
- callableDispatcher = True
205
- algorithmSource = getSourceAlgorithm()
206
- relativePathWrite = theModuleOfSyntheticModules
207
- filenameModuleWrite = 'pytestCount.py'
208
- formatFilenameWrite = "pytest_{callableTarget}.py"
209
- listSynthesizedModules: list[YouOughtaKnow] = makeFlowNumbaOptimized(listCallablesInline, callableDispatcher, algorithmSource, relativePathWrite, filenameModuleWrite, formatFilenameWrite)
210
- dispatcherSynthetic: YouOughtaKnow | None = None
211
- for stuff in listSynthesizedModules:
212
- registrarRecordsTmpObject(stuff.pathFilenameForMe)
213
- if stuff.callableSynthesized not in listCallablesInline:
214
- dispatcherSynthetic = stuff
215
-
216
- if dispatcherSynthetic is None:
217
- raise raiseIfNoneGitHubIssueNumber3
218
-
219
- dispatcherSpec = importlib.util.spec_from_file_location(dispatcherSynthetic.callableSynthesized, dispatcherSynthetic.pathFilenameForMe)
220
- if dispatcherSpec is None:
221
- raise ImportError(f"{dispatcherSynthetic.pathFilenameForMe=}")
222
- if dispatcherSpec.loader is None:
223
- raise ImportError(f"Failed to get loader for module {dispatcherSynthetic.pathFilenameForMe}")
224
-
225
- dispatcherModule = importlib.util.module_from_spec(dispatcherSpec)
226
- dispatcherSpec.loader.exec_module(dispatcherModule)
227
- callableDispatcherSynthetic = getattr(dispatcherModule, dispatcherSynthetic.callableSynthesized)
228
-
229
- useThisDispatcher(callableDispatcherSynthetic)
230
- return callableDispatcherSynthetic
212
+ def syntheticDispatcherFixture(useThisDispatcher: Callable[..., Any], pathTmpTesting: Path) -> Callable[..., Any]:
213
+ """Generate synthetic Numba-optimized dispatcher module and patch the dispatcher"""
214
+ # Configure synthesis flow to use test directory
215
+ recipeFlow = RecipeSynthesizeFlow(
216
+ pathPackage=PurePosixPath(pathTmpTesting.absolute()),
217
+ Z0Z_flowLogicalPathRoot=None,
218
+ moduleDispatcher="test_dispatcher",
219
+ # Figure out dynamic flow control to synthesized modules https://github.com/hunterhogan/mapFolding/issues/4
220
+ # dispatcherCallable="dispatcherSynthetic",
221
+ )
222
+
223
+ # Generate optimized module in test directory
224
+ makeNumbaFlow(recipeFlow)
225
+
226
+ # Import synthesized dispatcher
227
+ importlibSpecificationDispatcher = importlib.util.spec_from_file_location(
228
+ recipeFlow.moduleDispatcher,
229
+ Path(recipeFlow.pathFilenameDispatcher),
230
+ )
231
+ if importlibSpecificationDispatcher is None or importlibSpecificationDispatcher.loader is None:
232
+ raise ImportError("Failed to load synthetic dispatcher module")
233
+
234
+ moduleSpecificationDispatcher = importlib.util.module_from_spec(importlibSpecificationDispatcher)
235
+ importlibSpecificationDispatcher.loader.exec_module(moduleSpecificationDispatcher)
236
+ callableDispatcherSynthetic = getattr(moduleSpecificationDispatcher, recipeFlow.dispatcherCallable)
237
+
238
+ # Patch dispatcher and return callable
239
+ useThisDispatcher(callableDispatcherSynthetic)
240
+ return callableDispatcherSynthetic
231
241
 
232
242
  def uniformTestMessage(expected: Any, actual: Any, functionName: str, *arguments: Any) -> str:
233
243
  """Format assertion message for any test comparison."""
@@ -23,6 +23,12 @@ def test_aOFn_calculate_value(oeisID: str) -> None:
23
23
  for n in settingsOEIS[oeisID]['valuesTestValidation']:
24
24
  standardizedEqualToCallableReturn(settingsOEIS[oeisID]['valuesKnown'][n], oeisIDfor_n, oeisID, n)
25
25
 
26
+ def test_syntheticParallel(syntheticDispatcherFixture: None, listDimensionsTestParallelization: list[int]):
27
+ standardizedEqualToCallableReturn(getFoldsTotalKnown(tuple(listDimensionsTestParallelization)), countFolds, listDimensionsTestParallelization, None, 'maximum')
28
+
29
+ def test_syntheticSequential(syntheticDispatcherFixture: None, listDimensionsTestCountFolds: list[int]) -> None:
30
+ standardizedEqualToCallableReturn(getFoldsTotalKnown(tuple(listDimensionsTestCountFolds)), countFolds, listDimensionsTestCountFolds)
31
+
26
32
  # @pytest.mark.parametrize('pathFilenameTmpTesting', ['.py'], indirect=True)
27
33
  # def test_writeJobNumba(listDimensionsTestCountFolds: list[int], pathFilenameTmpTesting: Path) -> None:
28
34
  # from mapFolding.syntheticModules import numbaCount
@@ -44,10 +50,4 @@ def test_aOFn_calculate_value(oeisID: str) -> None:
44
50
 
45
51
  # pathFilenameFoldsTotal = getPathFilenameFoldsTotal(listDimensionsTestCountFolds)
46
52
  # registrarRecordsTmpObject(pathFilenameFoldsTotal)
47
- # standardizedEqualTo(str(foldsTotalKnown[tuple(listDimensionsTestCountFolds)]), pathFilenameFoldsTotal.read_text().strip)
48
-
49
- # def test_syntheticParallel(syntheticDispatcherFixture: None, listDimensionsTestParallelization: list[int], foldsTotalKnown: dict[tuple[int, ...], int]):
50
- # standardizedEqualTo(foldsTotalKnown[tuple(listDimensionsTestParallelization)], countFolds, listDimensionsTestParallelization, None, 'maximum')
51
-
52
- # def test_syntheticSequential(syntheticDispatcherFixture: None, listDimensionsTestCountFolds: list[int], foldsTotalKnown: dict[tuple[int, ...], int]):
53
- # standardizedEqualTo(foldsTotalKnown[tuple(listDimensionsTestCountFolds)], countFolds, listDimensionsTestCountFolds)
53
+ # standardizedEqualToCallableReturn(str(getFoldsTotalKnown(tuple(listDimensionsTestCountFolds))), pathFilenameFoldsTotal.read_text().strip)
tests/test_other.py CHANGED
@@ -1,9 +1,11 @@
1
1
  from collections.abc import Callable
2
2
  from mapFolding.beDRY import getLeavesTotal, setCPUlimit, validateListDimensions
3
+ from mapFolding.theSSOT import The
3
4
  from tests.conftest import standardizedEqualToCallableReturn
4
5
  from typing import Any, Literal
5
6
  from Z0Z_tools import intInnit
6
7
  from Z0Z_tools.pytestForYourUse import PytestFor_intInnit, PytestFor_oopsieKwargsie
8
+ import multiprocessing
7
9
  import numba
8
10
  import pytest
9
11
  import sys
@@ -77,7 +79,6 @@ def testOopsieKwargsie(nameOfTest: str, callablePytest: Callable[[], None]) -> N
77
79
  (0, numba.get_num_threads()),
78
80
  (1, 1),
79
81
  ])
80
- def test_setCPUlimit(CPUlimit: None | float | bool | Literal[4] | Literal[-2] | Literal[0] | Literal[1], expectedLimit: Any | int) -> None:
81
- from mapFolding.theSSOT import concurrencyPackage
82
- if concurrencyPackage == 'numba':
83
- standardizedEqualToCallableReturn(expectedLimit, setCPUlimit, CPUlimit)
82
+ def test_setCPUlimitNumba(CPUlimit: None | float | bool | Literal[4] | Literal[-2] | Literal[0] | Literal[1], expectedLimit: Any | int) -> None:
83
+ numba.set_num_threads(multiprocessing.cpu_count())
84
+ standardizedEqualToCallableReturn(expectedLimit, setCPUlimit, CPUlimit, 'numba')
@@ -1,39 +0,0 @@
1
- mapFolding/__init__.py,sha256=hYxPUBU6A1_XCbKEseSDamooTsb1mzN_XHqaRLPvpGk,1701
2
- mapFolding/basecamp.py,sha256=7ghnbEcgMaGJYCy08GpOg0O28gY5P36ZibJkjs_r-Rg,4481
3
- mapFolding/beDRY.py,sha256=WRbvissfUGAmYbj1o0ZpGvq_9hwllDqpNwuC2_yxFyM,9785
4
- mapFolding/filesystem.py,sha256=-pYpWugd0p3TrAz7xf9YIJW-pn1X-iRCGtJgEAF9Rns,5923
5
- mapFolding/noHomeYet.py,sha256=UKZeWlyn0SKlF9dhYoud7E6gWXpiSEekZOOoJp88WeI,1362
6
- mapFolding/oeis.py,sha256=xArJ8X3HqzopKIKYdKwxk7Y62vtXZFxvZ0jEqv-8GO0,12625
7
- mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- mapFolding/theDao.py,sha256=Blzm5j24x1BE2nvgXjdzHEeuc2na6kAH9b_eP6PcwlI,9836
9
- mapFolding/theSSOT.py,sha256=pyetKz_Yuofm_z2XhNaQT_CWTatuAykZO2bxEPy9wS4,13670
10
- mapFolding/reference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- mapFolding/reference/flattened.py,sha256=KEIR8hhOW0NHDX52LHJrrTUY5QaCzexZF0S6P2wvogY,15209
12
- mapFolding/reference/hunterNumba.py,sha256=9MEy2szRSENZc9l1_VnRqBnnd71z4KjoPwOWnOwb9Pw,6105
13
- mapFolding/reference/irvineJavaPort.py,sha256=UkOSX0_dkKR84hp8aqHPuf7KLz_nVnji9M0IF_hRVm8,3418
14
- mapFolding/reference/jax.py,sha256=7ji9YWia6Kof0cjcNdiS1GG1rMbC5SBjcyVr_07AeUk,13845
15
- mapFolding/reference/lunnanNumpy.py,sha256=isI0dOYZM1CZi1P4NEojl9L2Kh45mOYtc2C8yXUit8E,3731
16
- mapFolding/reference/lunnanWhile.py,sha256=z1hcE6SeK0CFJSS4LggmzzsLNjU3dU26LsL5y_ZGBxM,3231
17
- mapFolding/reference/rotatedEntryPoint.py,sha256=S3y5hSUTYOR_lKBnd5SwufvjNvg3UP-Je4wpYRB-_78,9328
18
- mapFolding/reference/total_countPlus1vsPlusN.py,sha256=wpgay-uqPOBd64Z4Pg6tg40j7-4pzWHGMM6v0bnmjhE,6288
19
- mapFolding/someAssemblyRequired/__init__.py,sha256=xA5a-nZjXIwcqEOig5PEZSxde4_m3JJ5Pb0CN4aiRjw,2488
20
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=bGI8RZY-RnyR9TNF0r0OXwA6fm4TYH2cHy7WzhsnddQ,1895
21
- mapFolding/someAssemblyRequired/ingredientsNumba.py,sha256=g6Z7t35NpoDskzm0OLwTQhHw5CYiYktVYxI2NhCQHww,8435
22
- mapFolding/someAssemblyRequired/synthesizeNumbaFlow.py,sha256=EtzULVeivQ_4G2E2UKqXoZLx6XwRcbBDzhtzwCTOEfs,10627
23
- mapFolding/someAssemblyRequired/synthesizeNumbaJobVESTIGIAL.py,sha256=RBSrtr7US2P7mkY-EA-b2WIOxjs2b0WJaCln1ERxOcI,22314
24
- mapFolding/someAssemblyRequired/transformDataStructures.py,sha256=0qtILOuH8I4CWFog64SPAyOWTylCa2Yh7L_hILrQY9Q,8279
25
- mapFolding/someAssemblyRequired/transformationTools.py,sha256=vLRKAtaXa9RmoISUbFvQIWHDHor6CYctm7NEgU11T_E,40743
26
- mapFolding/syntheticModules/numbaCount_doTheNeedful.py,sha256=52RuwJVH2fROvWU2dT8wYcQvLgRuvkNZPq01kujCC_U,15725
27
- mapfolding-0.8.1.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
28
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- tests/conftest.py,sha256=rRlXOhihwheHyQ8ggjRBbmgPVERxWjupajguVBzBkVE,10783
30
- tests/test_computations.py,sha256=YhadlskBh_r5RiefHRy0FlrYQ0FelYbqcSNNSkSJMIY,3368
31
- tests/test_filesystem.py,sha256=Kou0gj5T72oISao6umYfU6L_W5Hi7QS9_IxTv2hU0Pw,3147
32
- tests/test_oeis.py,sha256=uxvwmgbnylSDdsVJfuAT0LuYLbIVFwSgdLxHm-xUGBM,5043
33
- tests/test_other.py,sha256=1uuApByNWPiTf0zaro2dETkvyWQFfMweU_ge4aJuVgM,4244
34
- tests/test_tasks.py,sha256=hkZygihT8bCEO2zc-2VcxReQrZJBwgLNbYx0YP4lTDg,2853
35
- mapfolding-0.8.1.dist-info/METADATA,sha256=Upa7kSAeKLeSk33CiII-W08xLugqgnqwIBVQu4VLEQg,7892
36
- mapfolding-0.8.1.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
37
- mapfolding-0.8.1.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
38
- mapfolding-0.8.1.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
39
- mapfolding-0.8.1.dist-info/RECORD,,