mapFolding 0.2.3__py3-none-any.whl → 0.2.5__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 +1 -1
- mapFolding/babbage.py +9 -4
- mapFolding/beDRY.py +47 -6
- mapFolding/benchmarks/benchmarking.py +3 -2
- mapFolding/importSelector.py +7 -0
- mapFolding/lovelace.py +92 -96
- mapFolding/{JAX/lunnanJAX.py → reference/jax.py} +2 -0
- mapFolding/someAssemblyRequired/inlineAfunction.py +152 -0
- mapFolding/someAssemblyRequired/jobsAndTasks.py +47 -0
- mapFolding/someAssemblyRequired/makeNuitkaSource.py +99 -0
- mapFolding/someAssemblyRequired/makeNumbaJob.py +121 -0
- mapFolding/startHere.py +8 -28
- mapFolding/theSSOT.py +13 -5
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/METADATA +8 -6
- mapFolding-0.2.5.dist-info/RECORD +33 -0
- tests/conftest.py +8 -1
- tests/test_other.py +158 -88
- mapFolding/JAX/taskJAX.py +0 -313
- mapFolding/benchmarks/test_benchmarks.py +0 -74
- mapFolding-0.2.3.dist-info/RECORD +0 -30
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/WHEEL +0 -0
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/entry_points.txt +0 -0
- {mapFolding-0.2.3.dist-info → mapFolding-0.2.5.dist-info}/top_level.txt +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from ...tests.conftest import *
|
|
2
|
-
from .benchmarking import recordBenchmarks, runBenchmarks
|
|
3
|
-
import numpy
|
|
4
|
-
import pathlib
|
|
5
|
-
import pytest
|
|
6
|
-
import unittest.mock
|
|
7
|
-
from typing import List
|
|
8
|
-
|
|
9
|
-
def test_recordBenchmarks_decorator(pathBenchmarksTesting: pathlib.Path,
|
|
10
|
-
listDimensionsTestFunctionality: List[int],
|
|
11
|
-
mockBenchmarkTimer: unittest.mock.MagicMock):
|
|
12
|
-
"""Test that the decorator correctly records benchmark data."""
|
|
13
|
-
@recordBenchmarks()
|
|
14
|
-
def functionTest(listDimensions: List[int]) -> int:
|
|
15
|
-
return sum(listDimensions)
|
|
16
|
-
|
|
17
|
-
with mockBenchmarkTimer:
|
|
18
|
-
mockBenchmarkTimer.side_effect = [0, 1e9]
|
|
19
|
-
result = functionTest(listDimensionsTestFunctionality)
|
|
20
|
-
|
|
21
|
-
# Verify function still works normally
|
|
22
|
-
assert result == sum(listDimensionsTestFunctionality)
|
|
23
|
-
|
|
24
|
-
# Verify benchmark data was saved
|
|
25
|
-
arrayBenchmarks = numpy.load(str(pathBenchmarksTesting), allow_pickle=True)
|
|
26
|
-
assert len(arrayBenchmarks) == 1
|
|
27
|
-
assert arrayBenchmarks[0]['time'] == 1.0
|
|
28
|
-
assert tuple(arrayBenchmarks[0]['dimensions']) == tuple(listDimensionsTestFunctionality)
|
|
29
|
-
|
|
30
|
-
def test_recordBenchmarks_multiple_calls(pathBenchmarksTesting: pathlib.Path,
|
|
31
|
-
listDimensionsTestFunctionality: List[int],
|
|
32
|
-
mockBenchmarkTimer: unittest.mock.MagicMock):
|
|
33
|
-
"""Test that multiple function calls append to benchmark data."""
|
|
34
|
-
@recordBenchmarks()
|
|
35
|
-
def functionTest(listDimensions: List[int]) -> int:
|
|
36
|
-
return sum(listDimensions)
|
|
37
|
-
|
|
38
|
-
with mockBenchmarkTimer:
|
|
39
|
-
mockBenchmarkTimer.side_effect = [0, 1e9, 2e9, 4e9]
|
|
40
|
-
functionTest(listDimensionsTestFunctionality)
|
|
41
|
-
functionTest(listDimensionsTestFunctionality)
|
|
42
|
-
|
|
43
|
-
arrayBenchmarks = numpy.load(str(pathBenchmarksTesting), allow_pickle=True)
|
|
44
|
-
assert len(arrayBenchmarks) == 2
|
|
45
|
-
assert arrayBenchmarks[0]['time'] == 1.0
|
|
46
|
-
assert arrayBenchmarks[1]['time'] == 2.0
|
|
47
|
-
|
|
48
|
-
# NOTE This test tries to collect benchmark data without ensuring that a function is decorated.
|
|
49
|
-
# def test_runBenchmarks_integration(pathBenchmarksTesting: pathlib.Path, listDimensionsTestFunctionality: List[int]):
|
|
50
|
-
# """Test runBenchmarks creates valid benchmark data."""
|
|
51
|
-
# countIterations = 2
|
|
52
|
-
# runBenchmarks(countIterations)
|
|
53
|
-
|
|
54
|
-
# arrayBenchmarks = numpy.load(str(pathBenchmarksTesting), allow_pickle=True)
|
|
55
|
-
# assert len(arrayBenchmarks) > 0 # Should have recorded some benchmarks
|
|
56
|
-
|
|
57
|
-
# # Verify data structure integrity
|
|
58
|
-
# assert arrayBenchmarks.dtype.names == ('time', 'dimensions')
|
|
59
|
-
# assert all(isinstance(record['time'], float) for record in arrayBenchmarks)
|
|
60
|
-
# assert all(isinstance(record['dimensions'], tuple) for record in arrayBenchmarks)
|
|
61
|
-
|
|
62
|
-
# # Verify at least one benchmark entry matches our test dimensions
|
|
63
|
-
# assert any(tuple(listDimensionsTestFunctionality) == record['dimensions'] for record in arrayBenchmarks)
|
|
64
|
-
|
|
65
|
-
# NOTE This test tries to collect benchmark data without ensuring that a function is decorated.
|
|
66
|
-
# @pytest.mark.parametrize("countIterations", [1, 2])
|
|
67
|
-
# def test_runBenchmarks_iterations(countIterations: int, pathBenchmarksTesting: pathlib.Path, listDimensionsTestFunctionality: List[int]):
|
|
68
|
-
# """Test runBenchmarks records data for each iteration."""
|
|
69
|
-
# runBenchmarks(countIterations)
|
|
70
|
-
# arrayBenchmarks = numpy.load(str(pathBenchmarksTesting), allow_pickle=True)
|
|
71
|
-
|
|
72
|
-
# # Should have at least countIterations entries for our test dimensions
|
|
73
|
-
# countMatches = sum(1 for record in arrayBenchmarks if tuple(listDimensionsTestFunctionality) == record['dimensions'])
|
|
74
|
-
# assert countMatches >= countIterations
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
mapFolding/__init__.py,sha256=wnf2EzHR2unVha6-Y0gRoSPaE4PDdT4VngINa_dfT2E,337
|
|
2
|
-
mapFolding/babbage.py,sha256=LCtyapF8SKsECqBifqbLm7bR_i4n8VJ647w_TQxnQvE,1930
|
|
3
|
-
mapFolding/beDRY.py,sha256=UE4IRrb5lXN4nTuUghHfieNm2FBHgz7oBj_EqUgkadI,13800
|
|
4
|
-
mapFolding/lovelace.py,sha256=r4dkTGh_AgaVsWOsdPRdpPWVx3TjVjbWfPCVu3UTm6U,13495
|
|
5
|
-
mapFolding/oeis.py,sha256=_-fLGc1ybZ2eFxoiBrSmojMexeg6ROxtrLaBF2BzMn4,12144
|
|
6
|
-
mapFolding/startHere.py,sha256=glGxmefrWpxyuqrzXrbCvIo84yvPnv8l8l7Rmff2sAo,5105
|
|
7
|
-
mapFolding/theSSOT.py,sha256=rAyx034y33QC7IiRKaW89CMGGvqe2p-QBc3_fO-zEGM,2101
|
|
8
|
-
mapFolding/JAX/lunnanJAX.py,sha256=xMZloN47q-MVfjdYOM1hi9qR4OnLq7qALmGLMraevQs,14819
|
|
9
|
-
mapFolding/JAX/taskJAX.py,sha256=yJNeH0rL6EhJ6ppnATHF0Zf81CDMC10bnPnimVxE1hc,20037
|
|
10
|
-
mapFolding/benchmarks/benchmarking.py,sha256=kv85F6V9pGhZvTOImArOuxyg5rywA_T6JLH_qFXM8BM,3018
|
|
11
|
-
mapFolding/benchmarks/test_benchmarks.py,sha256=c4ANeR3jgqpKXFoxDeZkmAHxSuenMwsjmrhKJ1_XPqY,3659
|
|
12
|
-
mapFolding/reference/flattened.py,sha256=X9nvRzg7YDcpCtSDTL4YiidjshlX9rg2e6JVCY6i2u0,16547
|
|
13
|
-
mapFolding/reference/hunterNumba.py,sha256=0giUyqAFzP-XKcq3Kz8wIWCK0BVFhjABVJ1s-w4Jhu0,7109
|
|
14
|
-
mapFolding/reference/irvineJavaPort.py,sha256=Sj-63Z-OsGuDoEBXuxyjRrNmmyl0d7Yz_XuY7I47Oyg,4250
|
|
15
|
-
mapFolding/reference/lunnan.py,sha256=XEcql_gxvCCghb6Or3qwmPbn4IZUbZTaSmw_fUjRxZE,5037
|
|
16
|
-
mapFolding/reference/lunnanNumpy.py,sha256=HqDgSwTOZA-G0oophOEfc4zs25Mv4yw2aoF1v8miOLk,4653
|
|
17
|
-
mapFolding/reference/lunnanWhile.py,sha256=7NY2IKO5XBgol0aWWF_Fi-7oTL9pvu_z6lB0TF1uVHk,4063
|
|
18
|
-
mapFolding/reference/rotatedEntryPoint.py,sha256=z0QyDQtnMvXNj5ntWzzJUQUMFm1-xHGLVhtYzwmczUI,11530
|
|
19
|
-
mapFolding/reference/total_countPlus1vsPlusN.py,sha256=usenM8Yn_G1dqlPl7NKKkcnbohBZVZBXTQRm2S3_EDA,8106
|
|
20
|
-
tests/__init__.py,sha256=eg9smg-6VblOr0kisM40CpGnuDtU2JgEEWGDTFVOlW8,57
|
|
21
|
-
tests/conftest.py,sha256=WE3DETPaQ4zuUiw8pweTry4rp1PxvUPgeb8CN8eh5JI,13574
|
|
22
|
-
tests/pythons_idiotic_namespace.py,sha256=oOLDBergQqqhGuRpsXUnFD-R_6AlJipNKYHw-kk_OKw,33
|
|
23
|
-
tests/test_oeis.py,sha256=vxnwO-cSR68htkyMh9QMVv-lvxBo6qlwPg1Rbx4JylY,7963
|
|
24
|
-
tests/test_other.py,sha256=5DwOZsjezBHZzr4-9qEnybBYJEGsozBm2n9p0KYvs9E,10664
|
|
25
|
-
tests/test_tasks.py,sha256=Nwe4iuSjwGZvsw5CXCcic7tkBxgM5JX9mrGZMDYhAwE,1785
|
|
26
|
-
mapFolding-0.2.3.dist-info/METADATA,sha256=nEQXgDmmuu2NJko4R4gPUdjIrm1upUGwMIOn0s0JOOc,6442
|
|
27
|
-
mapFolding-0.2.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
28
|
-
mapFolding-0.2.3.dist-info/entry_points.txt,sha256=F3OUeZR1XDTpoH7k3wXuRb3KF_kXTTeYhu5AGK1SiOQ,146
|
|
29
|
-
mapFolding-0.2.3.dist-info/top_level.txt,sha256=1gP2vFaqPwHujGwb3UjtMlLEGN-943VSYFR7V4gDqW8,17
|
|
30
|
-
mapFolding-0.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|