mapFolding 0.15.2__py3-none-any.whl → 0.15.4__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 (57) hide show
  1. mapFolding/__init__.py +15 -11
  2. mapFolding/_theSSOT.py +56 -63
  3. mapFolding/_theTypes.py +67 -5
  4. mapFolding/algorithms/__init__.py +1 -0
  5. mapFolding/algorithms/matrixMeanders.py +348 -0
  6. mapFolding/algorithms/oeisIDbyFormula.py +113 -0
  7. mapFolding/basecamp.py +105 -67
  8. mapFolding/oeis.py +40 -54
  9. mapFolding/reference/meandersDumpingGround/matrixMeanders64retired.py +160 -0
  10. mapFolding/{_oeisFormulas/matrixMeanders.py → reference/meandersDumpingGround/matrixMeandersBaselineV2.py} +28 -21
  11. mapFolding/someAssemblyRequired/A007822rawMaterials.py +1 -1
  12. mapFolding/someAssemblyRequired/makeAllModules.py +5 -5
  13. mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +5 -4
  14. mapFolding/syntheticModules/algorithmA007822.py +1 -1
  15. mapFolding/syntheticModules/algorithmA007822Numba.py +5 -3
  16. mapFolding/syntheticModules/dataPacking.py +2 -4
  17. mapFolding/syntheticModules/dataPackingA007822.py +2 -4
  18. mapFolding/syntheticModules/initializeStateA007822.py +1 -1
  19. mapFolding/syntheticModules/theorem2A007822.py +1 -1
  20. mapFolding/syntheticModules/theorem2A007822Numba.py +1 -1
  21. mapFolding/syntheticModules/theorem2A007822Trimmed.py +1 -1
  22. mapFolding/tests/conftest.py +30 -10
  23. mapFolding/tests/test_computations.py +75 -46
  24. mapFolding/tests/test_oeis.py +2 -20
  25. {mapfolding-0.15.2.dist-info → mapfolding-0.15.4.dist-info}/METADATA +2 -1
  26. mapfolding-0.15.4.dist-info/RECORD +78 -0
  27. {mapfolding-0.15.2.dist-info → mapfolding-0.15.4.dist-info}/entry_points.txt +0 -1
  28. mapFolding/_oeisFormulas/A000136.py +0 -4
  29. mapFolding/_oeisFormulas/A000560.py +0 -4
  30. mapFolding/_oeisFormulas/A000682.py +0 -17
  31. mapFolding/_oeisFormulas/A001010.py +0 -19
  32. mapFolding/_oeisFormulas/A001011.py +0 -5
  33. mapFolding/_oeisFormulas/A005315.py +0 -4
  34. mapFolding/_oeisFormulas/A005316.py +0 -10
  35. mapFolding/_oeisFormulas/A223094.py +0 -7
  36. mapFolding/_oeisFormulas/A259702.py +0 -4
  37. mapFolding/_oeisFormulas/A301620.py +0 -6
  38. mapFolding/_oeisFormulas/Z0Z_aOFn.py +0 -33
  39. mapFolding/_oeisFormulas/Z0Z_oeisMeanders.py +0 -52
  40. mapFolding/_oeisFormulas/__init__.py +0 -1
  41. mapFolding/_oeisFormulas/matrixMeandersAnnex.py +0 -84
  42. mapfolding-0.15.2.dist-info/RECORD +0 -88
  43. /mapFolding/{daoOfMapFolding.py → algorithms/daoOfMapFolding.py} +0 -0
  44. /mapFolding/reference/{A005316JavaPort.py → meandersDumpingGround/A005316JavaPort.py} +0 -0
  45. /mapFolding/reference/{A005316imperative.py → meandersDumpingGround/A005316imperative.py} +0 -0
  46. /mapFolding/reference/{A005316intOptimized.py → meandersDumpingGround/A005316intOptimized.py} +0 -0
  47. /mapFolding/reference/{A005316optimized128bit.py → meandersDumpingGround/A005316optimized128bit.py} +0 -0
  48. /mapFolding/reference/{A005316primitiveOptimized.py → meandersDumpingGround/A005316primitiveOptimized.py} +0 -0
  49. /mapFolding/reference/{A005316redis.py → meandersDumpingGround/A005316redis.py} +0 -0
  50. /mapFolding/reference/{A005316write2disk.py → meandersDumpingGround/A005316write2disk.py} +0 -0
  51. /mapFolding/reference/{matrixMeandersBaseline.py → meandersDumpingGround/matrixMeandersBaseline.py} +0 -0
  52. /mapFolding/reference/{matrixMeandersBaselineAnnex.py → meandersDumpingGround/matrixMeandersBaselineAnnex.py} +0 -0
  53. /mapFolding/reference/{matrixMeandersSimpleQueue.py → meandersDumpingGround/matrixMeandersSimpleQueue.py} +0 -0
  54. /mapFolding/reference/{matrixMeandersSlicePop.py → meandersDumpingGround/matrixMeandersSlicePop.py} +0 -0
  55. {mapfolding-0.15.2.dist-info → mapfolding-0.15.4.dist-info}/WHEEL +0 -0
  56. {mapfolding-0.15.2.dist-info → mapfolding-0.15.4.dist-info}/licenses/LICENSE +0 -0
  57. {mapfolding-0.15.2.dist-info → mapfolding-0.15.4.dist-info}/top_level.txt +0 -0
@@ -25,50 +25,28 @@ The `test_writeJobNumba` function shows how to test dynamically generated code,
25
25
  which is useful if you're working with the code synthesis features of the package.
26
26
  """
27
27
 
28
- from mapFolding import countFolds, getFoldsTotalKnown, oeisIDfor_n
28
+ from mapFolding import countFolds, dictionaryOEISMapFolding, dictionaryOEISMeanders, getFoldsTotalKnown, oeisIDfor_n
29
+ from mapFolding.algorithms import oeisIDbyFormula
29
30
  from mapFolding.dataBaskets import MapFoldingState
30
- from mapFolding.oeis import dictionaryOEIS
31
31
  from mapFolding.someAssemblyRequired.makeAllModules import parametersNumbaLight
32
32
  from mapFolding.someAssemblyRequired.RecipeJob import RecipeJobTheorem2
33
33
  from mapFolding.syntheticModules.initializeState import transitionOnGroupsOfFolds
34
34
  from mapFolding.tests.conftest import registrarRecordsTemporaryFilesystemObject, standardizedEqualToCallableReturn
35
35
  from pathlib import Path, PurePosixPath
36
- from typing import Literal
36
+ from typing import Literal, TYPE_CHECKING
37
37
  import importlib.util
38
38
  import multiprocessing
39
39
  import pytest
40
40
 
41
+ if TYPE_CHECKING:
42
+ from collections.abc import Callable
43
+
41
44
  if __name__ == '__main__':
42
45
  multiprocessing.set_start_method('spawn')
43
46
 
44
- @pytest.mark.parametrize('flow', ['daoOfMapFolding', 'numba', 'theorem2', 'theorem2numba', 'theorem2Trimmed'])
45
- def test_flowControl(mapShapeTestCountFolds: tuple[int, ...], flow: str) -> None:
46
- """Validate that different computational flows produce identical results.
47
-
48
- (AI generated docstring)
49
-
50
- This is the primary test for ensuring mathematical consistency across different
51
- algorithmic implementations. When adding a new computational approach, include
52
- it in the parametrized flow list to verify it produces correct results.
53
-
54
- The test compares the output of each flow against known correct values from
55
- OEIS sequences, ensuring that optimization techniques don't compromise accuracy.
56
-
57
- Parameters
58
- ----------
59
- mapShapeTestCountFolds : tuple[int, ...]
60
- The map shape dimensions to test fold counting for.
61
- flow : Literal['daoOfMapFolding', 'theorem2', 'theorem2numba']
62
- The computational flow algorithm to validate.
63
-
64
- """
65
- standardizedEqualToCallableReturn(getFoldsTotalKnown(mapShapeTestCountFolds), countFolds, None, None, None, None, mapShapeTestCountFolds, None, None, flow)
66
-
67
- def test_aOFn_calculate_value(oeisID: str) -> None:
47
+ def test_aOFn_calculate_value_mapFolding(oeisID: str) -> None:
68
48
  """Verify OEIS sequence value calculations against known reference values.
69
49
 
70
- (AI generated docstring)
71
-
72
50
  Tests the `oeisIDfor_n` function by comparing its calculated output against
73
51
  known correct values from the OEIS database. This ensures that sequence
74
52
  value computations remain mathematically accurate across code changes.
@@ -83,33 +61,84 @@ def test_aOFn_calculate_value(oeisID: str) -> None:
83
61
  The OEIS sequence identifier to test calculations for.
84
62
 
85
63
  """
86
- for n in dictionaryOEIS[oeisID]['valuesTestValidation']:
87
- standardizedEqualToCallableReturn(dictionaryOEIS[oeisID]['valuesKnown'][n], oeisIDfor_n, oeisID, n)
64
+ for n in dictionaryOEISMapFolding[oeisID]['valuesTestValidation']:
65
+ standardizedEqualToCallableReturn(dictionaryOEISMapFolding[oeisID]['valuesKnown'][n], oeisIDfor_n, oeisID, n)
88
66
 
89
- @pytest.mark.parametrize('flow', ['numba', 'theorem2', 'theorem2numba', 'theorem2Trimmed'])
90
- def test_flowControlByOEISid(flow: str) -> None:
91
- """Crappy.
67
+ def test_aOFn_calculate_value_meanders(oeisIDMeanders: str) -> None:
68
+ """Verify Meanders OEIS sequence value calculations against known reference values.
92
69
 
93
- I'm making this while pushing through pain, so it's not great but it's a step in the right direction.
70
+ Tests the functions in `mapFolding.algorithms.oeisIDbyFormula` by comparing their
71
+ calculated output against known correct values from the OEIS database for Meanders IDs.
94
72
 
95
- Notes for future me:
73
+ Parameters
74
+ ----------
75
+ oeisIDMeanders : str
76
+ The Meanders OEIS sequence identifier to test calculations for.
77
+
78
+ """
79
+ oeisIDcallable: Callable[[int], int] = getattr(oeisIDbyFormula, oeisIDMeanders)
80
+ for n in dictionaryOEISMeanders[oeisIDMeanders]['valuesTestValidation']:
81
+ standardizedEqualToCallableReturn(
82
+ dictionaryOEISMeanders[oeisIDMeanders]['valuesKnown'][n],
83
+ oeisIDcallable,
84
+ n,
85
+ )
86
+
87
+ @pytest.mark.parametrize('flow', ['daoOfMapFolding', 'numba', 'theorem2', 'theorem2Numba', 'theorem2Trimmed'])
88
+ def test_flowControl(mapShapeTestCountFolds: tuple[int, ...], flow: str) -> None:
89
+ """Validate that different computational flows produce valid results.
96
90
 
97
- `oeisID` is a fixture: don't use it here.
91
+ (AI generated docstring)
98
92
 
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:`
93
+ This is the primary test for ensuring mathematical consistency across different
94
+ algorithmic implementations. When adding a new computational approach, include
95
+ it in the parametrized flow list to verify it produces correct results.
102
96
 
103
- But that's wrong.
97
+ The test compares the output of each flow against known correct values from
98
+ OEIS sequences, ensuring that optimization techniques don't compromise accuracy.
99
+
100
+ Parameters
101
+ ----------
102
+ mapShapeTestCountFolds : tuple[int, ...]
103
+ The map shape dimensions to test fold counting for.
104
+ flow : str
105
+ The computational flow algorithm to validate.
104
106
 
105
- So, I'm changing the local identifier `OEISid` back to `oeisID` because I use `oeisID` everywhere else.
106
107
  """
108
+ standardizedEqualToCallableReturn(getFoldsTotalKnown(mapShapeTestCountFolds), countFolds, None, None, None, None, mapShapeTestCountFolds, None, None, flow)
107
109
 
108
- oeisID = 'A007822'
110
+ @pytest.mark.parametrize('flow', ['daoOfMapFolding', 'numba', 'theorem2', 'theorem2Numba', 'theorem2Trimmed'])
111
+ def test_flowControlByOEISid(oeisID: str, flow: str) -> None:
112
+ """Validate that different flow paths using oeisID produce valid results.
109
113
 
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)
114
+ Parameters
115
+ ----------
116
+ oeisID : str
117
+ The OEIS sequence identifier to test.
118
+ flow : str
119
+ The computational flow algorithm to validate.
120
+
121
+ """
122
+ listDimensions = None
123
+ pathLikeWriteFoldsTotal = None
124
+ computationDivisions = None
125
+ CPUlimit = None
126
+ mapShape = None
127
+
128
+ oeis_n = 2
129
+ for oeis_n in dictionaryOEISMapFolding[oeisID]['valuesTestValidation']:
130
+ if oeis_n < 2:
131
+ continue
132
+
133
+ if oeisID in dictionaryOEISMeanders:
134
+ expected = dictionaryOEISMeanders[oeisID]['valuesKnown'][oeis_n]
135
+ else:
136
+ expected = dictionaryOEISMapFolding[oeisID]['valuesKnown'][oeis_n]
137
+
138
+ standardizedEqualToCallableReturn(
139
+ expected
140
+ , countFolds, listDimensions, pathLikeWriteFoldsTotal, computationDivisions, CPUlimit, mapShape
141
+ , oeisID, oeis_n, flow)
113
142
 
114
143
  @pytest.mark.parametrize('pathFilename_tmpTesting', ['.py'], indirect=True)
115
144
  def test_writeJobNumba(oneTestCuzTestsOverwritingTests: tuple[int, ...], pathFilename_tmpTesting: Path) -> None:
@@ -26,7 +26,7 @@ which is crucial for maintaining package reliability in production environments.
26
26
 
27
27
  from contextlib import redirect_stdout
28
28
  from mapFolding.oeis import (
29
- _standardizeOEISid, clearOEIScache, dictionaryOEIS, getOEISids, OEIS_for_n, oeisIDfor_n, oeisIDsImplemented)
29
+ _standardizeOEISid, dictionaryOEISMapFolding, getOEISids, OEIS_for_n, oeisIDfor_n, oeisIDsImplemented)
30
30
  from mapFolding.tests.conftest import standardizedEqualToCallableReturn, standardizedSystemExit
31
31
  from typing import Any
32
32
  import io
@@ -57,24 +57,6 @@ def test_aOFn_invalid_n(oeisID_1random: str, badN: Any) -> None:
57
57
  def test_aOFn_zeroDim_A001418() -> None:
58
58
  standardizedEqualToCallableReturn(ArithmeticError, oeisIDfor_n, 'A001418', 0)
59
59
 
60
- # ===== OEIS Cache Tests =====
61
- @pytest.mark.parametrize("cacheExists", [True, False])
62
- @unittest.mock.patch('pathlib.Path.exists')
63
- @unittest.mock.patch('pathlib.Path.unlink')
64
- def test_clearOEIScache(mock_unlink: unittest.mock.MagicMock, mock_exists: unittest.mock.MagicMock, cacheExists: bool) -> None:
65
- """Test OEIS cache clearing with both existing and non-existing cache."""
66
- mock_exists.return_value = cacheExists
67
- clearOEIScache()
68
-
69
- if cacheExists:
70
- # Each OEIS ID has two cache files
71
- expected_calls = len(dictionaryOEIS) * 2
72
- assert mock_unlink.call_count == expected_calls
73
- mock_unlink.assert_has_calls([unittest.mock.call(missing_ok=True)] * expected_calls)
74
- else:
75
- mock_exists.assert_called_once()
76
- mock_unlink.assert_not_called()
77
-
78
60
  # ===== Command Line Interface Tests =====
79
61
  def testHelpText() -> None:
80
62
  """Test that help text is complete and examples are valid."""
@@ -87,7 +69,7 @@ def testHelpText() -> None:
87
69
  # Verify content
88
70
  for oeisID in oeisIDsImplemented:
89
71
  assert oeisID in helpText
90
- assert dictionaryOEIS[oeisID]['description'] in helpText
72
+ assert dictionaryOEISMapFolding[oeisID]['description'] in helpText
91
73
 
92
74
  # Extract and verify examples
93
75
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapFolding
3
- Version: 0.15.2
3
+ Version: 0.15.4
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
@@ -39,6 +39,7 @@ Requires-Dist: hunterMakesPy
39
39
  Requires-Dist: numpy
40
40
  Requires-Dist: platformdirs
41
41
  Provides-Extra: development
42
+ Requires-Dist: memray; sys_platform == "linux" and extra == "development"
42
43
  Requires-Dist: mypy; extra == "development"
43
44
  Requires-Dist: pyupgrade; extra == "development"
44
45
  Requires-Dist: py-spy; extra == "development"
@@ -0,0 +1,78 @@
1
+ mapFolding/__init__.py,sha256=6iou-H1W0rZdGmo7WjLwdYbR44fP_hVxeT2vjLh9e_A,3965
2
+ mapFolding/_theSSOT.py,sha256=SoG6tKzhjpc7gnG1b3qLfpXiT2_GR3yYTWMpble6If4,5224
3
+ mapFolding/_theTypes.py,sha256=F2pCHexrlbHTgMpQn58jDhkwAMFUSBp28gQp21n86o0,6559
4
+ mapFolding/basecamp.py,sha256=TITldxLm889eqBPXmlAilbC6Bmi_QNafzaLWYe1jptg,15755
5
+ mapFolding/beDRY.py,sha256=iYATcrYrAWkKaAecjA_awELBtZP5Q3snU4053dIsEwU,13941
6
+ mapFolding/dataBaskets.py,sha256=04tVULSbWbPkKkLjTofWfVOr6gWcs38XILvU0-ftHIU,15191
7
+ mapFolding/filesystemToolkit.py,sha256=Ex5tyugRQurXIgUNVtkQYfWMq8fM4e-izX01MBXU5_8,11006
8
+ mapFolding/oeis.py,sha256=f9yywOQzvdG8ofqmRL1_-1BlO8rgo4TdEo6VyXHiJNw,18639
9
+ mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ mapFolding/algorithms/__init__.py,sha256=gARPqfySaeSWMfApQ5wSxzy7ZdgLdKYsLqsRSEYWwWI,28
11
+ mapFolding/algorithms/daoOfMapFolding.py,sha256=yLqaAqMwHIVFAtig3T46aZZQLAjCtQzYoAi0iMs_2CY,5482
12
+ mapFolding/algorithms/matrixMeanders.py,sha256=XLcaiUH66PlIzEQb4bD7oZpWjFGxysnj_w-KiXxIj5E,20740
13
+ mapFolding/algorithms/oeisIDbyFormula.py,sha256=Ke1SOVGzE3uDq0tAS2kHzo8AtT_tntmXpgcizNx6DVs,2889
14
+ mapFolding/reference/__init__.py,sha256=GKcSgYE49NcTISx-JZbELXyq-eRkMeTL5g4DXInWFw0,2206
15
+ mapFolding/reference/flattened.py,sha256=0eHgLFIeIeVUsI5zF5oSy5iWYrjOMzxr7KjDxiTe01k,16078
16
+ mapFolding/reference/hunterNumba.py,sha256=iLfyqwGdAh6c5GbapnKsWhAsNsR3O-fyGGHAdohluLw,7258
17
+ mapFolding/reference/irvineJavaPort.py,sha256=XnsL4g33LRrYwAhcrAVt-ujsP6QD6fbyCsGYzcm9g_k,3724
18
+ mapFolding/reference/jaxCount.py,sha256=t8ons45zyWNJQ-nmn1qbhNsTkTnRzf7ATauaYvIlkRI,14853
19
+ mapFolding/reference/lunnonNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
20
+ mapFolding/reference/lunnonWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
21
+ mapFolding/reference/rotatedEntryPoint.py,sha256=3IJU7Hc2PDSE71wmSkDs4Z3t0Px9NBSzmCsVrgQuQyU,10274
22
+ mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
23
+ mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
24
+ mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
25
+ mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
26
+ mapFolding/reference/meandersDumpingGround/A005316JavaPort.py,sha256=6qqTzbD3PTwYGtqaywEURGXtNFx1lp8ofEwpQeEvAHc,4899
27
+ mapFolding/reference/meandersDumpingGround/A005316imperative.py,sha256=hhjUxELOktNBmHrwIoxVA-mcFsOWgg01p780OBeqL04,3816
28
+ mapFolding/reference/meandersDumpingGround/A005316intOptimized.py,sha256=oO9ktdYeFwtosVp5KliwH8JmCSxfjapjBM1iMECuDAc,4121
29
+ mapFolding/reference/meandersDumpingGround/A005316optimized128bit.py,sha256=6JxmVBIQnN0rH0MQIZtu_wgY1Wbms8hZCWarMe5NLLU,3416
30
+ mapFolding/reference/meandersDumpingGround/A005316primitiveOptimized.py,sha256=iFig6Edv1E774xrlVUFLyscC40DqDhV-oh4hOnG2DLI,4116
31
+ mapFolding/reference/meandersDumpingGround/A005316redis.py,sha256=MPeiobrs3VsNZOOKYBg52oVp0OjVDzLEdsRKfrZ9LrU,4328
32
+ mapFolding/reference/meandersDumpingGround/A005316write2disk.py,sha256=NMVrdhe5KhnXQfaQ5Xr7Pwl5oXYEOM1DrMISDDOCVVw,5633
33
+ mapFolding/reference/meandersDumpingGround/matrixMeanders64retired.py,sha256=oRVgf6zkWRjk7dWR-Px41M_5spdvKy_Pich0qd7oxVA,9270
34
+ mapFolding/reference/meandersDumpingGround/matrixMeandersBaseline.py,sha256=8Z98MMfhTCdoa75HWZz4DO166EiHZCu5eHeFzhgK42s,3003
35
+ mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineAnnex.py,sha256=d2Oh4JZxz53ox_ArhIxpMTOuA7rtE9wnEPojpFcnlfc,5817
36
+ mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineV2.py,sha256=VpRiIGhnk-DbxwsHwCeCwXqcKLSNyHl-iRGLDH9ZGMY,7674
37
+ mapFolding/reference/meandersDumpingGround/matrixMeandersSimpleQueue.py,sha256=pOfaS315OKIBG9GSqSJwUDcEhfnV2XduM9IPqHrBvJg,4083
38
+ mapFolding/reference/meandersDumpingGround/matrixMeandersSlicePop.py,sha256=XyiesSQAH1dRplYx_CdR1FzcXvgmmxzj27V4aIqPp7o,5353
39
+ mapFolding/someAssemblyRequired/A007822rawMaterials.py,sha256=_IeOaxuA3IoHzsrm7qRPO_M1ZT09ATLJl7xpTXiqg8E,1697
40
+ mapFolding/someAssemblyRequired/RecipeJob.py,sha256=yGGPHq9JX-Gf7QlJz50EPpkO7sADwGvSZNA1aC_F_PQ,9866
41
+ mapFolding/someAssemblyRequired/__init__.py,sha256=UNDh6O86jT5ywlw9LgeWsUHwOfNvoMJRDAzYXbwCbeM,5779
42
+ mapFolding/someAssemblyRequired/_toolIfThis.py,sha256=VDZC10Xo3E1Y5n6FmaBBbOBR-rinV9DFkpgw8zrDyzg,6339
43
+ mapFolding/someAssemblyRequired/_toolkitContainers.py,sha256=Xbo1QJT8KtrWcAvQ-eLzOEzR8N78WfF43fJKGRIebA4,13625
44
+ mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=tY0-2K0BFkwLAAjSrFJLPoG8CevDHOFc3OH3TxXANzg,2806
45
+ mapFolding/someAssemblyRequired/infoBooth.py,sha256=GWiqnHbqk7te_pvVuk4G_gbFa_W2aeSx19w4pakvqfM,2300
46
+ mapFolding/someAssemblyRequired/makeAllModules.py,sha256=V-vjzHQsD4O2SP--zCik7y7eblKZNPgU9CrUKZ7wAwY,44530
47
+ mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py,sha256=wflkPttFID9vao4C4CohoUCYgbMWD7GhZ7TO9h5mwtE,17196
48
+ mapFolding/someAssemblyRequired/makeJobTheorem2codon.py,sha256=JasXcDMBVO1t0m84z1Q3T30dIZCteLsxVUK0QL3jYdA,11495
49
+ mapFolding/someAssemblyRequired/toolkitNumba.py,sha256=nCCVsGidAlcKRVAvA__hu4bXtat3B-cO9YloKtqOAc4,14919
50
+ mapFolding/someAssemblyRequired/transformationTools.py,sha256=nPGZsvb5GquaCCxdDh_XzNIZYSiVJpWKd7wfhfRvxnk,11512
51
+ mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
52
+ mapFolding/syntheticModules/algorithmA007822.py,sha256=rJHwImwcFGAysYoNME79qmNhoa3ebRgXb7ktKZLtSZ8,7074
53
+ mapFolding/syntheticModules/algorithmA007822Numba.py,sha256=Ae_UZ2My56GJZ8ZA6WSeLWb7Rml3tcgxpY7r6-lTP6Y,7228
54
+ mapFolding/syntheticModules/countParallelNumba.py,sha256=6sHWzGc6ch3HjKVB8krvaBec_KoHv3gpfN_F5Vl1SP8,7870
55
+ mapFolding/syntheticModules/daoOfMapFoldingNumba.py,sha256=5oMb8pttNKslN6wss9JIQXSnmjgE2q_2-3fIrh1pEW0,6033
56
+ mapFolding/syntheticModules/dataPacking.py,sha256=SzRmDNr2OZP6Xk4krLqxTuWAUtUJxBDXmHEqlBHzNPI,2407
57
+ mapFolding/syntheticModules/dataPackingA007822.py,sha256=NeE6ohIx2yRIA25L58NbX3sd5OLPB9LkTqfeFjvUs3Y,2468
58
+ mapFolding/syntheticModules/initializeState.py,sha256=OTiVi1Ywnlwk8tbwSIFjPJa_yBCINoapaCzGXDAJq_k,3121
59
+ mapFolding/syntheticModules/initializeStateA007822.py,sha256=qizwxyNqKSgnF4MyBWU8Nca9IRbTnp-rrUAirF-ZL-E,4344
60
+ mapFolding/syntheticModules/theorem2.py,sha256=QeXkBScihDatBk4iEMOMSntvhyJISb0G8zwZMQe7JFc,3031
61
+ mapFolding/syntheticModules/theorem2A007822.py,sha256=HflJuuOj6b_cF6zEKmLy74Nzv_7jFrqLmjsN05XM4KQ,4254
62
+ mapFolding/syntheticModules/theorem2A007822Numba.py,sha256=GppP_WntOrcFSIpIk6jP7PlAb4PlskzEBqfKOJaisSA,4637
63
+ mapFolding/syntheticModules/theorem2A007822Trimmed.py,sha256=ekbKQ_FIZgaQ9m7NrxDimx5dM2PBDIReGBtpv23jpNc,3922
64
+ mapFolding/syntheticModules/theorem2Numba.py,sha256=AFe-KI97ilPgPFA22ASAhfUetaTA249K7By_vqu1Crs,3416
65
+ mapFolding/syntheticModules/theorem2Trimmed.py,sha256=geKX3So1SqhENlKeEO2dV6S3rGsxBp-AItB4hRbwbBI,2699
66
+ mapFolding/tests/__init__.py,sha256=QVCHSMFVvTxV3mAyYOLkMFAFyBJ514zdoVnDmpBJnTo,1336
67
+ mapFolding/tests/conftest.py,sha256=fLBZFStVJEIfbt6PQNVyAEdMVyck_lwhEB0eZYgQSwU,15255
68
+ mapFolding/tests/test_computations.py,sha256=OTKnDqNOrTLhkfkoq0NX5veEsGQPlz140SROBWHI8U0,8297
69
+ mapFolding/tests/test_filesystem.py,sha256=0rYQ62f4e3HOoymXrxDWbqNEBJQ7DGN8RUOMI84tE2Q,3892
70
+ mapFolding/tests/test_oeis.py,sha256=qwi9z_BnpeGO4QwTHj_WOiP21gf2rUgDdxhc90zWsl8,4754
71
+ mapFolding/tests/test_other.py,sha256=ScBiJ78LnyAaW-RhxcouX6Xw10wgpSdqfvT4LO3WjnQ,4766
72
+ mapFolding/tests/test_tasks.py,sha256=_pr9JRWjjNKA7sww70XvkJJdGPruBVzubM63RmD_Du0,4013
73
+ mapfolding-0.15.4.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
74
+ mapfolding-0.15.4.dist-info/METADATA,sha256=BXwMx_DXwPRzBfAXUWNsBUVp71OvXFIXkpOuToAOYqs,5234
75
+ mapfolding-0.15.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
76
+ mapfolding-0.15.4.dist-info/entry_points.txt,sha256=-mH9DjW9tDRMPaeoSWKKywG35cR28m12H_jtmrB4eY8,98
77
+ mapfolding-0.15.4.dist-info/top_level.txt,sha256=aG3bjFBoxxuaV3Iu1wZAd241Ubs3cdaJtKYBQBDIjsg,11
78
+ mapfolding-0.15.4.dist-info/RECORD,,
@@ -1,4 +1,3 @@
1
1
  [console_scripts]
2
2
  OEIS_for_n = mapFolding.oeis:OEIS_for_n
3
- clearOEIScache = mapFolding.oeis:clearOEIScache
4
3
  getOEISids = mapFolding.oeis:getOEISids
@@ -1,4 +0,0 @@
1
- from mapFolding._oeisFormulas.A000682 import A000682
2
-
3
- def A000136(n: int) -> int:
4
- return n * A000682(n)
@@ -1,4 +0,0 @@
1
- from mapFolding._oeisFormulas.A000682 import A000682
2
-
3
- def A000560(n: int) -> int:
4
- return A000682(n + 1) // 2
@@ -1,17 +0,0 @@
1
- from mapFolding._oeisFormulas.matrixMeanders import count
2
-
3
- def initializeA000682(n: int) -> dict[int, int]:
4
- curveLocationsMAXIMUM = 1 << (2 * n + 4)
5
-
6
- curveSeed: int = 5 - (n & 0b1) * 4
7
- listCurveLocations = [(curveSeed << 1) | curveSeed]
8
-
9
- while listCurveLocations[-1] < curveLocationsMAXIMUM:
10
- curveSeed = (curveSeed << 4) | 0b101
11
- listCurveLocations.append((curveSeed << 1) | curveSeed)
12
-
13
- return dict.fromkeys(listCurveLocations, 1)
14
-
15
- def A000682(n: int) -> int:
16
- return count(n - 1, initializeA000682(n - 1))
17
-
@@ -1,19 +0,0 @@
1
- from mapFolding import countFolds
2
- from mapFolding._oeisFormulas.A000682 import A000682
3
-
4
- def A001010(n: int) -> int:
5
- """Complicated.
6
-
7
- a(2n-1) = 2*A007822(n)
8
- OddQ[n], 2*A007822[[(n - 1)/2 + 1]]]
9
-
10
- a(2n) = 2*A000682(n+1)
11
- EvenQ[n], 2*A000682[[n/2 + 1]]
12
- """
13
- if n & 0b1:
14
- foldsTotal = 2 * countFolds(oeisID='A007822', oeis_n=(n - 1)//2 + 1, flow='theorem2Numba')
15
- else:
16
- foldsTotal = 2 * A000682(n // 2 + 1)
17
-
18
- return foldsTotal
19
-
@@ -1,5 +0,0 @@
1
- from mapFolding._oeisFormulas.A000136 import A000136
2
- from mapFolding._oeisFormulas.A001010 import A001010
3
-
4
- def A001011(n: int) -> int:
5
- return (A001010(n) + A000136(n)) // 4
@@ -1,4 +0,0 @@
1
- from mapFolding._oeisFormulas.A005316 import A005316
2
-
3
- def A005315(n: int) -> int:
4
- return A005316(2 * n - 1)
@@ -1,10 +0,0 @@
1
- from mapFolding._oeisFormulas.matrixMeanders import count
2
-
3
- def initializeA005316(n: int) -> dict[int, int]:
4
- if n & 0b1:
5
- return {22: 1}
6
- else:
7
- return {15: 1}
8
-
9
- def A005316(n: int) -> int:
10
- return count(n-1, initializeA005316(n-1))
@@ -1,7 +0,0 @@
1
- from mapFolding._oeisFormulas.A000136 import A000136
2
- from mapFolding._oeisFormulas.A000682 import A000682
3
-
4
- def A223094(n: int) -> int:
5
- return A000136(n) - A000682(n + 1)
6
-
7
- # %F A223094 For n >= 3: a(n) = n! - Sum_{k=3..n-1} (a(k)*n!/k!) - A000682(n+1). - _Roger Ford_, Aug 24 2024
@@ -1,4 +0,0 @@
1
- from mapFolding._oeisFormulas.A000682 import A000682
2
-
3
- def A259702(n: int) -> int:
4
- return A000682(n) // 2 - A000682(n - 1)
@@ -1,6 +0,0 @@
1
- from mapFolding._oeisFormulas.A000682 import A000682
2
-
3
- def A301620(n: int) -> int:
4
- return A000682(n + 2) - 2 * A000682(n + 1)
5
-
6
- # %F A301620 a(n) = Sum_{k=3..floor((n+3)/2)} (A259689(n+1,k)*(k-2)). - _Roger Ford_, Dec 10 2018
@@ -1,33 +0,0 @@
1
- from mapFolding._oeisFormulas.A000136 import A000136
2
- from mapFolding._oeisFormulas.A000682 import A000682
3
- from mapFolding._oeisFormulas.A001010 import A001010
4
- from mapFolding._oeisFormulas.Z0Z_oeisMeanders import dictionaryOEISMeanders
5
- from mapFolding.oeis import dictionaryOEIS
6
- import sys
7
- import time
8
-
9
- # ruff: noqa: ERA001
10
-
11
- if __name__ == '__main__':
12
- def _write() -> None:
13
- sys.stdout.write(
14
- f"{(match:=foldsTotal == dictionaryOEISMeanders[oeisID]['valuesKnown'][n])}\t"
15
- f"\033[{(not match)*91}m"
16
- f"{n}\t"
17
- f"{foldsTotal=}\t"
18
- f"{dictionaryOEISMeanders[oeisID]['valuesKnown'][n]=}\t"
19
- f"{time.perf_counter() - timeStart:.2f}\t"
20
- # f"{description}\t"
21
- "\033[0m\n"
22
- )
23
- oeisID = 'A000136'
24
- oeisID = 'A000682'
25
- oeisID = 'A001010'
26
- for n in range(2, 13):
27
-
28
- # sys.stdout.write(f"{n = }\n")
29
-
30
- timeStart = time.perf_counter()
31
- foldsTotal = eval(oeisID)(n)
32
- # sys.stdout.write(f"{n} {foldsTotal} {time.perf_counter() - timeStart:.2f}\n")
33
- _write()
@@ -1,52 +0,0 @@
1
- from mapFolding._oeisFormulas.A000560 import A000560
2
- from mapFolding._oeisFormulas.A000682 import A000682
3
- from mapFolding._oeisFormulas.A001010 import A001010
4
- from mapFolding._oeisFormulas.A001011 import A001011
5
- from mapFolding._oeisFormulas.A005315 import A005315
6
- from mapFolding._oeisFormulas.A005316 import A005316
7
- from mapFolding._oeisFormulas.A223094 import A223094
8
- from mapFolding._oeisFormulas.A259702 import A259702
9
- from mapFolding._oeisFormulas.A301620 import A301620
10
- from mapFolding.oeis import getOEISidInformation, getOEISidValues
11
- import sys
12
-
13
- oeisIDsMeanders: list[str] = [
14
- 'A000560',
15
- 'A000682',
16
- 'A001010',
17
- 'A001011',
18
- 'A005315',
19
- 'A005316',
20
- 'A223094',
21
- 'A259702',
22
- 'A301620',
23
- ]
24
-
25
- dictionaryOEISMeanders: dict[str, dict[str, dict[int, int] | str | int]] = {
26
- oeisID: {
27
- 'valuesKnown': getOEISidValues(oeisID),
28
- 'description': getOEISidInformation(oeisID)[0],
29
- 'offset': getOEISidInformation(oeisID)[1],
30
- }
31
- for oeisID in oeisIDsMeanders
32
- }
33
-
34
- # ruff: noqa: S101
35
- # pyright: reportIndexIssue=false
36
-
37
- rangeTest = range(5, 13)
38
-
39
- if __name__ == '__main__':
40
- for n in rangeTest:
41
-
42
- assert A000560(n) == dictionaryOEISMeanders['A000560']['valuesKnown'][n]
43
- assert A000682(n) == dictionaryOEISMeanders['A000682']['valuesKnown'][n]
44
- assert A001010(n) == dictionaryOEISMeanders['A001010']['valuesKnown'][n]
45
- assert A001011(n) == dictionaryOEISMeanders['A001011']['valuesKnown'][n]
46
- assert A005315(n) == dictionaryOEISMeanders['A005315']['valuesKnown'][n]
47
- assert A005316(n) == dictionaryOEISMeanders['A005316']['valuesKnown'][n]
48
- assert A223094(n) == dictionaryOEISMeanders['A223094']['valuesKnown'][n]
49
- assert A259702(n) == dictionaryOEISMeanders['A259702']['valuesKnown'][n]
50
- assert A301620(n) == dictionaryOEISMeanders['A301620']['valuesKnown'][n]
51
-
52
- sys.stdout.write(f"\nTrue for {str(rangeTest)}\n")
@@ -1 +0,0 @@
1
- """OEIS formula collection and analysis."""
@@ -1,84 +0,0 @@
1
- from typing import NamedTuple
2
- import sys
3
-
4
- class limitLocators(NamedTuple):
5
- bifurcationAlphaLocator: int
6
- bifurcationZuluLocator: int
7
- curveLocationsMAXIMUM: int
8
-
9
- curveMaximum: dict[int, limitLocators] = {
10
- 0: limitLocators(0x15, 0x2a, 0x10),
11
- 1: limitLocators(0x55, 0xaa, 0x40),
12
- 2: limitLocators(0x155, 0x2aa, 0x100),
13
- 3: limitLocators(0x555, 0xaaa, 0x400),
14
- 4: limitLocators(0x1555, 0x2aaa, 0x1000),
15
- 5: limitLocators(0x5555, 0xaaaa, 0x4000),
16
- 6: limitLocators(0x15555, 0x2aaaa, 0x10000),
17
- 7: limitLocators(0x55555, 0xaaaaa, 0x40000),
18
- 8: limitLocators(0x155555, 0x2aaaaa, 0x100000),
19
- 9: limitLocators(0x555555, 0xaaaaaa, 0x400000),
20
- 10: limitLocators(0x1555555, 0x2aaaaaa, 0x1000000),
21
- 11: limitLocators(0x5555555, 0xaaaaaaa, 0x4000000),
22
- 12: limitLocators(0x15555555, 0x2aaaaaaa, 0x10000000),
23
- 13: limitLocators(0x55555555, 0xaaaaaaaa, 0x40000000),
24
- 14: limitLocators(0x155555555, 0x2aaaaaaaa, 0x100000000),
25
- 15: limitLocators(0x555555555, 0xaaaaaaaaa, 0x400000000),
26
- 16: limitLocators(0x1555555555, 0x2aaaaaaaaa, 0x1000000000),
27
- 17: limitLocators(0x5555555555, 0xaaaaaaaaaa, 0x4000000000),
28
- 18: limitLocators(0x15555555555, 0x2aaaaaaaaaa, 0x10000000000),
29
- 19: limitLocators(0x55555555555, 0xaaaaaaaaaaa, 0x40000000000),
30
- 20: limitLocators(0x155555555555, 0x2aaaaaaaaaaa, 0x100000000000),
31
- 21: limitLocators(0x555555555555, 0xaaaaaaaaaaaa, 0x400000000000),
32
- 22: limitLocators(0x1555555555555, 0x2aaaaaaaaaaaa, 0x1000000000000),
33
- 23: limitLocators(0x5555555555555, 0xaaaaaaaaaaaaa, 0x4000000000000),
34
- 24: limitLocators(0x15555555555555, 0x2aaaaaaaaaaaaa, 0x10000000000000),
35
- 25: limitLocators(0x55555555555555, 0xaaaaaaaaaaaaaa, 0x40000000000000),
36
- 26: limitLocators(0x155555555555555, 0x2aaaaaaaaaaaaaa, 0x100000000000000),
37
- 27: limitLocators(0x555555555555555, 0xaaaaaaaaaaaaaaa, 0x400000000000000),
38
- 28: limitLocators(0x1555555555555555, 0x2aaaaaaaaaaaaaaa, 0x1000000000000000), # 0x2aaaaaaaaaaaaaaa.bit_length() = 62
39
- 29: limitLocators(0x5555555555555555, 0xaaaaaaaaaaaaaaaa, 0x4000000000000000),
40
- 30: limitLocators(0x15555555555555555, 0x2aaaaaaaaaaaaaaaa, 0x10000000000000000),
41
- 31: limitLocators(0x55555555555555555, 0xaaaaaaaaaaaaaaaaa, 0x40000000000000000),
42
- 32: limitLocators(0x155555555555555555, 0x2aaaaaaaaaaaaaaaaa, 0x100000000000000000),
43
- 33: limitLocators(0x555555555555555555, 0xaaaaaaaaaaaaaaaaaa, 0x400000000000000000),
44
- 34: limitLocators(0x1555555555555555555, 0x2aaaaaaaaaaaaaaaaaa, 0x1000000000000000000),
45
- 35: limitLocators(0x5555555555555555555, 0xaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000),
46
- 36: limitLocators(0x15555555555555555555, 0x2aaaaaaaaaaaaaaaaaaa, 0x10000000000000000000),
47
- 37: limitLocators(0x55555555555555555555, 0xaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000),
48
- 38: limitLocators(0x155555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000),
49
- 39: limitLocators(0x555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000),
50
- 40: limitLocators(0x1555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000),
51
- 41: limitLocators(0x5555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000),
52
- 42: limitLocators(0x15555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000),
53
- 43: limitLocators(0x55555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000),
54
- 44: limitLocators(0x155555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000),
55
- 45: limitLocators(0x555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000),
56
- 46: limitLocators(0x1555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000),
57
- 47: limitLocators(0x5555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000),
58
- 48: limitLocators(0x15555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000),
59
- 49: limitLocators(0x55555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000),
60
- 50: limitLocators(0x155555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000),
61
- 51: limitLocators(0x555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000),
62
- 52: limitLocators(0x1555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000),
63
- 53: limitLocators(0x5555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000),
64
- 54: limitLocators(0x15555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000),
65
- 55: limitLocators(0x55555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000),
66
- 56: limitLocators(0x155555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x100000000000000000000000000000),
67
- 57: limitLocators(0x555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x400000000000000000000000000000),
68
- 58: limitLocators(0x1555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x1000000000000000000000000000000),
69
- 59: limitLocators(0x5555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x4000000000000000000000000000000),
70
- 60: limitLocators(0x15555555555555555555555555555555, 0x2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x10000000000000000000000000000000),
71
- 61: limitLocators(0x55555555555555555555555555555555, 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0x40000000000000000000000000000000),
72
- }
73
-
74
- def makeCurveMaximum() -> None:
75
- sys.stdout.write("curveMaximum: dict[int, limitLocators] = {\n")
76
- for n in range(62):
77
- curveLocationsMAXIMUM = 1 << (2 * n + 4)
78
- bifurcationAlphaLocator = int('01' * ((curveLocationsMAXIMUM.bit_length() + 1) // 2), 2)
79
- sys.stdout.write(f"{n}: limitLocators({hex(bifurcationAlphaLocator)}, {hex(bifurcationAlphaLocator << 1)}, {hex(curveLocationsMAXIMUM)}),\n")
80
- sys.stdout.write("}\n")
81
-
82
- if __name__ == '__main__':
83
- makeCurveMaximum()
84
-