mapFolding 0.16.0__py3-none-any.whl → 0.16.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.
- easyRun/A000682.py +25 -0
- easyRun/A005316.py +20 -0
- easyRun/NOTcountingFolds.py +36 -0
- easyRun/__init__.py +0 -0
- easyRun/countFolds.py +41 -0
- easyRun/meanders.py +69 -0
- mapFolding/__init__.py +8 -51
- mapFolding/_dataPacking.py +68 -0
- mapFolding/_theSSOT.py +33 -37
- mapFolding/_theTypes.py +21 -4
- mapFolding/algorithms/matrixMeanders.py +86 -517
- mapFolding/algorithms/matrixMeandersBeDry.py +182 -0
- mapFolding/algorithms/matrixMeandersNumPy.py +333 -0
- mapFolding/algorithms/matrixMeandersPandas.py +334 -0
- mapFolding/algorithms/oeisIDbyFormula.py +50 -29
- mapFolding/algorithms/zCuzDocStoopidoeisIDbyFormula.py +51 -29
- mapFolding/basecamp.py +167 -206
- mapFolding/beDRY.py +2 -30
- mapFolding/dataBaskets.py +75 -49
- mapFolding/oeis.py +11 -32
- mapFolding/reference/A000682facts.py +787 -652
- mapFolding/reference/A005316facts.py +961 -3
- mapFolding/reference/matrixMeandersAnalysis/prefixNotationNotes.py +15 -0
- mapFolding/reference/matrixMeandersAnalysis/signatures.py +2030 -0
- mapFolding/reference/meandersDumpingGround/A005316JavaPort.py +1 -1
- mapFolding/reference/meandersDumpingGround/A005316imperative.py +1 -1
- mapFolding/reference/meandersDumpingGround/matrixMeandersNumPyV1finalForm.py +424 -0
- mapFolding/someAssemblyRequired/A007822/A007822rawMaterials.py +3 -4
- mapFolding/someAssemblyRequired/A007822/makeA007822AsynchronousModules.py +103 -29
- mapFolding/someAssemblyRequired/A007822/makeA007822Modules.py +18 -14
- mapFolding/someAssemblyRequired/RecipeJob.py +2 -2
- mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +7 -6
- mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +3 -4
- mapFolding/someAssemblyRequired/makingModules_count.py +88 -87
- mapFolding/someAssemblyRequired/makingModules_doTheNeedful.py +10 -9
- mapFolding/someAssemblyRequired/mapFolding/makeMapFoldingModules.py +3 -3
- mapFolding/someAssemblyRequired/meanders/__init__.py +0 -0
- mapFolding/someAssemblyRequired/meanders/makeMeandersModules.py +63 -0
- mapFolding/someAssemblyRequired/toolkitMakeModules.py +37 -37
- mapFolding/someAssemblyRequired/transformationTools.py +8 -8
- mapFolding/syntheticModules/A007822/algorithm.py +3 -3
- mapFolding/syntheticModules/A007822/algorithmNumba.py +1 -2
- mapFolding/syntheticModules/A007822/asynchronous.py +6 -4
- mapFolding/syntheticModules/A007822/asynchronousAnnex.py +5 -7
- mapFolding/syntheticModules/A007822/asynchronousAnnexNumba.py +70 -0
- mapFolding/syntheticModules/A007822/asynchronousNumba.py +79 -0
- mapFolding/syntheticModules/A007822/asynchronousTheorem2.py +15 -3
- mapFolding/syntheticModules/A007822/asynchronousTrimmed.py +12 -3
- mapFolding/syntheticModules/A007822/initializeState.py +1 -2
- mapFolding/syntheticModules/A007822/theorem2.py +7 -2
- mapFolding/syntheticModules/A007822/theorem2Numba.py +31 -4
- mapFolding/syntheticModules/A007822/theorem2Trimmed.py +8 -3
- mapFolding/syntheticModules/countParallelNumba.py +5 -2
- mapFolding/syntheticModules/dataPacking.py +1 -1
- mapFolding/syntheticModules/dataPackingA007822.py +92 -26
- mapFolding/syntheticModules/meanders/__init__.py +1 -0
- mapFolding/syntheticModules/meanders/bigInt.py +52 -0
- mapFolding/syntheticModules/theorem2.py +6 -0
- mapFolding/syntheticModules/theorem2Numba.py +8 -2
- mapFolding/syntheticModules/theorem2Trimmed.py +6 -0
- mapFolding/tests/conftest.py +28 -13
- mapFolding/tests/test_computations.py +68 -61
- mapFolding/tests/test_oeis.py +6 -6
- mapFolding/zCuzDocStoopid/__init__.py +4 -1
- mapFolding/zCuzDocStoopid/makeDocstrings.py +35 -28
- mapfolding-0.16.2.dist-info/METADATA +99 -0
- mapfolding-0.16.2.dist-info/RECORD +115 -0
- {mapfolding-0.16.0.dist-info → mapfolding-0.16.2.dist-info}/top_level.txt +1 -0
- mapFolding/algorithms/getBucketsTotal.py +0 -137
- mapFolding/reference/matrixMeandersAnalysis/evenEven.py +0 -144
- mapFolding/reference/matrixMeandersAnalysis/oddEven.py +0 -54
- mapFolding/trim_memory.py +0 -62
- mapfolding-0.16.0.dist-info/METADATA +0 -85
- mapfolding-0.16.0.dist-info/RECORD +0 -100
- {mapfolding-0.16.0.dist-info → mapfolding-0.16.2.dist-info}/WHEEL +0 -0
- {mapfolding-0.16.0.dist-info → mapfolding-0.16.2.dist-info}/entry_points.txt +0 -0
- {mapfolding-0.16.0.dist-info → mapfolding-0.16.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
easyRun/A000682.py,sha256=nJJrmVycQUe1H7ms11QGz1ZyYUVdZsjEGtuJk97yxQ0,713
|
|
2
|
+
easyRun/A005316.py,sha256=WCIqsNSevjgUSnTe24d6zWKLZnJSoy14piSt6G26WuE,434
|
|
3
|
+
easyRun/NOTcountingFolds.py,sha256=k9nApcEWdMRSp8P25-bgQ78X4u6tmVR7Rc-22pyG7no,795
|
|
4
|
+
easyRun/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
easyRun/countFolds.py,sha256=piPyd7Z_D9ulvQv7iP2JwS7uam2CbVTIZyF_1a3ZELw,1181
|
|
6
|
+
easyRun/meanders.py,sha256=mka_tZvhQaJeY_nlOe8a0AE86_iI3tkwc7EeZ9uZ0Lg,1826
|
|
7
|
+
mapFolding/__init__.py,sha256=OxFw-BmIomKuRv_YWHAekLJasfFo3LfBxQpS3gHi6K0,1867
|
|
8
|
+
mapFolding/_dataPacking.py,sha256=zNRzXxAeg1a0DjlAB9IWeG82Rq7ALLEUzNfQDgoj2oA,3440
|
|
9
|
+
mapFolding/_theSSOT.py,sha256=n3Y_cEFS385N8MaS5fMYgYSGmDyngOrmWcY8pK58OYo,5244
|
|
10
|
+
mapFolding/_theTypes.py,sha256=_5yMvUDhEOe1bZSYB3IDipOnUNbFg6xENpoKd1h372c,7075
|
|
11
|
+
mapFolding/basecamp.py,sha256=g_33al4s3-wZLq5tdgG5M6HBoN8B5P_9ZAc0z7EM0gg,16749
|
|
12
|
+
mapFolding/beDRY.py,sha256=0vJwnsvz6_jR8gfuU38vW9KoMTnRqyaYaAwbJcKLhFI,12674
|
|
13
|
+
mapFolding/dataBaskets.py,sha256=wgtBYqMjgr9O2tnui59pFiinNqZy5ZtF_WhpbURJpmQ,20154
|
|
14
|
+
mapFolding/filesystemToolkit.py,sha256=Ex5tyugRQurXIgUNVtkQYfWMq8fM4e-izX01MBXU5_8,11006
|
|
15
|
+
mapFolding/oeis.py,sha256=wRKRvDG2mChrwQOMMLuL5xvU0zUYA0PhHbpJynwOKpY,17661
|
|
16
|
+
mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
mapFolding/algorithms/__init__.py,sha256=gARPqfySaeSWMfApQ5wSxzy7ZdgLdKYsLqsRSEYWwWI,28
|
|
18
|
+
mapFolding/algorithms/daoOfMapFolding.py,sha256=ncTIiBfTsM8SNVx9qefZ0bBcBtviWLSk4iPv3Z9nGiE,5442
|
|
19
|
+
mapFolding/algorithms/matrixMeanders.py,sha256=swU6xSo0QhhmA_FxmZhmqvGLJ0h_rS_75jO-SHETWLA,3489
|
|
20
|
+
mapFolding/algorithms/matrixMeandersBeDry.py,sha256=92qk8dSXn2YxtUYhzSFpJpKDRUx6vbfMaRCbJt9baw0,7539
|
|
21
|
+
mapFolding/algorithms/matrixMeandersNumPy.py,sha256=DsMUnB-tsttBm4ib385BaYS2Dnr-KCokKWfK7RjQ780,17147
|
|
22
|
+
mapFolding/algorithms/matrixMeandersPandas.py,sha256=9Pm49HdK0g2MJ15CuZoXOFbdn8JcE0GHzz2p9NB3xvA,13167
|
|
23
|
+
mapFolding/algorithms/oeisIDbyFormula.py,sha256=LLwCxmMY6minSuOWZHu1I9hKKNZP1ihe3ubGeH2uPDk,11762
|
|
24
|
+
mapFolding/algorithms/zCuzDocStoopidoeisIDbyFormula.py,sha256=eGf_gvHUuHAPFFQZd3NIaozY2sQUGse_njtZ8_AyZ-U,2438
|
|
25
|
+
mapFolding/reference/A000682facts.py,sha256=wRg5uy72M-o-cYEF3waCa7NjTUZ3XOoD9dmkTaUiH0o,23510
|
|
26
|
+
mapFolding/reference/A005316facts.py,sha256=Cg2Pqtv3Dnk8IZOqer8Wu3Ie2uwJV_M0Kmr6_QXjKuQ,11768
|
|
27
|
+
mapFolding/reference/__init__.py,sha256=GKcSgYE49NcTISx-JZbELXyq-eRkMeTL5g4DXInWFw0,2206
|
|
28
|
+
mapFolding/reference/flattened.py,sha256=0eHgLFIeIeVUsI5zF5oSy5iWYrjOMzxr7KjDxiTe01k,16078
|
|
29
|
+
mapFolding/reference/hunterNumba.py,sha256=iLfyqwGdAh6c5GbapnKsWhAsNsR3O-fyGGHAdohluLw,7258
|
|
30
|
+
mapFolding/reference/irvineJavaPort.py,sha256=XnsL4g33LRrYwAhcrAVt-ujsP6QD6fbyCsGYzcm9g_k,3724
|
|
31
|
+
mapFolding/reference/jaxCount.py,sha256=t8ons45zyWNJQ-nmn1qbhNsTkTnRzf7ATauaYvIlkRI,14853
|
|
32
|
+
mapFolding/reference/lunnonNumpy.py,sha256=mMgrgbrBpe4nmo72ThEI-MGH0OwEHmfMPczSXHp2qKo,4357
|
|
33
|
+
mapFolding/reference/lunnonWhile.py,sha256=ZL8GAQtPs5nJZSgoDl5USrLSS_zs03y98y1Z9E4jOmQ,3799
|
|
34
|
+
mapFolding/reference/rotatedEntryPoint.py,sha256=3IJU7Hc2PDSE71wmSkDs4Z3t0Px9NBSzmCsVrgQuQyU,10274
|
|
35
|
+
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=yJZAVLVdoXqHag2_N6_6CT-Q6HXBgRro-eny93-Rlpw,9307
|
|
36
|
+
mapFolding/reference/jobsCompleted/__init__.py,sha256=TU93ZGUW1xEkT6d9mQFn_rp5DvRy0ZslEB2Q6MF5ZDc,2596
|
|
37
|
+
mapFolding/reference/jobsCompleted/[2x19]/p2x19.py,sha256=_tvYtfzMWVo2VtUbIAieoscb4N8FFflgTdW4-ljBUuA,19626
|
|
38
|
+
mapFolding/reference/jobsCompleted/p2x19/p2x19.py,sha256=eZEw4Me4ocTt6VXoK2-Sbd5SowZtxRIbN9dZmc7OCVg,6395
|
|
39
|
+
mapFolding/reference/matrixMeandersAnalysis/__init__.py,sha256=FQbR63_z3_zd3HMrpUxx3_YIcn9znzA0RIggcMntSC8,35
|
|
40
|
+
mapFolding/reference/matrixMeandersAnalysis/prefixNotationNotes.py,sha256=R9MUdS0vLEyaVdCio2AAfxEpBz6FDp7cZotEE47nFdU,1001
|
|
41
|
+
mapFolding/reference/matrixMeandersAnalysis/signatures.py,sha256=nmZ88_MW-DirFlwpsbGvC1y7OxVlSKvDX4J0Hecd6zk,20472
|
|
42
|
+
mapFolding/reference/meandersDumpingGround/A005316JavaPort.py,sha256=syMHicfioP-0GrOq7GnEpuAFSNvRwnbGim0mqV862sA,4885
|
|
43
|
+
mapFolding/reference/meandersDumpingGround/A005316imperative.py,sha256=UEbXPkORngVo0UrwS81SY2gwz1XWAaMZ0rgA7HMiVYk,3793
|
|
44
|
+
mapFolding/reference/meandersDumpingGround/A005316intOptimized.py,sha256=oO9ktdYeFwtosVp5KliwH8JmCSxfjapjBM1iMECuDAc,4121
|
|
45
|
+
mapFolding/reference/meandersDumpingGround/A005316optimized128bit.py,sha256=6JxmVBIQnN0rH0MQIZtu_wgY1Wbms8hZCWarMe5NLLU,3416
|
|
46
|
+
mapFolding/reference/meandersDumpingGround/A005316primitiveOptimized.py,sha256=iFig6Edv1E774xrlVUFLyscC40DqDhV-oh4hOnG2DLI,4116
|
|
47
|
+
mapFolding/reference/meandersDumpingGround/A005316redis.py,sha256=MPeiobrs3VsNZOOKYBg52oVp0OjVDzLEdsRKfrZ9LrU,4328
|
|
48
|
+
mapFolding/reference/meandersDumpingGround/A005316write2disk.py,sha256=NMVrdhe5KhnXQfaQ5Xr7Pwl5oXYEOM1DrMISDDOCVVw,5633
|
|
49
|
+
mapFolding/reference/meandersDumpingGround/matrixMeanders64retired.py,sha256=oRVgf6zkWRjk7dWR-Px41M_5spdvKy_Pich0qd7oxVA,9270
|
|
50
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersBaseline.py,sha256=8Z98MMfhTCdoa75HWZz4DO166EiHZCu5eHeFzhgK42s,3003
|
|
51
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineAnnex.py,sha256=d2Oh4JZxz53ox_ArhIxpMTOuA7rtE9wnEPojpFcnlfc,5817
|
|
52
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineV2.py,sha256=VpRiIGhnk-DbxwsHwCeCwXqcKLSNyHl-iRGLDH9ZGMY,7674
|
|
53
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersNumPyV1finalForm.py,sha256=G4358jHFr7hdOa709c8nYdR3eMMZjUqcxbS-L2aAOqw,24428
|
|
54
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersSimpleQueue.py,sha256=pOfaS315OKIBG9GSqSJwUDcEhfnV2XduM9IPqHrBvJg,4083
|
|
55
|
+
mapFolding/reference/meandersDumpingGround/matrixMeandersSlicePop.py,sha256=XyiesSQAH1dRplYx_CdR1FzcXvgmmxzj27V4aIqPp7o,5353
|
|
56
|
+
mapFolding/someAssemblyRequired/RecipeJob.py,sha256=9gLalEg3HeJb-HOUy38Uwm7oO-DdRX6q1Q2S58e4FKI,9899
|
|
57
|
+
mapFolding/someAssemblyRequired/__init__.py,sha256=3IF8HFIgFisJBQ1i4sx7Nz2iOqVoAG78jwjNJ9q531U,6272
|
|
58
|
+
mapFolding/someAssemblyRequired/_toolIfThis.py,sha256=QC2cmCea18BZ_WpoWoErYCWhROvmd40_i_nBO7YFRaE,6378
|
|
59
|
+
mapFolding/someAssemblyRequired/_toolkitContainers.py,sha256=RJThCzIBWSk-dUO75QhRJgaJk6xz5Pf4-LBN1wv7hxo,13545
|
|
60
|
+
mapFolding/someAssemblyRequired/getLLVMforNoReason.py,sha256=tY0-2K0BFkwLAAjSrFJLPoG8CevDHOFc3OH3TxXANzg,2806
|
|
61
|
+
mapFolding/someAssemblyRequired/infoBooth.py,sha256=ZWFH37S2jMGRbNlmjhNvoaezIk8abS3DvHhy7qVOaQM,2139
|
|
62
|
+
mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py,sha256=Zj0oCfx-puGcmSmilrVXC2rMKLfWx85yfsm3qTpqNSw,17274
|
|
63
|
+
mapFolding/someAssemblyRequired/makeJobTheorem2codon.py,sha256=J8QJXijA39wu87YsB-WaPj0eYTRkE17SnWVd_FrUgf8,11542
|
|
64
|
+
mapFolding/someAssemblyRequired/makingModules_count.py,sha256=AZpKfkXVXd2uk59OuxZWXNiy5NGeDwTJRHK0bvEuv-g,15158
|
|
65
|
+
mapFolding/someAssemblyRequired/makingModules_doTheNeedful.py,sha256=ppv94hTqUoJbHKT3TRXr5LI8lBV5EJSylzz9_9OD3fw,6452
|
|
66
|
+
mapFolding/someAssemblyRequired/toolkitMakeModules.py,sha256=jxoDetQXL9zXXcAuTzdiYgvoB95ksSx7ZdsgKqsKMnM,7967
|
|
67
|
+
mapFolding/someAssemblyRequired/toolkitNumba.py,sha256=3ujtBaA27CX8yVApnfNRzFpZd3GvsHv1H1vyTiiJIZk,14905
|
|
68
|
+
mapFolding/someAssemblyRequired/transformationTools.py,sha256=ElTZFcobLvT-dplODTGt7NX8oLke2xvEVg3hTCNoHgs,11561
|
|
69
|
+
mapFolding/someAssemblyRequired/A007822/A007822rawMaterials.py,sha256=lg-h91FgAZ3v4LfgpP5RyPByW17eiorJt4fC435b_B0,2989
|
|
70
|
+
mapFolding/someAssemblyRequired/A007822/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
+
mapFolding/someAssemblyRequired/A007822/makeA007822AsynchronousModules.py,sha256=urXQOME95x_p5DnWUl0z-8Kq60QzyCXIdSnxpp-klS0,12629
|
|
72
|
+
mapFolding/someAssemblyRequired/A007822/makeA007822Modules.py,sha256=kHxVW4n92fRPX_4U4XMcjZCKad_PwxS2IRX2QVIFxDQ,4330
|
|
73
|
+
mapFolding/someAssemblyRequired/mapFolding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
+
mapFolding/someAssemblyRequired/mapFolding/makeMapFoldingModules.py,sha256=YvSzypYv4KER_ue1wWGtQ4WtSpkrPhkT0SJmji4J1qg,16743
|
|
75
|
+
mapFolding/someAssemblyRequired/meanders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
+
mapFolding/someAssemblyRequired/meanders/makeMeandersModules.py,sha256=GR4HAB07gXU9nLoXcYd5TfxKeVEjIlrD-ZOo3Mek45o,3309
|
|
77
|
+
mapFolding/syntheticModules/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
|
|
78
|
+
mapFolding/syntheticModules/countParallelNumba.py,sha256=nhB3Z9Jl4NffJrXCAl4_EHp-ERqP0KoWFeToKlBwB7A,7877
|
|
79
|
+
mapFolding/syntheticModules/daoOfMapFoldingNumba.py,sha256=5oMb8pttNKslN6wss9JIQXSnmjgE2q_2-3fIrh1pEW0,6033
|
|
80
|
+
mapFolding/syntheticModules/dataPacking.py,sha256=lGWAeE-R1nh9ZBVhGkGLWrma6RWIXIWmaV-ZOV2WJ-8,2429
|
|
81
|
+
mapFolding/syntheticModules/dataPackingA007822.py,sha256=Jxk3sQKRye65qfsWur2l--afzQPyG_4I86eYJKPWauI,6244
|
|
82
|
+
mapFolding/syntheticModules/initializeState.py,sha256=OTiVi1Ywnlwk8tbwSIFjPJa_yBCINoapaCzGXDAJq_k,3121
|
|
83
|
+
mapFolding/syntheticModules/theorem2.py,sha256=sqo8AA7CqvejAEuNqo5KIx7shjCQsuh8l8ThJot5RPA,3262
|
|
84
|
+
mapFolding/syntheticModules/theorem2Numba.py,sha256=m7xRzaAXTAAYMRo1rW3KR5G1ghvVcTMGe-scJXHm1XA,3758
|
|
85
|
+
mapFolding/syntheticModules/theorem2Trimmed.py,sha256=sJ228Qxd9dAxM7GTegFC5algm8uI-Y17NSaaID4ELq8,2933
|
|
86
|
+
mapFolding/syntheticModules/A007822/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
|
|
87
|
+
mapFolding/syntheticModules/A007822/algorithm.py,sha256=y0MAGfaO1-4V5iaBTSaLDenUAkv8spRLjLxBChxqgYM,7058
|
|
88
|
+
mapFolding/syntheticModules/A007822/algorithmNumba.py,sha256=ZpaDVxT8bsGiItn34kmIwXj-yrhdi4KQE8Mu4ZTaYnM,7192
|
|
89
|
+
mapFolding/syntheticModules/A007822/asynchronous.py,sha256=Vy9OOvlIUrCqMsAPZs5JMviMqW4T-E6kRWX2a_cu-ho,6315
|
|
90
|
+
mapFolding/syntheticModules/A007822/asynchronousAnnex.py,sha256=vyJcmo_eIS8s9e4sfE8eFnbR2HgExQ4Q5KNPzTKBooU,2629
|
|
91
|
+
mapFolding/syntheticModules/A007822/asynchronousAnnexNumba.py,sha256=BD5XWR31xdPMV1AN6BUDhacEPuOjjktwT3nMVVYgvZA,2474
|
|
92
|
+
mapFolding/syntheticModules/A007822/asynchronousNumba.py,sha256=rYSyYZ-4bZieUw1dL-mfdvnowLGVXbYiuN7CMmbv3hY,6116
|
|
93
|
+
mapFolding/syntheticModules/A007822/asynchronousTheorem2.py,sha256=6GYBuNdykHkyeNN9oiuntQqTyzNZcWJSLm4boyfU0cU,3685
|
|
94
|
+
mapFolding/syntheticModules/A007822/asynchronousTrimmed.py,sha256=C6QOKe4wDdl_mfjnosOSj64eOTkzQYDUWdL3O575Nq8,3339
|
|
95
|
+
mapFolding/syntheticModules/A007822/initializeState.py,sha256=YzI2D1PoPsESF-JarzYx3xlTzdrc0YSUJ2nKIIZRfnY,4314
|
|
96
|
+
mapFolding/syntheticModules/A007822/theorem2.py,sha256=jJjGseP29kDbRpqiDPryh1FSU0rHEE-WRvtcEWyGBWM,4463
|
|
97
|
+
mapFolding/syntheticModules/A007822/theorem2Numba.py,sha256=QhH1GHZRBZFTghhPn4F_9_J79Ufc2Kj3Nsd6q6g0RHA,7002
|
|
98
|
+
mapFolding/syntheticModules/A007822/theorem2Trimmed.py,sha256=KmZhvkTHqx2YlxkkYZGGXZMg5HdiJA9bXexgJOqugiY,4132
|
|
99
|
+
mapFolding/syntheticModules/meanders/__init__.py,sha256=evVFqhCGa-WZKDiLcnQWjs-Bj34eRnfSLqz_d7dFYZY,83
|
|
100
|
+
mapFolding/syntheticModules/meanders/bigInt.py,sha256=RP_mwMFvmOgvrnladm6sY5Cb1OPTS2XREjA4zucFqzc,2932
|
|
101
|
+
mapFolding/tests/__init__.py,sha256=QVCHSMFVvTxV3mAyYOLkMFAFyBJ514zdoVnDmpBJnTo,1336
|
|
102
|
+
mapFolding/tests/conftest.py,sha256=5vV_Vy5ZrV3uoP9bQ8B-Kqc0zMrL7KAhsPJwchMDb6w,15700
|
|
103
|
+
mapFolding/tests/test_computations.py,sha256=0RDfA2FSBIV-wMaE5CGjc2fJ4gGfSTBQM9u3SAz7FIg,8656
|
|
104
|
+
mapFolding/tests/test_filesystem.py,sha256=0rYQ62f4e3HOoymXrxDWbqNEBJQ7DGN8RUOMI84tE2Q,3892
|
|
105
|
+
mapFolding/tests/test_oeis.py,sha256=M4Fb0e4_h9QTX9Oy6l5-M1UQfNqeonoGVOn0DJI9huE,4854
|
|
106
|
+
mapFolding/tests/test_other.py,sha256=ScBiJ78LnyAaW-RhxcouX6Xw10wgpSdqfvT4LO3WjnQ,4766
|
|
107
|
+
mapFolding/tests/test_tasks.py,sha256=_pr9JRWjjNKA7sww70XvkJJdGPruBVzubM63RmD_Du0,4013
|
|
108
|
+
mapFolding/zCuzDocStoopid/__init__.py,sha256=uKcGXsaYKH9kQUGHjaY0EtWtU6qybb9Fs09ZYKEFMNs,236
|
|
109
|
+
mapFolding/zCuzDocStoopid/makeDocstrings.py,sha256=cQl-B-RlAkFijATUTWfKCael46foH-ZsOp1EHoYxoGs,3212
|
|
110
|
+
mapfolding-0.16.2.dist-info/licenses/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
111
|
+
mapfolding-0.16.2.dist-info/METADATA,sha256=ZU8DJZ5s9nTi3OYvTAc-IRY2BkcaDLkvFtmshYSL9hY,7570
|
|
112
|
+
mapfolding-0.16.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
113
|
+
mapfolding-0.16.2.dist-info/entry_points.txt,sha256=-mH9DjW9tDRMPaeoSWKKywG35cR28m12H_jtmrB4eY8,98
|
|
114
|
+
mapfolding-0.16.2.dist-info/top_level.txt,sha256=jNj7ccwEy_9uqs0hsQCO_rPXgaGn8-IMqXePQN6nZTY,19
|
|
115
|
+
mapfolding-0.16.2.dist-info/RECORD,,
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"""Buckets."""
|
|
2
|
-
from mapFolding import MatrixMeandersState
|
|
3
|
-
from mapFolding.reference.A005316facts import bucketsIf_k_EVEN_by_nLess_k, bucketsIf_k_ODD_by_nLess_k
|
|
4
|
-
from math import exp, log
|
|
5
|
-
from typing import NamedTuple
|
|
6
|
-
import math
|
|
7
|
-
|
|
8
|
-
class ImaKey(NamedTuple):
|
|
9
|
-
"""keys for dictionaries."""
|
|
10
|
-
|
|
11
|
-
oeisID: str
|
|
12
|
-
kIsOdd: bool
|
|
13
|
-
nLess_kIsOdd: bool
|
|
14
|
-
|
|
15
|
-
def getBucketsTotal(state: MatrixMeandersState, safetyMultiplicand: float = 1.2) -> int:
|
|
16
|
-
"""Estimate the total number of non-unique curveLocations that will be computed from the existing curveLocations.
|
|
17
|
-
|
|
18
|
-
Notes
|
|
19
|
-
-----
|
|
20
|
-
Subexponential bucketsTotal unified estimator parameters (derived in reference notebook).
|
|
21
|
-
|
|
22
|
-
The model is: log(buckets) = intercept + bN*log(n) + bK*log(k) + bD*log(n-k) + g_r*(k/n) + g_r2*(k/n)^2 + g_s*((n-k)/n) + offset(subseries)
|
|
23
|
-
Subseries key: f"{oeisID}_kOdd={int(kIsOdd)}_dOdd={int(nLess_kIsOdd)}" with a reference subseries offset of zero.
|
|
24
|
-
These coefficients intentionally remain in-source (SSOT) to avoid runtime JSON parsing overhead and to support reproducibility.
|
|
25
|
-
"""
|
|
26
|
-
dictionaryExponentialCoefficients: dict[ImaKey, float] = {
|
|
27
|
-
(ImaKey(oeisID='', kIsOdd=False, nLess_kIsOdd=True)): 0.834,
|
|
28
|
-
(ImaKey(oeisID='', kIsOdd=False, nLess_kIsOdd=False)): 1.5803,
|
|
29
|
-
(ImaKey(oeisID='', kIsOdd=True, nLess_kIsOdd=True)): 1.556,
|
|
30
|
-
(ImaKey(oeisID='', kIsOdd=True, nLess_kIsOdd=False)): 1.8047,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
logarithmicOffsets: dict[ImaKey, float] ={
|
|
34
|
-
(ImaKey('A000682', kIsOdd=False, nLess_kIsOdd=False)): 0.0,
|
|
35
|
-
(ImaKey('A000682', kIsOdd=False, nLess_kIsOdd=True)): -0.07302547148212568,
|
|
36
|
-
(ImaKey('A000682', kIsOdd=True, nLess_kIsOdd=False)): -0.00595307513938792,
|
|
37
|
-
(ImaKey('A000682', kIsOdd=True, nLess_kIsOdd=True)): -0.012201222865243722,
|
|
38
|
-
(ImaKey('A005316', kIsOdd=False, nLess_kIsOdd=False)): -0.6392728422078733,
|
|
39
|
-
(ImaKey('A005316', kIsOdd=False, nLess_kIsOdd=True)): -0.6904925299923548,
|
|
40
|
-
(ImaKey('A005316', kIsOdd=True, nLess_kIsOdd=False)): 0.0,
|
|
41
|
-
(ImaKey('A005316', kIsOdd=True, nLess_kIsOdd=True)): 0.0,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
logarithmicParameters: dict[str, float] = {
|
|
45
|
-
'intercept': -166.1750299793178,
|
|
46
|
-
'log(n)': 1259.0051001675547,
|
|
47
|
-
'log(k)': -396.4306071056408,
|
|
48
|
-
'log(nLess_k)': -854.3309503739766,
|
|
49
|
-
'k/n': 716.530410654819,
|
|
50
|
-
'(k/n)^2': -2527.035113444166,
|
|
51
|
-
'normalized k': -882.7054406339189,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
bucketsTotalMaximumBy_kOfMatrix: dict[int, int] = {1:3, 2:12, 3:40, 4:125, 5:392, 6:1254, 7:4087, 8:13623, 9:46181, 10:159137, 11:555469, 12:1961369, 13:6991893, 14:25134208}
|
|
55
|
-
|
|
56
|
-
xCommon = 1.57
|
|
57
|
-
|
|
58
|
-
nLess_k: int = state.n - state.kOfMatrix
|
|
59
|
-
kIsOdd: bool = bool(state.kOfMatrix & 1)
|
|
60
|
-
nLess_kIsOdd: bool = bool(nLess_k & 1)
|
|
61
|
-
kIsEven: bool = not kIsOdd
|
|
62
|
-
bucketsTotal: int = -8
|
|
63
|
-
|
|
64
|
-
"""NOTE temporary notes
|
|
65
|
-
I have a fault in my thinking. bucketsTotal increases as k decreases until ~0.4k, then bucketsTotal decreases rapidly to 1. I
|
|
66
|
-
have ignored the decreasing side. In the formulas for estimation, I didn't differentiate between increasing and decreasing.
|
|
67
|
-
So, I probably need to refine the formulas. I guess I need to add checks to the if/else monster, too.
|
|
68
|
-
|
|
69
|
-
While buckets is increasing:
|
|
70
|
-
3 types of estimates:
|
|
71
|
-
1. Exponential growth.
|
|
72
|
-
2. Logarithmic growth.
|
|
73
|
-
3. Hard ceiling.
|
|
74
|
-
While buckets is decreasing:
|
|
75
|
-
1. Hard ceiling, same as increasing side.
|
|
76
|
-
2. ???
|
|
77
|
-
3. buckets = 1.
|
|
78
|
-
|
|
79
|
-
The formula for exponential growth _never_ underestimates. I haven't measured by how much it overestimates.
|
|
80
|
-
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
bucketsTotalAtMaximum: bool = state.kOfMatrix <= ((state.n - 1 - (state.kOfMatrix % 2)) // 3)
|
|
84
|
-
bucketsTotalGrowsExponentially: bool = state.kOfMatrix > nLess_k
|
|
85
|
-
bucketsTotalGrowsLogarithmically: bool = state.kOfMatrix > ((state.n - (state.n % 3)) // 3)
|
|
86
|
-
|
|
87
|
-
if bucketsTotalAtMaximum:
|
|
88
|
-
if state.kOfMatrix in bucketsTotalMaximumBy_kOfMatrix:
|
|
89
|
-
bucketsTotal = bucketsTotalMaximumBy_kOfMatrix[state.kOfMatrix]
|
|
90
|
-
else:
|
|
91
|
-
c = 0.95037
|
|
92
|
-
r = 3.3591258254
|
|
93
|
-
if kIsOdd:
|
|
94
|
-
c = 0.92444
|
|
95
|
-
r = 3.35776
|
|
96
|
-
bucketsTotal = int(c * r**state.kOfMatrix * safetyMultiplicand)
|
|
97
|
-
|
|
98
|
-
elif bucketsTotalGrowsExponentially:
|
|
99
|
-
if (state.oeisID == 'A005316') and kIsOdd and (nLess_k in bucketsIf_k_ODD_by_nLess_k):
|
|
100
|
-
# If I already know bucketsTotal.
|
|
101
|
-
bucketsTotal = bucketsIf_k_ODD_by_nLess_k[nLess_k]
|
|
102
|
-
elif (state.oeisID == 'A005316') and kIsEven and (nLess_k in bucketsIf_k_EVEN_by_nLess_k):
|
|
103
|
-
# If I already know bucketsTotal.
|
|
104
|
-
bucketsTotal = bucketsIf_k_EVEN_by_nLess_k[nLess_k]
|
|
105
|
-
else: # I estimate bucketsTotal during exponential growth.
|
|
106
|
-
xInstant: int = math.ceil(nLess_k / 2)
|
|
107
|
-
A000682adjustStartingCurveLocations: float = 0.25
|
|
108
|
-
startingConditionsCoefficient: float = dictionaryExponentialCoefficients[ImaKey('', kIsOdd, nLess_kIsOdd)]
|
|
109
|
-
if kIsOdd and nLess_kIsOdd:
|
|
110
|
-
A000682adjustStartingCurveLocations = 0.0
|
|
111
|
-
if state.oeisID == 'A000682': # NOTE Net effect is between `*= n` and `*= n * 2.2` if n=46.
|
|
112
|
-
startingConditionsCoefficient *= state.n * (((state.n // 2) + 2) ** A000682adjustStartingCurveLocations)
|
|
113
|
-
bucketsTotal = int(startingConditionsCoefficient * math.exp(xCommon * xInstant))
|
|
114
|
-
|
|
115
|
-
elif state.kOfMatrix <= max(bucketsTotalMaximumBy_kOfMatrix.keys()):
|
|
116
|
-
# If `kOfMatrix` is low, use maximum bucketsTotal. 1. Can't underestimate. 2. Skip computation that can underestimate.
|
|
117
|
-
# 3. The potential difference in memory use is relatively small.
|
|
118
|
-
bucketsTotal = bucketsTotalMaximumBy_kOfMatrix[state.kOfMatrix]
|
|
119
|
-
|
|
120
|
-
elif bucketsTotalGrowsLogarithmically:
|
|
121
|
-
xPower: float = (0
|
|
122
|
-
+ logarithmicParameters['intercept']
|
|
123
|
-
+ logarithmicParameters['log(n)'] * log(state.n)
|
|
124
|
-
+ logarithmicParameters['log(k)'] * log(state.kOfMatrix)
|
|
125
|
-
+ logarithmicParameters['log(nLess_k)'] * log(nLess_k)
|
|
126
|
-
+ logarithmicParameters['k/n'] * (state.kOfMatrix / state.n)
|
|
127
|
-
+ logarithmicParameters['(k/n)^2'] * (state.kOfMatrix / state.n)**2
|
|
128
|
-
+ logarithmicParameters['normalized k'] * nLess_k / state.n
|
|
129
|
-
+ logarithmicOffsets[ImaKey(state.oeisID, kIsOdd, nLess_kIsOdd)]
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
bucketsTotal = int(exp(xPower * safetyMultiplicand))
|
|
133
|
-
|
|
134
|
-
else:
|
|
135
|
-
message = "I shouldn't be here."
|
|
136
|
-
raise SystemError(message)
|
|
137
|
-
return bucketsTotal
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Matrix Meanders Buckets Estimation Formula.
|
|
3
|
-
|
|
4
|
-
This module provides a function to estimate the number of buckets in matrix meanders
|
|
5
|
-
analysis based on parameters n and k. The formula was derived through regression
|
|
6
|
-
analysis on empirical data and achieves an R² score of 0.9978.
|
|
7
|
-
|
|
8
|
-
Author: Generated from Jupyter notebook analysis
|
|
9
|
-
Date: September 2025
|
|
10
|
-
"""
|
|
11
|
-
import math
|
|
12
|
-
|
|
13
|
-
def estimateBucketsFromParametersNandK(parameterN: int, parameterK: int) -> float:
|
|
14
|
-
"""
|
|
15
|
-
Estimate the number of buckets in matrix meanders analysis based on parameters n and k.
|
|
16
|
-
|
|
17
|
-
This function implements a log-polynomial regression model derived from empirical data analysis
|
|
18
|
-
of matrix meanders with even-even configurations. The model was trained on 34 data points
|
|
19
|
-
and achieved an R² score of 0.9978, indicating excellent predictive performance.
|
|
20
|
-
|
|
21
|
-
The underlying formula is:
|
|
22
|
-
buckets = exp(0.087760 + 0.447340*n - 0.058715*k - 0.014116*n² + 0.072333*n*k - 0.090631*k²) - 1
|
|
23
|
-
|
|
24
|
-
Parameters
|
|
25
|
-
----------
|
|
26
|
-
parameterN : int
|
|
27
|
-
The n parameter (must be positive integer, typically even)
|
|
28
|
-
parameterK : int
|
|
29
|
-
The k parameter (must be positive integer, typically even)
|
|
30
|
-
|
|
31
|
-
Returns
|
|
32
|
-
-------
|
|
33
|
-
float
|
|
34
|
-
Estimated number of buckets
|
|
35
|
-
|
|
36
|
-
Raises
|
|
37
|
-
------
|
|
38
|
-
ValueError
|
|
39
|
-
If parameterN or parameterK are not positive integers
|
|
40
|
-
|
|
41
|
-
Example:
|
|
42
|
-
--------
|
|
43
|
-
>>> estimateBucketsFromParametersNandK(20, 10)
|
|
44
|
-
3656.4
|
|
45
|
-
>>> estimateBucketsFromParametersNandK(44, 22)
|
|
46
|
-
32715318.1
|
|
47
|
-
|
|
48
|
-
Notes
|
|
49
|
-
-----
|
|
50
|
-
This formula is based on empirical data and is most accurate for values
|
|
51
|
-
within the training range (n: 4-44, k: 2-22). Extrapolation beyond this
|
|
52
|
-
range should be done with caution.
|
|
53
|
-
|
|
54
|
-
The underlying mathematical relationship shows that buckets grow exponentially
|
|
55
|
-
with both n and k, with complex polynomial interactions captured in the logarithmic space.
|
|
56
|
-
|
|
57
|
-
Performance Metrics:
|
|
58
|
-
- R² Score: 0.9978
|
|
59
|
-
- Mean Absolute Error: 4.02% across all training examples
|
|
60
|
-
- Median Error: 2.69%
|
|
61
|
-
- Maximum Error: 18.86% (on smallest values)
|
|
62
|
-
"""
|
|
63
|
-
# Input validation
|
|
64
|
-
if not isinstance(parameterN, int) or parameterN <= 0:
|
|
65
|
-
raise ValueError(f"parameterN must be a positive integer, got {parameterN}")
|
|
66
|
-
if not isinstance(parameterK, int) or parameterK <= 0:
|
|
67
|
-
raise ValueError(f"parameterK must be a positive integer, got {parameterK}")
|
|
68
|
-
|
|
69
|
-
# Convert to float for calculations
|
|
70
|
-
n = float(parameterN)
|
|
71
|
-
k = float(parameterK)
|
|
72
|
-
|
|
73
|
-
# Log-polynomial formula coefficients (derived from regression analysis)
|
|
74
|
-
# Formula: log(buckets + 1) = intercept + c1*n + c2*k + c3*n² + c4*n*k + c5*k²
|
|
75
|
-
interceptValue = 0.087760
|
|
76
|
-
coefficientN = 0.447340
|
|
77
|
-
coefficientK = -0.058715
|
|
78
|
-
coefficientNSquared = -0.014116
|
|
79
|
-
coefficientNTimesK = 0.072333
|
|
80
|
-
coefficientKSquared = -0.090631
|
|
81
|
-
|
|
82
|
-
# Calculate log(buckets + 1)
|
|
83
|
-
logBucketsPlusOne = (interceptValue +
|
|
84
|
-
coefficientN * n +
|
|
85
|
-
coefficientK * k +
|
|
86
|
-
coefficientNSquared * (n * n) +
|
|
87
|
-
coefficientNTimesK * (n * k) +
|
|
88
|
-
coefficientKSquared * (k * k))
|
|
89
|
-
|
|
90
|
-
# Transform back to original scale: buckets = exp(log(buckets + 1)) - 1
|
|
91
|
-
estimatedBuckets = math.exp(logBucketsPlusOne) - 1.0
|
|
92
|
-
|
|
93
|
-
return max(0.0, estimatedBuckets) # Ensure non-negative result
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def validateFormulaAccuracy() -> None:
|
|
97
|
-
"""
|
|
98
|
-
Validate the formula against known test cases from the training data.
|
|
99
|
-
|
|
100
|
-
This function demonstrates the accuracy of the formula by testing it
|
|
101
|
-
against several known data points from the original dataset.
|
|
102
|
-
"""
|
|
103
|
-
# Test cases from the original dataset (n, k, expected_buckets)
|
|
104
|
-
testCases = [
|
|
105
|
-
(4, 2, 4),
|
|
106
|
-
(20, 10, 3592),
|
|
107
|
-
(36, 18, 1666843),
|
|
108
|
-
(44, 22, 35674291)
|
|
109
|
-
]
|
|
110
|
-
|
|
111
|
-
print("Formula Validation Results:")
|
|
112
|
-
print("-" * 50)
|
|
113
|
-
print(f"{'n':<4} {'k':<4} {'Expected':<12} {'Predicted':<12} {'Error %':<8}")
|
|
114
|
-
print("-" * 50)
|
|
115
|
-
|
|
116
|
-
totalError = 0.0
|
|
117
|
-
for n, k, expected in testCases:
|
|
118
|
-
predicted = estimateBucketsFromParametersNandK(n, k)
|
|
119
|
-
error = abs((expected - predicted) / expected) * 100
|
|
120
|
-
totalError += error
|
|
121
|
-
|
|
122
|
-
# Format large numbers appropriately
|
|
123
|
-
expectedStr = f"{expected:.0f}" if expected < 1e6 else f"{expected:.2e}"
|
|
124
|
-
predictedStr = f"{predicted:.1f}" if predicted < 1e6 else f"{predicted:.2e}"
|
|
125
|
-
|
|
126
|
-
print(f"{n:<4} {k:<4} {expectedStr:<12} {predictedStr:<12} {error:<8.1f}")
|
|
127
|
-
|
|
128
|
-
avgError = totalError / len(testCases)
|
|
129
|
-
print("-" * 50)
|
|
130
|
-
print(f"Average Error: {avgError:.2f}%")
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if __name__ == "__main__":
|
|
134
|
-
# Run validation when script is executed directly
|
|
135
|
-
validateFormulaAccuracy()
|
|
136
|
-
|
|
137
|
-
# Demonstrate usage
|
|
138
|
-
print("\nUsage Examples:")
|
|
139
|
-
print("-" * 30)
|
|
140
|
-
|
|
141
|
-
examples = [(8, 4), (20, 10), (36, 18)]
|
|
142
|
-
for n, k in examples:
|
|
143
|
-
result = estimateBucketsFromParametersNandK(n, k)
|
|
144
|
-
print(f"estimateBucketsFromParametersNandK({n}, {k}) = {result:.1f}")
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from math import exp as math_exp, log as math_log
|
|
2
|
-
|
|
3
|
-
def estimateBuckets(n: int, k: int) -> float:
|
|
4
|
-
"""Estimate the number of buckets for given integers n and k.
|
|
5
|
-
|
|
6
|
-
Model form (log-space):
|
|
7
|
-
log(estimate) = a
|
|
8
|
-
+ b * log(n)
|
|
9
|
-
+ c * log(k)
|
|
10
|
-
+ d * log(n)*log(k)
|
|
11
|
-
+ e * (k / n)
|
|
12
|
-
+ f * (n / k)
|
|
13
|
-
|
|
14
|
-
Coefficients were obtained via ordinary least squares fit on log(buckets)
|
|
15
|
-
using the dataset in df_oddEven.csv (38 observations). The regression achieved
|
|
16
|
-
R^2 ≈ {coefficient_determination:.5f} (log space) with MAPE ≈ {mean_absolute_percentage_error:.2f}% on training data.
|
|
17
|
-
|
|
18
|
-
NOTE: This is an empirical approximation; extrapolation outside the range
|
|
19
|
-
n ∈ [{min(n_values)}, {max(n_values)}], k ∈ [{min(k_values)}, {max(k_values)}] may be unreliable.
|
|
20
|
-
|
|
21
|
-
Parameters
|
|
22
|
-
----------
|
|
23
|
-
n : int
|
|
24
|
-
Primary size parameter (must be > 0)
|
|
25
|
-
k : int
|
|
26
|
-
Secondary size parameter (must be > 0)
|
|
27
|
-
|
|
28
|
-
Returns
|
|
29
|
-
-------
|
|
30
|
-
float
|
|
31
|
-
Estimated bucket count (positive real number). Caller may round if an
|
|
32
|
-
integer is desired.
|
|
33
|
-
"""
|
|
34
|
-
if not isinstance(n, int) or n <= 0:
|
|
35
|
-
raise ValueError(f'allegedInt n must be positive int, got {n!r}')
|
|
36
|
-
if not isinstance(k, int) or k <= 0:
|
|
37
|
-
raise ValueError(f'allegedInt k must be positive int, got {k!r}')
|
|
38
|
-
|
|
39
|
-
a = -679.088264366881
|
|
40
|
-
b = 864.829109159972
|
|
41
|
-
c = -873.871846814867
|
|
42
|
-
d = 3.487829177620
|
|
43
|
-
e = 943.512567960048
|
|
44
|
-
f = -193.640628682536
|
|
45
|
-
|
|
46
|
-
ln_n = math_log(n)
|
|
47
|
-
ln_k = math_log(k)
|
|
48
|
-
value_log = (a
|
|
49
|
-
+ b * ln_n
|
|
50
|
-
+ c * ln_k
|
|
51
|
-
+ d * ln_n * ln_k
|
|
52
|
-
+ e * (k / n)
|
|
53
|
-
+ f * (n / k))
|
|
54
|
-
return math_exp(value_log)
|
mapFolding/trim_memory.py
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"""Memory management utilities.
|
|
2
|
-
|
|
3
|
-
https://github.com/pandas-dev/pandas/issues/2659#issuecomment-2452943964
|
|
4
|
-
"""
|
|
5
|
-
import ctypes
|
|
6
|
-
import ctypes.wintypes
|
|
7
|
-
import gc
|
|
8
|
-
import logging
|
|
9
|
-
import platform
|
|
10
|
-
|
|
11
|
-
logger = logging.getLogger(__name__)
|
|
12
|
-
|
|
13
|
-
def trim_windows_process_memory(pid: int | None = None) -> bool:
|
|
14
|
-
"""Cause effects similar to malloc_trim on -nix."""
|
|
15
|
-
# Define SIZE_T based on the platform (32-bit or 64-bit)
|
|
16
|
-
if ctypes.sizeof(ctypes.c_void_p) == 4:
|
|
17
|
-
SIZE_T = ctypes.c_uint32
|
|
18
|
-
else:
|
|
19
|
-
SIZE_T = ctypes.c_uint64
|
|
20
|
-
|
|
21
|
-
# Get a handle to the current process
|
|
22
|
-
if not pid:
|
|
23
|
-
pid = ctypes.windll.kernel32.GetCurrentProcess()
|
|
24
|
-
|
|
25
|
-
# Define argument and return types for SetProcessWorkingSetSizeEx
|
|
26
|
-
ctypes.windll.kernel32.SetProcessWorkingSetSizeEx.argtypes = [
|
|
27
|
-
ctypes.wintypes.HANDLE, # Process handle
|
|
28
|
-
SIZE_T, # Minimum working set size
|
|
29
|
-
SIZE_T, # Maximum working set size
|
|
30
|
-
ctypes.wintypes.DWORD, # Flags
|
|
31
|
-
]
|
|
32
|
-
ctypes.windll.kernel32.SetProcessWorkingSetSizeEx.restype = ctypes.wintypes.BOOL
|
|
33
|
-
|
|
34
|
-
# Define constants for SetProcessWorkingSetSizeEx
|
|
35
|
-
QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002
|
|
36
|
-
|
|
37
|
-
# Attempt to set the working set size
|
|
38
|
-
result = ctypes.windll.kernel32.SetProcessWorkingSetSizeEx(pid, SIZE_T(-1), SIZE_T(-1), QUOTA_LIMITS_HARDWS_MIN_DISABLE)
|
|
39
|
-
|
|
40
|
-
if result == 0:
|
|
41
|
-
# Retrieve the error code
|
|
42
|
-
error_code = ctypes.windll.kernel32.GetLastError()
|
|
43
|
-
message = f"SetProcessWorkingSetSizeEx failed with error code: {error_code}"
|
|
44
|
-
logger.error(message)
|
|
45
|
-
return False
|
|
46
|
-
else:
|
|
47
|
-
return True
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def trim_ram() -> None:
|
|
51
|
-
"""Force python garbage collection.
|
|
52
|
-
|
|
53
|
-
Most importantly, calls malloc_trim/SetProcessWorkingSetSizeEx, which fixes pandas/libc (?) memory leak.
|
|
54
|
-
"""
|
|
55
|
-
gc.collect()
|
|
56
|
-
if platform.system() == "Windows":
|
|
57
|
-
trim_windows_process_memory()
|
|
58
|
-
else:
|
|
59
|
-
try:
|
|
60
|
-
ctypes.CDLL("libc.so.6").malloc_trim(0)
|
|
61
|
-
except Exception:
|
|
62
|
-
logger.exception("malloc_trim attempt failed")
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: mapFolding
|
|
3
|
-
Version: 0.16.0
|
|
4
|
-
Summary: Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.
|
|
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,GPU acceleration,JIT compilation,Numba optimization,OEIS,Python optimization,abstract syntax tree,algorithmic combinatorics,algorithmic optimization,arch configurations,automated code generation,bit-packed arrays,bitwise state machines,cache-efficient algorithms,closed meandric numbers,code generation,code optimization,code synthesis,code transformation,codon optimization,combinatorial computing,combinatorial enumeration,combinatorial geometry,combinatorial mathematics,combinatorial problem solver,combinatorics,computational combinatorics,computational geometry,crossing patterns,curve crossings,dataclass transformation,discrete mathematics,dynamic compilation,enumerative combinatorics,folding pattern enumeration,folding problems,high-performance computing,integer sequences,just-in-time compilation,kernel optimization,labeled stamp folding,low-level computation,map folding,mapFolding,mathematical algorithms,mathematical modeling,mathematical optimization,mathematical patterns,mathematical software,mathematical tool,mathematical visualization,meander enumeration,meanders,meandric systems,memory-efficient enumeration,metaprogramming,numerical algorithms,numerical computation,open meandric systems,paper folding mathematics,parallel computing,pattern recognition,performance optimization,permutation patterns,permutations,post-setup optimization,pyproject,scientific computing,semi-meanders,sequence analysis,sequence calculator,sequence enumeration,sequence explorer,sequence generation,source code analysis,stamp folding,symbolic computation,symmetric foldings,topological combinatorics,topological patterns,typed Python
|
|
12
|
-
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: numpy
|
|
41
|
-
Requires-Dist: platformdirs
|
|
42
|
-
Provides-Extra: development
|
|
43
|
-
Requires-Dist: memray; sys_platform == "linux" and extra == "development"
|
|
44
|
-
Requires-Dist: mypy; extra == "development"
|
|
45
|
-
Requires-Dist: pyupgrade; extra == "development"
|
|
46
|
-
Requires-Dist: py-spy; extra == "development"
|
|
47
|
-
Requires-Dist: setuptools-scm; extra == "development"
|
|
48
|
-
Provides-Extra: numba
|
|
49
|
-
Requires-Dist: numba; extra == "numba"
|
|
50
|
-
Requires-Dist: numba_progress; extra == "numba"
|
|
51
|
-
Provides-Extra: pandas
|
|
52
|
-
Requires-Dist: pandas; extra == "pandas"
|
|
53
|
-
Requires-Dist: pyarrow; extra == "pandas"
|
|
54
|
-
Requires-Dist: pyarrow-stubs; extra == "pandas"
|
|
55
|
-
Provides-Extra: testing
|
|
56
|
-
Requires-Dist: numba; extra == "testing"
|
|
57
|
-
Requires-Dist: pandas; extra == "testing"
|
|
58
|
-
Requires-Dist: pyarrow; extra == "testing"
|
|
59
|
-
Requires-Dist: pytest-cov; extra == "testing"
|
|
60
|
-
Requires-Dist: pytest-env; extra == "testing"
|
|
61
|
-
Requires-Dist: pytest-xdist; extra == "testing"
|
|
62
|
-
Requires-Dist: pytest; extra == "testing"
|
|
63
|
-
Dynamic: license-file
|
|
64
|
-
|
|
65
|
-
# mapFolding
|
|
66
|
-
|
|
67
|
-
[](https://pypi.org/project/mapFolding/)
|
|
68
|
-
|
|
69
|
-
Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.
|
|
70
|
-
|
|
71
|
-
Command line:
|
|
72
|
-
|
|
73
|
-
- getOEISids
|
|
74
|
-
- OEIS_for_n
|
|
75
|
-
|
|
76
|
-
The package is focused on mapFolding and stamp folding. But "mapFolding/_oeisFormulas" has some infrastructure for meanders and semi-meanders.
|
|
77
|
-
|
|
78
|
-
There are innovations and insights in the mapFolding stuff.
|
|
79
|
-
|
|
80
|
-
## My recovery
|
|
81
|
-
|
|
82
|
-
[](https://HunterThinks.com/support)
|
|
83
|
-
[](https://www.youtube.com/@HunterHogan)
|
|
84
|
-
|
|
85
|
-
[](https://creativecommons.org/licenses/by-nc/4.0/)
|