pragmastat 3.1.33__tar.gz → 3.2.0__tar.gz

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.

Potentially problematic release.


This version of pragmastat might be problematic. Click here for more details.

Files changed (25) hide show
  1. {pragmastat-3.1.33/pragmastat.egg-info → pragmastat-3.2.0}/PKG-INFO +5 -5
  2. {pragmastat-3.1.33 → pragmastat-3.2.0}/README.md +4 -4
  3. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat/__init__.py +1 -1
  4. {pragmastat-3.1.33 → pragmastat-3.2.0/pragmastat.egg-info}/PKG-INFO +5 -5
  5. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat.egg-info/top_level.txt +1 -0
  6. {pragmastat-3.1.33 → pragmastat-3.2.0}/pyproject.toml +1 -1
  7. pragmastat-3.2.0/tests/test_performance.py +70 -0
  8. pragmastat-3.1.33/tests/test_performance.py +0 -130
  9. {pragmastat-3.1.33 → pragmastat-3.2.0}/LICENSE +0 -0
  10. {pragmastat-3.1.33 → pragmastat-3.2.0}/MANIFEST.in +0 -0
  11. {pragmastat-3.1.33 → pragmastat-3.2.0}/examples/demo.py +0 -0
  12. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat/estimators.py +0 -0
  13. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat/fast_center.py +0 -0
  14. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat/fast_shift.py +0 -0
  15. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat/fast_spread.py +0 -0
  16. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat.egg-info/SOURCES.txt +0 -0
  17. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat.egg-info/dependency_links.txt +0 -0
  18. {pragmastat-3.1.33 → pragmastat-3.2.0}/pragmastat.egg-info/requires.txt +0 -0
  19. {pragmastat-3.1.33 → pragmastat-3.2.0}/setup.cfg +0 -0
  20. {pragmastat-3.1.33 → pragmastat-3.2.0}/setup.py +0 -0
  21. {pragmastat-3.1.33 → pragmastat-3.2.0}/src/fast_center_c.c +0 -0
  22. {pragmastat-3.1.33 → pragmastat-3.2.0}/src/fast_shift_c.c +0 -0
  23. {pragmastat-3.1.33 → pragmastat-3.2.0}/src/fast_spread_c.c +0 -0
  24. {pragmastat-3.1.33 → pragmastat-3.2.0}/tests/test_invariance.py +0 -0
  25. {pragmastat-3.1.33 → pragmastat-3.2.0}/tests/test_reference.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pragmastat
3
- Version: 3.1.33
3
+ Version: 3.2.0
4
4
  Summary: Pragmastat: Pragmatic Statistical Toolkit
5
5
  Author: Andrey Akinshin
6
6
  License-Expression: MIT
@@ -18,9 +18,9 @@ Dynamic: license-file
18
18
 
19
19
  This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit', which presents a toolkit of statistical procedures that provide reliable results across diverse real-world distributions, with ready-to-use implementations and detailed explanations.
20
20
 
21
- - PDF manual for this version: [pragmastat-v3.1.33.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.pdf)
22
- - Markdown manual for this version: [pragmastat-v3.1.33.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.md)
23
- - Source code for this version: [pragmastat/py/v3.1.33](https://github.com/AndreyAkinshin/pragmastat/tree/v3.1.33/py)
21
+ - PDF manual for this version: [pragmastat-v3.2.0.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.pdf)
22
+ - Markdown manual for this version: [pragmastat-v3.2.0.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.md)
23
+ - Source code for this version: [pragmastat/py/v3.2.0](https://github.com/AndreyAkinshin/pragmastat/tree/v3.2.0/py)
24
24
  - Latest online manual: https://pragmastat.dev
25
25
  - Manual DOI: [10.5281/zenodo.17236778](https://doi.org/10.5281/zenodo.17236778)
26
26
 
@@ -29,7 +29,7 @@ This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit',
29
29
  Install from PyPI:
30
30
 
31
31
  ```bash
32
- pip install pragmastat==3.1.33
32
+ pip install pragmastat==3.2.0
33
33
  ```
34
34
 
35
35
  ## Demo
@@ -2,9 +2,9 @@
2
2
 
3
3
  This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit', which presents a toolkit of statistical procedures that provide reliable results across diverse real-world distributions, with ready-to-use implementations and detailed explanations.
4
4
 
5
- - PDF manual for this version: [pragmastat-v3.1.33.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.pdf)
6
- - Markdown manual for this version: [pragmastat-v3.1.33.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.md)
7
- - Source code for this version: [pragmastat/py/v3.1.33](https://github.com/AndreyAkinshin/pragmastat/tree/v3.1.33/py)
5
+ - PDF manual for this version: [pragmastat-v3.2.0.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.pdf)
6
+ - Markdown manual for this version: [pragmastat-v3.2.0.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.md)
7
+ - Source code for this version: [pragmastat/py/v3.2.0](https://github.com/AndreyAkinshin/pragmastat/tree/v3.2.0/py)
8
8
  - Latest online manual: https://pragmastat.dev
9
9
  - Manual DOI: [10.5281/zenodo.17236778](https://doi.org/10.5281/zenodo.17236778)
10
10
 
@@ -13,7 +13,7 @@ This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit',
13
13
  Install from PyPI:
14
14
 
15
15
  ```bash
16
- pip install pragmastat==3.1.33
16
+ pip install pragmastat==3.2.0
17
17
  ```
18
18
 
19
19
  ## Demo
@@ -10,4 +10,4 @@ __all__ = [
10
10
  "disparity",
11
11
  ]
12
12
 
13
- __version__ = "3.1.33"
13
+ __version__ = "3.2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pragmastat
3
- Version: 3.1.33
3
+ Version: 3.2.0
4
4
  Summary: Pragmastat: Pragmatic Statistical Toolkit
5
5
  Author: Andrey Akinshin
6
6
  License-Expression: MIT
@@ -18,9 +18,9 @@ Dynamic: license-file
18
18
 
19
19
  This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit', which presents a toolkit of statistical procedures that provide reliable results across diverse real-world distributions, with ready-to-use implementations and detailed explanations.
20
20
 
21
- - PDF manual for this version: [pragmastat-v3.1.33.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.pdf)
22
- - Markdown manual for this version: [pragmastat-v3.1.33.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.1.33/pragmastat-v3.1.33.md)
23
- - Source code for this version: [pragmastat/py/v3.1.33](https://github.com/AndreyAkinshin/pragmastat/tree/v3.1.33/py)
21
+ - PDF manual for this version: [pragmastat-v3.2.0.pdf](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.pdf)
22
+ - Markdown manual for this version: [pragmastat-v3.2.0.md](https://github.com/AndreyAkinshin/pragmastat/releases/download/v3.2.0/pragmastat-v3.2.0.md)
23
+ - Source code for this version: [pragmastat/py/v3.2.0](https://github.com/AndreyAkinshin/pragmastat/tree/v3.2.0/py)
24
24
  - Latest online manual: https://pragmastat.dev
25
25
  - Manual DOI: [10.5281/zenodo.17236778](https://doi.org/10.5281/zenodo.17236778)
26
26
 
@@ -29,7 +29,7 @@ This is a Python implementation of 'Pragmastat: Pragmatic Statistical Toolkit',
29
29
  Install from PyPI:
30
30
 
31
31
  ```bash
32
- pip install pragmastat==3.1.33
32
+ pip install pragmastat==3.2.0
33
33
  ```
34
34
 
35
35
  ## Demo
@@ -4,3 +4,4 @@ pragmastat
4
4
  setup
5
5
  src
6
6
  tests
7
+ venv
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pragmastat"
3
- version = "3.1.33"
3
+ version = "3.2.0"
4
4
  description = "Pragmastat: Pragmatic Statistical Toolkit"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -0,0 +1,70 @@
1
+ import time
2
+ from pragmastat.fast_center import _fast_center
3
+ from pragmastat.fast_spread import _fast_spread
4
+ from pragmastat.fast_shift import _fast_shift
5
+
6
+
7
+ def test_center_performance():
8
+ n = 100000
9
+ x = list(range(1, n + 1))
10
+
11
+ start = time.time()
12
+ result = _fast_center(x)
13
+ elapsed = time.time() - start
14
+
15
+ print(f"\nCenter for n={n}: {result:.6f}")
16
+ print(f"Elapsed time: {elapsed:.3f}s")
17
+
18
+ expected = 50000.5
19
+ assert (
20
+ abs(result - expected) < 1e-9
21
+ ), f"Center for n={n}: expected {expected}, got {result}"
22
+ assert elapsed < 5.0, f"Performance too slow: {elapsed}s"
23
+
24
+
25
+ def test_spread_performance():
26
+ n = 100000
27
+ x = list(range(1, n + 1))
28
+
29
+ start = time.time()
30
+ result = _fast_spread(x)
31
+ elapsed = time.time() - start
32
+
33
+ print(f"\nSpread for n={n}: {result:.6f}")
34
+ print(f"Elapsed time: {elapsed:.3f}s")
35
+
36
+ expected = 29290.0
37
+ assert (
38
+ abs(result - expected) < 1e-9
39
+ ), f"Spread for n={n}: expected {expected}, got {result}"
40
+ assert elapsed < 5.0, f"Performance too slow: {elapsed}s"
41
+
42
+
43
+ def test_shift_performance():
44
+ n = 100000
45
+ x = list(range(1, n + 1))
46
+ y = list(range(1, n + 1))
47
+
48
+ start = time.time()
49
+ result = _fast_shift(x, y, p=0.5)
50
+ elapsed = time.time() - start
51
+
52
+ print(f"\nShift for n=m={n}: {result:.6f}")
53
+ print(f"Elapsed time: {elapsed:.3f}s")
54
+
55
+ expected = 0.0
56
+ assert (
57
+ abs(result - expected) < 1e-9
58
+ ), f"Shift for n=m={n}: expected {expected}, got {result}"
59
+ assert elapsed < 5.0, f"Performance too slow: {elapsed}s"
60
+
61
+
62
+ if __name__ == "__main__":
63
+ test_center_performance()
64
+ print("✓ Center performance test passed")
65
+
66
+ test_spread_performance()
67
+ print("✓ Spread performance test passed")
68
+
69
+ test_shift_performance()
70
+ print("✓ Shift performance test passed")
@@ -1,130 +0,0 @@
1
- import time
2
- import numpy as np
3
- from pragmastat.fast_center import _fast_center
4
- from pragmastat.fast_spread import _fast_spread
5
- from pragmastat.fast_shift import _fast_shift
6
-
7
-
8
- def center_naive(x):
9
- n = len(x)
10
- pairwise_averages = []
11
- for i in range(n):
12
- for j in range(i, n):
13
- pairwise_averages.append((x[i] + x[j]) / 2)
14
- return np.median(pairwise_averages)
15
-
16
-
17
- def spread_naive(x):
18
- n = len(x)
19
- if n == 1:
20
- return 0.0
21
- pairwise_diffs = []
22
- for i in range(n):
23
- for j in range(i + 1, n):
24
- pairwise_diffs.append(abs(x[i] - x[j]))
25
- return np.median(pairwise_diffs)
26
-
27
-
28
- def shift_naive(x, y):
29
- pairwise_shifts = []
30
- for xi in x:
31
- for yj in y:
32
- pairwise_shifts.append(xi - yj)
33
- return np.median(pairwise_shifts)
34
-
35
-
36
- def test_center_correctness():
37
- np.random.seed(1729)
38
- for n in range(1, 101):
39
- for iteration in range(n):
40
- x = np.random.randn(n).tolist()
41
- expected = center_naive(x)
42
- actual = _fast_center(x)
43
- assert (
44
- abs(expected - actual) < 1e-9
45
- ), f"Mismatch for n={n}: expected={expected}, actual={actual}"
46
-
47
-
48
- def test_spread_correctness():
49
- np.random.seed(1729)
50
- for n in range(1, 101):
51
- for iteration in range(n):
52
- x = np.random.randn(n).tolist()
53
- expected = spread_naive(x)
54
- actual = _fast_spread(x)
55
- assert (
56
- abs(expected - actual) < 1e-9
57
- ), f"Mismatch for n={n}: expected={expected}, actual={actual}"
58
-
59
-
60
- def test_center_performance():
61
- np.random.seed(1729)
62
- x = np.random.randn(100000).tolist()
63
-
64
- start = time.time()
65
- result = _fast_center(x)
66
- elapsed = time.time() - start
67
-
68
- print(f"\nCenter for n=100000: {result:.6f}")
69
- print(f"Elapsed time: {elapsed:.3f}s")
70
- assert elapsed < 10.0, f"Performance too slow: {elapsed}s"
71
-
72
-
73
- def test_spread_performance():
74
- np.random.seed(1729)
75
- x = np.random.randn(100000).tolist()
76
-
77
- start = time.time()
78
- result = _fast_spread(x)
79
- elapsed = time.time() - start
80
-
81
- print(f"\nSpread for n=100000: {result:.6f}")
82
- print(f"Elapsed time: {elapsed:.3f}s")
83
- assert elapsed < 10.0, f"Performance too slow: {elapsed}s"
84
-
85
-
86
- def test_shift_correctness():
87
- np.random.seed(1729)
88
- for n in range(2, 51):
89
- for m in range(2, 51):
90
- x = np.random.randn(n).tolist()
91
- y = np.random.randn(m).tolist()
92
- expected = shift_naive(x, y)
93
- actual = _fast_shift(x, y, p=0.5)
94
- assert (
95
- abs(expected - actual) < 1e-9
96
- ), f"Mismatch for n={n}, m={m}: expected={expected}, actual={actual}"
97
-
98
-
99
- def test_shift_performance():
100
- np.random.seed(1729)
101
- x = np.random.randn(10000).tolist()
102
- y = np.random.randn(10000).tolist()
103
-
104
- start = time.time()
105
- result = _fast_shift(x, y, p=0.5)
106
- elapsed = time.time() - start
107
-
108
- print(f"\nShift for n=m=10000: {result:.6f}")
109
- print(f"Elapsed time: {elapsed:.3f}s")
110
- assert elapsed < 10.0, f"Performance too slow: {elapsed}s"
111
-
112
-
113
- if __name__ == "__main__":
114
- test_center_correctness()
115
- print("✓ Center correctness tests passed")
116
-
117
- test_spread_correctness()
118
- print("✓ Spread correctness tests passed")
119
-
120
- test_shift_correctness()
121
- print("✓ Shift correctness tests passed")
122
-
123
- test_center_performance()
124
- print("✓ Center performance test passed")
125
-
126
- test_spread_performance()
127
- print("✓ Spread performance test passed")
128
-
129
- test_shift_performance()
130
- print("✓ Shift performance test passed")
File without changes
File without changes
File without changes
File without changes
File without changes