mapFolding 0.5.1__py3-none-any.whl → 0.7.0__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.
- mapFolding/__init__.py +6 -101
- mapFolding/basecamp.py +12 -10
- mapFolding/beDRY.py +96 -316
- mapFolding/filesystem.py +87 -0
- mapFolding/noHomeYet.py +20 -0
- mapFolding/oeis.py +39 -36
- mapFolding/reference/flattened.py +377 -0
- mapFolding/reference/hunterNumba.py +132 -0
- mapFolding/reference/irvineJavaPort.py +120 -0
- mapFolding/reference/jax.py +208 -0
- mapFolding/reference/lunnan.py +153 -0
- mapFolding/reference/lunnanNumpy.py +123 -0
- mapFolding/reference/lunnanWhile.py +121 -0
- mapFolding/reference/rotatedEntryPoint.py +240 -0
- mapFolding/reference/total_countPlus1vsPlusN.py +211 -0
- mapFolding/someAssemblyRequired/Z0Z_workbench.py +34 -0
- mapFolding/someAssemblyRequired/__init__.py +16 -0
- mapFolding/someAssemblyRequired/getLLVMforNoReason.py +21 -0
- mapFolding/someAssemblyRequired/ingredientsNumba.py +100 -0
- mapFolding/someAssemblyRequired/synthesizeCountingFunctions.py +7 -0
- mapFolding/someAssemblyRequired/synthesizeDataConverters.py +135 -0
- mapFolding/someAssemblyRequired/synthesizeNumba.py +91 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaJob.py +417 -0
- mapFolding/someAssemblyRequired/synthesizeNumbaModules.py +91 -0
- mapFolding/someAssemblyRequired/transformationTools.py +425 -0
- mapFolding/someAssemblyRequired/whatWillBe.py +311 -0
- mapFolding/syntheticModules/__init__.py +0 -0
- mapFolding/syntheticModules/dataNamespaceFlattened.py +30 -0
- mapFolding/syntheticModules/numbaCount.py +90 -0
- mapFolding/syntheticModules/numbaCountExample.py +158 -0
- mapFolding/syntheticModules/numbaCountSequential.py +110 -0
- mapFolding/syntheticModules/numbaCount_doTheNeedful.py +13 -0
- mapFolding/syntheticModules/numba_doTheNeedful.py +12 -0
- mapFolding/syntheticModules/numba_doTheNeedfulExample.py +13 -0
- mapFolding/theDao.py +203 -227
- mapFolding/theSSOT.py +254 -123
- {mapFolding-0.5.1.dist-info → mapfolding-0.7.0.dist-info}/METADATA +10 -8
- mapfolding-0.7.0.dist-info/RECORD +50 -0
- {mapFolding-0.5.1.dist-info → mapfolding-0.7.0.dist-info}/WHEEL +1 -1
- {mapFolding-0.5.1.dist-info → mapfolding-0.7.0.dist-info}/top_level.txt +1 -0
- tests/__init__.py +0 -0
- tests/conftest.py +278 -0
- tests/test_computations.py +49 -0
- tests/test_filesystem.py +52 -0
- tests/test_oeis.py +128 -0
- tests/test_other.py +84 -0
- tests/test_tasks.py +50 -0
- mapFolding/theSSOTdatatypes.py +0 -156
- mapFolding-0.5.1.dist-info/RECORD +0 -14
- {mapFolding-0.5.1.dist-info → mapfolding-0.7.0.dist-info}/LICENSE +0 -0
- {mapFolding-0.5.1.dist-info → mapfolding-0.7.0.dist-info}/entry_points.txt +0 -0
mapFolding/theSSOTdatatypes.py
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
from collections import defaultdict
|
|
2
|
-
from typing import Any, cast, Final
|
|
3
|
-
import enum
|
|
4
|
-
import numba # type: ignore
|
|
5
|
-
import numpy # type: ignore
|
|
6
|
-
|
|
7
|
-
class EnumIndices(enum.IntEnum):
|
|
8
|
-
@staticmethod
|
|
9
|
-
def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> int:
|
|
10
|
-
"""0-indexed."""
|
|
11
|
-
return count
|
|
12
|
-
|
|
13
|
-
def __index__(self) -> int:
|
|
14
|
-
"""Adapt enum to the ultra-rare event of indexing a NumPy 'ndarray', which is not the
|
|
15
|
-
same as `array.array`. See NumPy.org; I think it will be very popular someday."""
|
|
16
|
-
return self.value
|
|
17
|
-
|
|
18
|
-
class indexMy(EnumIndices):
|
|
19
|
-
"""Indices for scalar values."""
|
|
20
|
-
dimensionsTotal = enum.auto()
|
|
21
|
-
dimensionsUnconstrained = enum.auto()
|
|
22
|
-
gap1ndex = enum.auto()
|
|
23
|
-
gap1ndexCeiling = enum.auto()
|
|
24
|
-
indexDimension = enum.auto()
|
|
25
|
-
indexLeaf = enum.auto()
|
|
26
|
-
indexMiniGap = enum.auto()
|
|
27
|
-
leaf1ndex = enum.auto()
|
|
28
|
-
leafConnectee = enum.auto()
|
|
29
|
-
taskDivisions = enum.auto()
|
|
30
|
-
taskIndex = enum.auto()
|
|
31
|
-
|
|
32
|
-
class indexTrack(EnumIndices):
|
|
33
|
-
"""Indices for state tracking array."""
|
|
34
|
-
leafAbove = enum.auto()
|
|
35
|
-
leafBelow = enum.auto()
|
|
36
|
-
countDimensionsGapped = enum.auto()
|
|
37
|
-
gapRangeStart = enum.auto()
|
|
38
|
-
|
|
39
|
-
_datatypeDefault: Final[dict[str, str]] = {
|
|
40
|
-
'elephino': 'uint16',
|
|
41
|
-
'foldsTotal': 'int64',
|
|
42
|
-
'leavesTotal': 'uint16',
|
|
43
|
-
}
|
|
44
|
-
_datatypeModule: str = ''
|
|
45
|
-
_datatypeModuleDEFAULT: Final[str] = 'numpy'
|
|
46
|
-
|
|
47
|
-
_datatype: dict[str, str] = defaultdict(str)
|
|
48
|
-
|
|
49
|
-
def reportDatatypeLimit(identifier: str, datatype: str, sourGrapes: bool | None = False) -> str:
|
|
50
|
-
global _datatype
|
|
51
|
-
if not _datatype[identifier]:
|
|
52
|
-
_datatype[identifier] = datatype
|
|
53
|
-
elif _datatype[identifier] == datatype:
|
|
54
|
-
pass
|
|
55
|
-
elif sourGrapes:
|
|
56
|
-
raise Exception(f"Datatype is '{_datatype[identifier]}' not '{datatype}', so you can take your ball and go home.")
|
|
57
|
-
return _datatype[identifier]
|
|
58
|
-
|
|
59
|
-
def setDatatypeModule(datatypeModule: str, sourGrapes: bool | None = False) -> str:
|
|
60
|
-
global _datatypeModule
|
|
61
|
-
if not _datatypeModule:
|
|
62
|
-
_datatypeModule = datatypeModule
|
|
63
|
-
elif _datatypeModule == datatypeModule:
|
|
64
|
-
pass
|
|
65
|
-
elif sourGrapes:
|
|
66
|
-
raise Exception(f"Datatype module is '{_datatypeModule}' not '{datatypeModule}', so you can take your ball and go home.")
|
|
67
|
-
return _datatypeModule
|
|
68
|
-
|
|
69
|
-
def setDatatypeElephino(datatype: str, sourGrapes: bool | None = False) -> str:
|
|
70
|
-
return reportDatatypeLimit('elephino', datatype, sourGrapes)
|
|
71
|
-
|
|
72
|
-
def setDatatypeFoldsTotal(datatype: str, sourGrapes: bool | None = False) -> str:
|
|
73
|
-
return reportDatatypeLimit('foldsTotal', datatype, sourGrapes)
|
|
74
|
-
|
|
75
|
-
def setDatatypeLeavesTotal(datatype: str, sourGrapes: bool | None = False) -> str:
|
|
76
|
-
return reportDatatypeLimit('leavesTotal', datatype, sourGrapes)
|
|
77
|
-
|
|
78
|
-
def _get_datatype(identifier: str) -> str:
|
|
79
|
-
global _datatype
|
|
80
|
-
if not _datatype[identifier]:
|
|
81
|
-
if identifier in indexMy._member_names_:
|
|
82
|
-
_datatype[identifier] = _datatypeDefault.get(identifier) or _get_datatype('elephino')
|
|
83
|
-
elif identifier in indexTrack._member_names_:
|
|
84
|
-
_datatype[identifier] = _datatypeDefault.get(identifier) or _get_datatype('elephino')
|
|
85
|
-
else:
|
|
86
|
-
_datatype[identifier] = _datatypeDefault.get(identifier) or _get_datatype('foldsTotal')
|
|
87
|
-
return _datatype[identifier]
|
|
88
|
-
|
|
89
|
-
def getDatatypeModule() -> str:
|
|
90
|
-
global _datatypeModule
|
|
91
|
-
if not _datatypeModule:
|
|
92
|
-
_datatypeModule = _datatypeModuleDEFAULT
|
|
93
|
-
return _datatypeModule
|
|
94
|
-
|
|
95
|
-
def setInStone(identifier: str) -> type[Any]:
|
|
96
|
-
datatypeModule: str = getDatatypeModule()
|
|
97
|
-
datatypeStr: str = _get_datatype(identifier)
|
|
98
|
-
return cast(type[Any], getattr(eval(datatypeModule), datatypeStr))
|
|
99
|
-
|
|
100
|
-
def hackSSOTdtype(identifier: str) -> type[Any]:
|
|
101
|
-
_hackSSOTdtype: dict[str, str]={
|
|
102
|
-
'connectionGraph': 'dtypeLeavesTotal',
|
|
103
|
-
'dtypeElephino': 'dtypeElephino',
|
|
104
|
-
'dtypeFoldsTotal': 'dtypeFoldsTotal',
|
|
105
|
-
'dtypeLeavesTotal': 'dtypeLeavesTotal',
|
|
106
|
-
'foldGroups': 'dtypeFoldsTotal',
|
|
107
|
-
'gapsWhere': 'dtypeLeavesTotal',
|
|
108
|
-
'mapShape': 'dtypeLeavesTotal',
|
|
109
|
-
'my': 'dtypeElephino',
|
|
110
|
-
'track': 'dtypeElephino',
|
|
111
|
-
}
|
|
112
|
-
RubeGoldBerg: str = _hackSSOTdtype[identifier]
|
|
113
|
-
if RubeGoldBerg == 'dtypeElephino':
|
|
114
|
-
return setInStone('elephino')
|
|
115
|
-
elif RubeGoldBerg == 'dtypeFoldsTotal':
|
|
116
|
-
return setInStone('foldsTotal')
|
|
117
|
-
elif RubeGoldBerg == 'dtypeLeavesTotal':
|
|
118
|
-
return setInStone('leavesTotal')
|
|
119
|
-
raise Exception("Dude, you forgot to set a value in `hackSSOTdtype`.")
|
|
120
|
-
|
|
121
|
-
def hackSSOTdatatype(identifier: str) -> str:
|
|
122
|
-
_hackSSOTdatatype: dict[str, str]={
|
|
123
|
-
'connectionGraph': 'datatypeLeavesTotal',
|
|
124
|
-
'countDimensionsGapped': 'datatypeLeavesTotal',
|
|
125
|
-
'datatypeElephino': 'datatypeElephino',
|
|
126
|
-
'datatypeFoldsTotal': 'datatypeFoldsTotal',
|
|
127
|
-
'datatypeLeavesTotal': 'datatypeLeavesTotal',
|
|
128
|
-
'dimensionsTotal': 'datatypeLeavesTotal',
|
|
129
|
-
'dimensionsUnconstrained': 'datatypeLeavesTotal',
|
|
130
|
-
'foldGroups': 'datatypeFoldsTotal',
|
|
131
|
-
'gap1ndex': 'datatypeLeavesTotal',
|
|
132
|
-
'gap1ndexCeiling': 'datatypeElephino',
|
|
133
|
-
'gapRangeStart': 'datatypeElephino',
|
|
134
|
-
'gapsWhere': 'datatypeLeavesTotal',
|
|
135
|
-
'groupsOfFolds': 'datatypeFoldsTotal',
|
|
136
|
-
'indexDimension': 'datatypeLeavesTotal',
|
|
137
|
-
'indexLeaf': 'datatypeLeavesTotal',
|
|
138
|
-
'indexMiniGap': 'datatypeElephino',
|
|
139
|
-
'leaf1ndex': 'datatypeLeavesTotal',
|
|
140
|
-
'leafAbove': 'datatypeLeavesTotal',
|
|
141
|
-
'leafBelow': 'datatypeLeavesTotal',
|
|
142
|
-
'leafConnectee': 'datatypeLeavesTotal',
|
|
143
|
-
'mapShape': 'datatypeLeavesTotal',
|
|
144
|
-
'my': 'datatypeElephino',
|
|
145
|
-
'taskDivisions': 'datatypeLeavesTotal',
|
|
146
|
-
'taskIndex': 'datatypeLeavesTotal',
|
|
147
|
-
'track': 'datatypeElephino',
|
|
148
|
-
}
|
|
149
|
-
RubeGoldBerg: str = _hackSSOTdatatype[identifier]
|
|
150
|
-
if RubeGoldBerg == 'datatypeElephino':
|
|
151
|
-
return _get_datatype('elephino')
|
|
152
|
-
elif RubeGoldBerg == 'datatypeFoldsTotal':
|
|
153
|
-
return _get_datatype('foldsTotal')
|
|
154
|
-
elif RubeGoldBerg == 'datatypeLeavesTotal':
|
|
155
|
-
return _get_datatype('leavesTotal')
|
|
156
|
-
raise Exception("Dude, you forgot to set a value in `hackSSOTdatatype`.")
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
mapFolding/__init__.py,sha256=FmpYlbGIZ4Pkt5Qr49JRBWdPRX9be4dYNlEV1ZXkmKU,2620
|
|
2
|
-
mapFolding/basecamp.py,sha256=eU-9XQ9aOpgOcpVSTlbQ_XZEYsmfx1h6gESTgvP3RrI,3707
|
|
3
|
-
mapFolding/beDRY.py,sha256=_NswGMIkF77akOSEJQqbOQOMwwrAL0c9yJi5bTZUBzw,17027
|
|
4
|
-
mapFolding/oeis.py,sha256=ekXTb5P2GUkVgVsxWb23nukl8Pg97kdyU3-pePq7EQA,11393
|
|
5
|
-
mapFolding/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
mapFolding/theDao.py,sha256=64dlLhrdtNbZAXMbqcZhGAE0ZwgqYRt8nT1on46J-cc,12611
|
|
7
|
-
mapFolding/theSSOT.py,sha256=u7VXbqGasrTomxI771bQ7kURMpfn_ph6Y8ac8Rf70hw,5866
|
|
8
|
-
mapFolding/theSSOTdatatypes.py,sha256=-p9B5ikWPKqztnmDDg6NKAdys7qwiNU2c1oCbGXAf5Q,5714
|
|
9
|
-
mapFolding-0.5.1.dist-info/LICENSE,sha256=NxH5Y8BdC-gNU-WSMwim3uMbID2iNDXJz7fHtuTdXhk,19346
|
|
10
|
-
mapFolding-0.5.1.dist-info/METADATA,sha256=UJsh0vVsMCGhX3ORFIrrVCLSQDDGJeGC_QrUjJeKpB4,7718
|
|
11
|
-
mapFolding-0.5.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
-
mapFolding-0.5.1.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
13
|
-
mapFolding-0.5.1.dist-info/top_level.txt,sha256=aG3bjFBoxxuaV3Iu1wZAd241Ubs3cdaJtKYBQBDIjsg,11
|
|
14
|
-
mapFolding-0.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|