mergeron_extra 2024.739148.7__py3-none-any.whl → 2026.739650.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.
- mergeron_extra/__init__.py +1 -1
- mergeron_extra/proportions_tests.py +55 -44
- mergeron_extra/tol_colors.py +44 -7
- mergeron_extra/xlsxw_helper.py +59 -53
- {mergeron_extra-2024.739148.7.dist-info → mergeron_extra-2026.739650.0.dist-info}/METADATA +9 -8
- mergeron_extra-2026.739650.0.dist-info/RECORD +8 -0
- {mergeron_extra-2024.739148.7.dist-info → mergeron_extra-2026.739650.0.dist-info}/WHEEL +1 -1
- mergeron_extra-2024.739148.7.dist-info/RECORD +0 -8
mergeron_extra/__init__.py
CHANGED
|
@@ -9,13 +9,15 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
from collections.abc import Sequence
|
|
11
11
|
from dataclasses import dataclass
|
|
12
|
+
from itertools import starmap
|
|
12
13
|
from typing import Literal
|
|
13
14
|
|
|
14
15
|
import numpy as np
|
|
16
|
+
from mergeron import ArrayDouble, ArrayINT
|
|
15
17
|
from scipy.optimize import OptimizeResult, root # type: ignore
|
|
16
18
|
from scipy.stats import beta, chi2, norm # type: ignore
|
|
17
19
|
|
|
18
|
-
from . import VERSION
|
|
20
|
+
from . import VERSION
|
|
19
21
|
|
|
20
22
|
__version__ = VERSION
|
|
21
23
|
|
|
@@ -29,12 +31,11 @@ def propn_ci(
|
|
|
29
31
|
method: Literal[
|
|
30
32
|
"Agresti-Coull", "Clopper-Pearson", "Exact", "Wilson", "Score"
|
|
31
33
|
] = "Wilson",
|
|
32
|
-
) ->
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"""Returns point estimates and confidence interval for a proportion
|
|
34
|
+
) -> ArrayDouble:
|
|
35
|
+
"""
|
|
36
|
+
Point estimates and confidence interval for a proportion.
|
|
36
37
|
|
|
37
|
-
Methods "Clopper-Pearson" and "Exact" are
|
|
38
|
+
Methods "Clopper-Pearson" and "Exact" are synonymous [3]_. Similarly,
|
|
38
39
|
"Wilson" and "Score" are synonyms here.
|
|
39
40
|
|
|
40
41
|
Parameters
|
|
@@ -65,37 +66,37 @@ def propn_ci(
|
|
|
65
66
|
https://doi.org/10.1080/00031305.1998.10480550
|
|
66
67
|
|
|
67
68
|
"""
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
if any((
|
|
70
|
+
isinstance(_nobs, float) and not _nobs,
|
|
71
|
+
isinstance(_nobs, np.ndarray) and not _nobs.any(),
|
|
72
|
+
isinstance(_npos, float) and not _npos,
|
|
73
|
+
isinstance(_npos, np.ndarray) and not _npos.any(),
|
|
74
|
+
)):
|
|
75
|
+
return ArrayDouble([np.nan, np.nan, np.nan, np.nan])
|
|
76
|
+
|
|
77
|
+
_raw_phat = (
|
|
78
|
+
ArrayDouble(_npos / _nobs) if isinstance(_npos, np.ndarray) else _npos / _nobs
|
|
79
|
+
)
|
|
79
80
|
_est_phat: ArrayDouble | float
|
|
80
81
|
_est_ci_l: ArrayDouble | float
|
|
81
82
|
_est_ci_u: ArrayDouble | float
|
|
82
83
|
|
|
83
84
|
match method:
|
|
84
85
|
case "Clopper-Pearson" | "Exact":
|
|
85
|
-
_est_ci_l, _est_ci_u = (
|
|
86
|
-
beta.ppf
|
|
87
|
-
|
|
86
|
+
_est_ci_l, _est_ci_u = starmap(
|
|
87
|
+
beta.ppf,
|
|
88
|
+
(
|
|
88
89
|
(alpha / 2, _npos, _nobs - _npos + 1),
|
|
89
90
|
(1 - alpha / 2, _npos + 1, _nobs - _npos),
|
|
90
|
-
)
|
|
91
|
+
),
|
|
91
92
|
)
|
|
92
|
-
_est_phat = 1 / 2 * (_est_ci_l + _est_ci_u)
|
|
93
|
+
_est_phat = 1 / 2 * (_est_ci_l + _est_ci_u) # type: ignore
|
|
93
94
|
|
|
94
95
|
case "Agresti-Coull":
|
|
95
96
|
_zsc = norm.ppf(1 - alpha / 2)
|
|
96
97
|
_zscsq = _zsc * _zsc
|
|
97
98
|
_adjmt = 4 if alpha == 0.05 else _zscsq
|
|
98
|
-
_est_phat = (_npos + _adjmt / 2) / (_nobs + _adjmt)
|
|
99
|
+
_est_phat = (_npos + _adjmt / 2) / (_nobs + _adjmt) # type: ignore
|
|
99
100
|
_est_ci_l, _est_ci_u = (
|
|
100
101
|
_est_phat + _g
|
|
101
102
|
for _g in [
|
|
@@ -120,7 +121,8 @@ def propn_ci(
|
|
|
120
121
|
case _:
|
|
121
122
|
raise ValueError(f"Method, {f'"{method}"'} not yet implemented.")
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
retlist = [_raw_phat, _est_phat, _est_ci_l, _est_ci_u]
|
|
125
|
+
return ArrayDouble(retlist if isinstance(_npos, int) else np.hstack(retlist)) # type: ignore
|
|
124
126
|
|
|
125
127
|
|
|
126
128
|
def propn_ci_multinomial(
|
|
@@ -165,18 +167,22 @@ def propn_ci_multinomial(
|
|
|
165
167
|
|
|
166
168
|
if alternative == "default":
|
|
167
169
|
_ci_len_half = np.sqrt(_chi2_cr * (_chi2_cr + 4 * _n * _prob * (1 - _prob)))
|
|
168
|
-
return
|
|
169
|
-
(
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
return ArrayDouble(
|
|
171
|
+
np.column_stack([
|
|
172
|
+
(_chi2_cr + 2 * _counts + _f * _ci_len_half) / (2 * (_n + _chi2_cr))
|
|
173
|
+
for _f in (-1, 1)
|
|
174
|
+
])
|
|
175
|
+
)
|
|
172
176
|
|
|
173
177
|
elif alternative == "simplified":
|
|
174
178
|
_ci_len_half = np.sqrt(_chi2_cr * _prob * (1 - _prob) / _n)
|
|
175
|
-
return
|
|
179
|
+
return ArrayDouble(
|
|
180
|
+
np.column_stack([_prob + _f * _ci_len_half for _f in (-1, 1)])
|
|
181
|
+
)
|
|
176
182
|
|
|
177
183
|
else:
|
|
178
184
|
raise ValueError(
|
|
179
|
-
f
|
|
185
|
+
f'Invalid value, {f'"{alternative}"'} for, "alternative". '
|
|
180
186
|
f"Must be one of '{'("default", "simplified")'}'."
|
|
181
187
|
)
|
|
182
188
|
|
|
@@ -190,7 +196,7 @@ def propn_diff_ci(
|
|
|
190
196
|
*,
|
|
191
197
|
alpha: float = 0.05,
|
|
192
198
|
method: Literal["Agresti-Caffo", "Mee", "M-N", "Newcombe", "Score"] = "M-N",
|
|
193
|
-
) ->
|
|
199
|
+
) -> ArrayDouble:
|
|
194
200
|
R"""Confidence intervals for differences in binomial proportions.
|
|
195
201
|
|
|
196
202
|
Methods available are Agresti-Caffo [4]_, Mee [5]_, Meitinen-Nurminen [5]_ [6]_
|
|
@@ -239,7 +245,7 @@ def propn_diff_ci(
|
|
|
239
245
|
)
|
|
240
246
|
|
|
241
247
|
if not min(_nobs1, _nobs2):
|
|
242
|
-
return (np.nan, np.nan, np.nan, np.nan)
|
|
248
|
+
return ArrayDouble((np.nan, np.nan, np.nan, np.nan))
|
|
243
249
|
|
|
244
250
|
match method:
|
|
245
251
|
case "Agresti-Caffo":
|
|
@@ -260,7 +266,7 @@ def propn_diff_ci(
|
|
|
260
266
|
case _:
|
|
261
267
|
raise ValueError(f"Method, {f'"{method}"'} not implemented.")
|
|
262
268
|
|
|
263
|
-
return _res
|
|
269
|
+
return ArrayDouble(_res)
|
|
264
270
|
|
|
265
271
|
|
|
266
272
|
def _propn_diff_ci_agresti_caffo(
|
|
@@ -276,7 +282,6 @@ def _propn_diff_ci_agresti_caffo(
|
|
|
276
282
|
Estimate Agresti-Caffo confidence intervals for differences of
|
|
277
283
|
multiple proportions.
|
|
278
284
|
"""
|
|
279
|
-
|
|
280
285
|
_diff_hat = _npos1 / _nobs1 - _npos2 / _nobs2
|
|
281
286
|
|
|
282
287
|
_zsc = norm.ppf(1 - alpha / 2)
|
|
@@ -327,16 +332,18 @@ def _propn_diff_ci_newcombe_score(
|
|
|
327
332
|
|
|
328
333
|
|
|
329
334
|
def _propn_diff_ci_mn(
|
|
330
|
-
_npos1: int = 4,
|
|
331
|
-
_nobs1: int = 10,
|
|
332
|
-
_npos2: int = 4,
|
|
333
|
-
_nobs2: int = 10,
|
|
335
|
+
_npos1: int | np.integer = 4,
|
|
336
|
+
_nobs1: int | np.integer = 10,
|
|
337
|
+
_npos2: int | np.integer = 4,
|
|
338
|
+
_nobs2: int | np.integer = 10,
|
|
334
339
|
/,
|
|
335
340
|
*,
|
|
336
341
|
alpha: float = 0.05,
|
|
337
342
|
method: Literal["M-N", "Mee"] = "M-N",
|
|
338
343
|
) -> tuple[float, float, float, float]:
|
|
339
344
|
"""
|
|
345
|
+
Meittinen-Nurminen (1985; Newcombe (1998)).
|
|
346
|
+
|
|
340
347
|
See Miettinen and Nurminen (1985; Newcombe (1998);
|
|
341
348
|
and StasAndCIs.r -> BinomDiffCi -> "mn".
|
|
342
349
|
|
|
@@ -354,7 +361,7 @@ def _propn_diff_ci_mn(
|
|
|
354
361
|
|
|
355
362
|
_ci_est_start = np.array([(_diff_hat + _s) / 2 for _s in (-1, 1)])
|
|
356
363
|
# Avoid potential corner cases
|
|
357
|
-
_ci_est_offset = (1 - 1.
|
|
364
|
+
_ci_est_offset = (1 - 1.025e-2, 1)
|
|
358
365
|
if _diff_hat == 1.0:
|
|
359
366
|
_ci_est_start += _ci_est_offset
|
|
360
367
|
elif _diff_hat == -1.0:
|
|
@@ -384,8 +391,12 @@ def _propn_diff_chisq_mn(
|
|
|
384
391
|
*,
|
|
385
392
|
method: Literal["M-N", "Mee"] = "M-N",
|
|
386
393
|
) -> float:
|
|
387
|
-
R"""
|
|
388
|
-
|
|
394
|
+
R"""
|
|
395
|
+
Estimate :math:`\chi^2` statistic for a difference in binomial proportions.
|
|
396
|
+
|
|
397
|
+
This :math:`\chi^2` statistic is used in the methods of Meittinen-Nurminen (1985),
|
|
398
|
+
and Newcombe (1998) for estimating confidence intervals for a difference in
|
|
399
|
+
binomial proportions.
|
|
389
400
|
|
|
390
401
|
Parameters
|
|
391
402
|
----------
|
|
@@ -454,7 +465,6 @@ def propn_diff_ci_multinomial(
|
|
|
454
465
|
Array of confidence intervals
|
|
455
466
|
|
|
456
467
|
"""
|
|
457
|
-
|
|
458
468
|
if len(_counts.shape) > 2:
|
|
459
469
|
raise ValueError(
|
|
460
470
|
"This implementation is only valid for estimating confidence intervals "
|
|
@@ -465,7 +475,9 @@ def propn_diff_ci_multinomial(
|
|
|
465
475
|
_var = np.einsum("jk->j", _prob * (1 - _prob) / _counts)[:, None]
|
|
466
476
|
|
|
467
477
|
_d, _d_cr = np.diff(_prob, axis=1), norm.ppf(1 - (alpha / len(_counts)))
|
|
468
|
-
return
|
|
478
|
+
return ArrayDouble(
|
|
479
|
+
np.column_stack([_d + _f * _d_cr * np.sqrt(_var) for _f in (-1, 1)])
|
|
480
|
+
)
|
|
469
481
|
|
|
470
482
|
|
|
471
483
|
@dataclass(slots=True, frozen=True)
|
|
@@ -496,7 +508,6 @@ def propn_test_multinomial(
|
|
|
496
508
|
Estimated statistic, degrees of freedom, critical value, p-value
|
|
497
509
|
|
|
498
510
|
"""
|
|
499
|
-
|
|
500
511
|
_n = np.einsum("jk->", _counts).astype(np.int64)
|
|
501
512
|
_n_k = np.einsum("jk->k", _counts).astype(np.int64)
|
|
502
513
|
_prob = _counts / _n_k
|
mergeron_extra/tol_colors.py
CHANGED
|
@@ -16,6 +16,7 @@ from collections.abc import Callable, Sequence
|
|
|
16
16
|
from typing import Final, Literal, TypeAlias
|
|
17
17
|
|
|
18
18
|
import numpy as np
|
|
19
|
+
from matplotlib import pyplot as plt
|
|
19
20
|
from matplotlib.colors import LinearSegmentedColormap, to_rgba_array
|
|
20
21
|
|
|
21
22
|
|
|
@@ -670,18 +671,55 @@ TCName: TypeAlias = Literal[
|
|
|
670
671
|
"bright", "high-contrast", "vibrant", "muted", "medium-contrast", "light"
|
|
671
672
|
]
|
|
672
673
|
TCNameList: TypeAlias = tuple[TCName, ...]
|
|
673
|
-
Bcset = namedtuple(
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
Bcset = namedtuple(
|
|
675
|
+
"Bcset", ["blue", "red", "green", "yellow", "cyan", "purple", "grey", "black"]
|
|
676
|
+
)
|
|
677
|
+
Hcset = namedtuple("Hcset", ["blue", "yellow", "red", "black"])
|
|
678
|
+
Vcset = namedtuple(
|
|
679
|
+
"Vcset", ["orange", "blue", "cyan", "magenta", "red", "teal", "grey", "black"]
|
|
680
|
+
)
|
|
676
681
|
Muset = namedtuple(
|
|
677
|
-
"Muset",
|
|
682
|
+
"Muset",
|
|
683
|
+
[
|
|
684
|
+
"rose",
|
|
685
|
+
"indigo",
|
|
686
|
+
"sand",
|
|
687
|
+
"green",
|
|
688
|
+
"cyan",
|
|
689
|
+
"wine",
|
|
690
|
+
"teal",
|
|
691
|
+
"olive",
|
|
692
|
+
"purple",
|
|
693
|
+
"pale_grey",
|
|
694
|
+
"black",
|
|
695
|
+
],
|
|
678
696
|
)
|
|
679
697
|
Mcset = namedtuple(
|
|
680
|
-
"Mcset",
|
|
698
|
+
"Mcset",
|
|
699
|
+
[
|
|
700
|
+
"light_blue",
|
|
701
|
+
"dark_blue",
|
|
702
|
+
"light_yellow",
|
|
703
|
+
"dark_red",
|
|
704
|
+
"dark_yellow",
|
|
705
|
+
"light_red",
|
|
706
|
+
"black",
|
|
707
|
+
],
|
|
681
708
|
)
|
|
682
709
|
Lcset = namedtuple(
|
|
683
710
|
"Lcset",
|
|
684
|
-
|
|
711
|
+
[
|
|
712
|
+
"light_blue",
|
|
713
|
+
"orange",
|
|
714
|
+
"light_yellow",
|
|
715
|
+
"pink",
|
|
716
|
+
"light_cyan",
|
|
717
|
+
"mint",
|
|
718
|
+
"pear",
|
|
719
|
+
"olive",
|
|
720
|
+
"pale_grey",
|
|
721
|
+
"black",
|
|
722
|
+
],
|
|
685
723
|
)
|
|
686
724
|
|
|
687
725
|
|
|
@@ -781,7 +819,6 @@ def tol_cset( # noqa: PLR0911
|
|
|
781
819
|
|
|
782
820
|
|
|
783
821
|
def main() -> None:
|
|
784
|
-
from matplotlib import pyplot as plt
|
|
785
822
|
|
|
786
823
|
# Change default colorset (for lines) and colormap (for maps).
|
|
787
824
|
# plt.rc('axes', prop_cycle=plt.cycler('color', list(tol_cset('bright'))))
|
mergeron_extra/xlsxw_helper.py
CHANGED
|
@@ -25,7 +25,7 @@ from __future__ import annotations
|
|
|
25
25
|
|
|
26
26
|
from collections.abc import Sequence
|
|
27
27
|
from types import MappingProxyType
|
|
28
|
-
from typing import Any, ClassVar, Literal,
|
|
28
|
+
from typing import Any, ClassVar, Literal, TypedDict, overload
|
|
29
29
|
|
|
30
30
|
import numpy as np
|
|
31
31
|
from aenum import Enum, extend_enum, unique # type: ignore
|
|
@@ -39,38 +39,39 @@ from . import VERSION
|
|
|
39
39
|
__version__ = VERSION
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
XLBorderType
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
42
|
+
type XLBorderType = (
|
|
43
|
+
Literal[
|
|
44
|
+
"none",
|
|
45
|
+
"thin",
|
|
46
|
+
"medium",
|
|
47
|
+
"dashed",
|
|
48
|
+
"dotted",
|
|
49
|
+
"thick",
|
|
50
|
+
"double",
|
|
51
|
+
"hair",
|
|
52
|
+
"medium_dashed",
|
|
53
|
+
"dash_dot",
|
|
54
|
+
"medium_dash_dot",
|
|
55
|
+
"dash_dot_dot",
|
|
56
|
+
"medium_dash_dot_dot",
|
|
57
|
+
"slant_dash_dot",
|
|
58
|
+
0,
|
|
59
|
+
1,
|
|
60
|
+
2,
|
|
61
|
+
3,
|
|
62
|
+
4,
|
|
63
|
+
5,
|
|
64
|
+
6,
|
|
65
|
+
7,
|
|
66
|
+
8,
|
|
67
|
+
9,
|
|
68
|
+
10,
|
|
69
|
+
11,
|
|
70
|
+
12,
|
|
71
|
+
13,
|
|
72
|
+
]
|
|
73
|
+
| bool
|
|
74
|
+
)
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
class CFmtVal(TypedDict, total=False):
|
|
@@ -91,18 +92,12 @@ class CFmtVal(TypedDict, total=False):
|
|
|
91
92
|
shrink: bool
|
|
92
93
|
bold: bool
|
|
93
94
|
italic: bool
|
|
94
|
-
underline:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
34,
|
|
101
|
-
"single",
|
|
102
|
-
"double",
|
|
103
|
-
"accountingSingle",
|
|
104
|
-
"accountingDouble",
|
|
105
|
-
]
|
|
95
|
+
underline: (
|
|
96
|
+
bool
|
|
97
|
+
| Literal[
|
|
98
|
+
1, 2, 33, 34, "single", "double", "accountingSingle", "accountingDouble"
|
|
99
|
+
]
|
|
100
|
+
)
|
|
106
101
|
font_strikeout: bool
|
|
107
102
|
font_script: Literal[1, 2]
|
|
108
103
|
|
|
@@ -261,7 +256,14 @@ class CFmt(Enum): # type: ignore
|
|
|
261
256
|
def xl_fmt(
|
|
262
257
|
cls,
|
|
263
258
|
_xl_book: Workbook,
|
|
264
|
-
_cell_format:
|
|
259
|
+
_cell_format: CFmt
|
|
260
|
+
| MappingProxyType[CFmtVal, Any]
|
|
261
|
+
| Sequence[
|
|
262
|
+
CFmt
|
|
263
|
+
| MappingProxyType[CFmtVal, Any]
|
|
264
|
+
| Sequence[CFmt | MappingProxyType[CFmtVal, Any]]
|
|
265
|
+
]
|
|
266
|
+
| None,
|
|
265
267
|
/,
|
|
266
268
|
) -> Format:
|
|
267
269
|
"""
|
|
@@ -290,17 +292,17 @@ class CFmt(Enum): # type: ignore
|
|
|
290
292
|
if isinstance(_cell_format, Format):
|
|
291
293
|
return _cell_format
|
|
292
294
|
elif _cell_format is None:
|
|
293
|
-
return _xl_book.add_format(CFmt.XL_DEFAULT.value)
|
|
295
|
+
return _xl_book.add_format(CFmt.XL_DEFAULT.value) # type: ignore
|
|
294
296
|
|
|
295
297
|
_cell_format_dict: CFmtVal = {}
|
|
296
298
|
if isinstance(_cell_format, Sequence):
|
|
297
|
-
cls.ensure_cell_format_spec_tuple(_cell_format)
|
|
299
|
+
cls.ensure_cell_format_spec_tuple(_cell_format) # type: ignore
|
|
298
300
|
for _cf in _cell_format:
|
|
299
301
|
if isinstance(_cf, Sequence):
|
|
300
302
|
for _cfi in _cf:
|
|
301
|
-
_cell_format_dict |= _cfi.value
|
|
303
|
+
_cell_format_dict |= _cfi.value # type: ignore
|
|
302
304
|
else:
|
|
303
|
-
_cell_format_dict |= _cf.value
|
|
305
|
+
_cell_format_dict |= _cf.value # type: ignore
|
|
304
306
|
elif isinstance(_cell_format, CFmt):
|
|
305
307
|
_cell_format_dict = _cell_format.value
|
|
306
308
|
else:
|
|
@@ -502,7 +504,11 @@ def array_to_sheet(
|
|
|
502
504
|
_num_cols = len(_data_table[0])
|
|
503
505
|
_right_column_id = _col_id + _num_cols
|
|
504
506
|
|
|
505
|
-
_cell_format: Sequence[
|
|
507
|
+
_cell_format: Sequence[
|
|
508
|
+
CFmt
|
|
509
|
+
| MappingProxyType[CFmtVal, Any]
|
|
510
|
+
| Sequence[CFmt | MappingProxyType[CFmtVal, Any]]
|
|
511
|
+
]
|
|
506
512
|
if isinstance(cell_format, Sequence):
|
|
507
513
|
if _num_rows > 1 and ragged_flag:
|
|
508
514
|
raise ValueError(
|
|
@@ -517,7 +523,7 @@ def array_to_sheet(
|
|
|
517
523
|
elif isinstance(cell_format, CFmt):
|
|
518
524
|
_cell_format = (cell_format,) * len(_data_table[0])
|
|
519
525
|
else:
|
|
520
|
-
_cell_format = (CFmt.XL_DEFAULT,) * len(_data_table[0])
|
|
526
|
+
_cell_format = (CFmt.XL_DEFAULT,) * len(_data_table[0]) # type: ignore
|
|
521
527
|
|
|
522
528
|
# construct vector of xlslwrter.format.Format objects
|
|
523
529
|
_wbk_formats = tuple(CFmt.xl_fmt(_xl_book, _cf) for _cf in _cell_format)
|
|
@@ -527,7 +533,7 @@ def array_to_sheet(
|
|
|
527
533
|
tuple(
|
|
528
534
|
CFmt.xl_fmt(
|
|
529
535
|
_xl_book,
|
|
530
|
-
(*_cf, CFmt.BAR_FILL)
|
|
536
|
+
(*_cf, CFmt.BAR_FILL) # type: ignore
|
|
531
537
|
if isinstance(_cf, Sequence)
|
|
532
538
|
else (_cf, CFmt.BAR_FILL),
|
|
533
539
|
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mergeron_extra
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.739650.0
|
|
4
4
|
Summary: Tools for users of the mergeron package.
|
|
5
|
-
License: MIT
|
|
5
|
+
License-Expression: MIT
|
|
6
6
|
Author: Murthy Kambhampaty
|
|
7
7
|
Author-email: smk@capeconomics.com
|
|
8
8
|
Requires-Python: >=3.12,<4.0
|
|
@@ -14,13 +14,14 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
19
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
19
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
21
|
-
Requires-Dist: aenum (>=3.1.15
|
|
20
|
+
Requires-Dist: aenum (>=3.1.15)
|
|
22
21
|
Requires-Dist: certifi (>=2023.11.17)
|
|
22
|
+
Requires-Dist: frozendict (>=2.4.7)
|
|
23
23
|
Requires-Dist: matplotlib (>=3.8)
|
|
24
|
+
Requires-Dist: mergeron (>=2026.739636.0)
|
|
24
25
|
Requires-Dist: numpy (>=2.0)
|
|
25
26
|
Requires-Dist: scipy (>=1.12)
|
|
26
27
|
Requires-Dist: xlsxwriter (>=3.1)
|
|
@@ -29,7 +30,7 @@ Description-Content-Type: text/x-rst
|
|
|
29
30
|
mergeron-extra: Support package for users of `mergeron`
|
|
30
31
|
=======================================================
|
|
31
32
|
|
|
32
|
-
Modules potentially useful to users of the :code:`mergeron` package
|
|
33
|
+
Modules potentially useful to users of the :code:`mergeron` package.
|
|
33
34
|
|
|
34
35
|
The module :code:`mergeron_extra.proportions_tests` provides methods for estimating confidence intervals for proportions and for contrasts (differences) in proportions. This module is coded for conformance to the literature and to results from the corresponding modules in :code:`R`. Although written from scratch, the APIs implemented in the module included here are designed for consistency with the APIs in, :code:`statsmodels.stats.proportion` from the package, :code:`statsmodels` (https://pypi.org/project/statsmodels/). To access these directly:
|
|
35
36
|
|
|
@@ -37,7 +38,7 @@ The module :code:`mergeron_extra.proportions_tests` provides methods for estimat
|
|
|
37
38
|
|
|
38
39
|
import mergeron_extra.proportions_tests as prci
|
|
39
40
|
|
|
40
|
-
Module :code:`mergeron_extra.xlsxw_helper` is useful for writing highly formatted output to spreadsheets with xlsx format. The class, :code:`mergeron_extra.xlsxw_helper.CFmt` and function, :code:`mergeron_extra.xlsxw_helper.array_to_sheet` are of particular interest, and can be accessed as :code:`xlh.CFmt` and :code:`xlh.array_to_sheet` with the following import:
|
|
41
|
+
Module :code:`mergeron_extra.xlsxw_helper` is useful for writing highly formatted output to spreadsheets with xlsx format. (Does not re-export the parent package, `xlsxwriter`.) The class, :code:`mergeron_extra.xlsxw_helper.CFmt` and function, :code:`mergeron_extra.xlsxw_helper.array_to_sheet` are of particular interest, and can be accessed as :code:`xlh.CFmt` and :code:`xlh.array_to_sheet` with the following import:
|
|
41
42
|
|
|
42
43
|
.. code-block:: python
|
|
43
44
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
mergeron_extra/__init__.py,sha256=49kLOqlUfALOT5bwCXQHpjh6g2lNhciSGx4r7tQrguc,399
|
|
2
|
+
mergeron_extra/proportions_tests.py,sha256=GWQ6rMhphe1XL55m8tuccGwshN9Tms9wmrfEZjpeaRw,15524
|
|
3
|
+
mergeron_extra/py.types,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
mergeron_extra/tol_colors.py,sha256=9x83ymz5xcmHAVmDzifLe_GZWvL03c7hxbKQW6XPLek,22626
|
|
5
|
+
mergeron_extra/xlsxw_helper.py,sha256=WW8sSqPSChlVsi60r2W4HSRB52ZWlEp35d1StHJa1HQ,19358
|
|
6
|
+
mergeron_extra-2026.739650.0.dist-info/METADATA,sha256=D2s5bB3KU_o7iCqVl93F4wgkrURv6tIEzV-c8Fezwxc,3620
|
|
7
|
+
mergeron_extra-2026.739650.0.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
8
|
+
mergeron_extra-2026.739650.0.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
mergeron_extra/__init__.py,sha256=ar78FdYer0GhrcAwnlBGsTruLHKB9D_SHvgIT0XWP1w,399
|
|
2
|
-
mergeron_extra/proportions_tests.py,sha256=3mctgM09M8Aee3l1zAlsYW1t962Ndzvb6bZkd7NHp7c,15019
|
|
3
|
-
mergeron_extra/py.types,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
mergeron_extra/tol_colors.py,sha256=EgajNpN-BAlsD__E_-CgzGDRGy7j0rO97KpCTDdbZSc,22225
|
|
5
|
-
mergeron_extra/xlsxw_helper.py,sha256=8OMolNzSIqyTEkBW8Oh0Vsb02nvI9Qv4MNDlm0Kc5tI,18947
|
|
6
|
-
mergeron_extra-2024.739148.7.dist-info/METADATA,sha256=7UkLlFqqWDw8TKtfFoCo9yNUYO1kCHqpjL3Lrhk_f_4,3742
|
|
7
|
-
mergeron_extra-2024.739148.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
8
|
-
mergeron_extra-2024.739148.7.dist-info/RECORD,,
|