mergeron_extra 2024.739148.5__py3-none-any.whl → 2024.739148.6__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/xlsxw_helper.py +14 -16
- {mergeron_extra-2024.739148.5.dist-info → mergeron_extra-2024.739148.6.dist-info}/METADATA +2 -1
- mergeron_extra-2024.739148.6.dist-info/RECORD +8 -0
- {mergeron_extra-2024.739148.5.dist-info → mergeron_extra-2024.739148.6.dist-info}/WHEEL +1 -1
- mergeron_extra-2024.739148.5.dist-info/RECORD +0 -8
mergeron_extra/__init__.py
CHANGED
mergeron_extra/xlsxw_helper.py
CHANGED
|
@@ -219,7 +219,7 @@ class CFmt(Enum): # type: ignore
|
|
|
219
219
|
|
|
220
220
|
"""
|
|
221
221
|
|
|
222
|
-
return extend_enum(cls, _fmt_name, _xlsx_fmt_dict) # type: ignore
|
|
222
|
+
return extend_enum(cls, _fmt_name, MappingProxyType(_xlsx_fmt_dict)) # type: ignore
|
|
223
223
|
|
|
224
224
|
@classmethod
|
|
225
225
|
def ensure_cell_format_spec_tuple(
|
|
@@ -492,7 +492,7 @@ def array_to_sheet(
|
|
|
492
492
|
raise _err
|
|
493
493
|
elif not (
|
|
494
494
|
isinstance(_data_table, Sequence | np.ndarray)
|
|
495
|
-
and
|
|
495
|
+
and isinstance(_data_table[0], Sequence | np.ndarray)
|
|
496
496
|
):
|
|
497
497
|
raise ValueError("Given array must be two-dimensional array.")
|
|
498
498
|
|
|
@@ -553,9 +553,9 @@ def array_to_sheet(
|
|
|
553
553
|
def scalar_to_sheet(
|
|
554
554
|
_xl_book: Workbook,
|
|
555
555
|
_xl_sheet: Worksheet,
|
|
556
|
-
_cell_addr_0: str | int = "A1",
|
|
557
556
|
/,
|
|
558
|
-
*_s2s_args: Any,
|
|
557
|
+
*_s2s_args: tuple[str, Any, CFmt | Sequence[CFmt | Sequence[CFmt]] | None]
|
|
558
|
+
| tuple[int, int, Any, CFmt | Sequence[CFmt | Sequence[CFmt]] | None],
|
|
559
559
|
) -> None:
|
|
560
560
|
"""
|
|
561
561
|
Write to a single cell in a worksheet.
|
|
@@ -594,21 +594,21 @@ def scalar_to_sheet(
|
|
|
594
594
|
|
|
595
595
|
_cell_addr: tuple[str] | tuple[int, int]
|
|
596
596
|
_cell_val: Any
|
|
597
|
-
_cell_fmt: CFmt | Sequence[CFmt] | None
|
|
597
|
+
_cell_fmt: CFmt | Sequence[CFmt | Sequence[CFmt]] | None
|
|
598
598
|
|
|
599
|
-
if isinstance(
|
|
600
|
-
if len(_s2s_args) not in (
|
|
599
|
+
if isinstance(_s2s_args[0], str):
|
|
600
|
+
if len(_s2s_args) not in (2, 3):
|
|
601
601
|
raise ValueError("Incorrect number of arguments.")
|
|
602
|
-
_cell_addr = (
|
|
602
|
+
_cell_addr = (_s2s_args[0],)
|
|
603
603
|
_cell_val = _s2s_args[0]
|
|
604
604
|
_cell_fmt = _s2s_args[1] if len(_s2s_args) == 2 else None
|
|
605
|
-
elif isinstance(
|
|
606
|
-
if
|
|
605
|
+
elif isinstance(_s2s_args[0], int):
|
|
606
|
+
if not isinstance(_s2s_args[1], int) or len(_s2s_args) not in (3, 4):
|
|
607
607
|
print(repr(_s2s_args))
|
|
608
608
|
raise ValueError("Incorrect/incomplete specification for Excel cell data.")
|
|
609
|
-
_cell_addr =
|
|
610
|
-
_cell_val = _s2s_args[
|
|
611
|
-
_cell_fmt = _s2s_args[
|
|
609
|
+
_cell_addr = _s2s_args[:2]
|
|
610
|
+
_cell_val = _s2s_args[2]
|
|
611
|
+
_cell_fmt = _s2s_args[3] if len(_s2s_args) == 3 else None
|
|
612
612
|
else:
|
|
613
613
|
raise ValueError("Incorrect/incomplete specification for Excel cell data.")
|
|
614
614
|
|
|
@@ -617,9 +617,7 @@ def scalar_to_sheet(
|
|
|
617
617
|
if np.ndim(_cell_val) or _cell_val in (np.inf, -np.inf, np.nan)
|
|
618
618
|
else (*_cell_addr, _cell_val)
|
|
619
619
|
)
|
|
620
|
-
_write_args
|
|
621
|
-
(*_write_args, CFmt.xl_fmt(_xl_book, _cell_fmt)) if _cell_fmt else _write_args
|
|
622
|
-
)
|
|
620
|
+
_write_args += (CFmt.xl_fmt(_xl_book, _cell_fmt),) if _cell_fmt else ()
|
|
623
621
|
|
|
624
622
|
if _cell_val is None or _cell_val == "":
|
|
625
623
|
_xl_sheet.write_blank(*_write_args)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mergeron_extra
|
|
3
|
-
Version: 2024.739148.
|
|
3
|
+
Version: 2024.739148.6
|
|
4
4
|
Summary: Tools for users of the mergeron package.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Murthy Kambhampaty
|
|
@@ -15,6 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
20
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
20
21
|
Requires-Dist: aenum (>=3.1.15,<4.0.0)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
mergeron_extra/__init__.py,sha256=YPeb33DBYedoQAwmhXCenycYZPJ3XeDLOu691SvzeaI,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=4mEGhmNG3aVHBHVWcaqI6qCvRLr_pogSGumxNubq_k8,18635
|
|
6
|
+
mergeron_extra-2024.739148.6.dist-info/METADATA,sha256=Y5cIaeq-35dxs5cmRe0FhFVKFThTU3o2SldQr-R8kZw,3742
|
|
7
|
+
mergeron_extra-2024.739148.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
8
|
+
mergeron_extra-2024.739148.6.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
mergeron_extra/__init__.py,sha256=OnjolnFPlLiClpGmO6wF3L9qWYFafA8v0mYzSmKV67w,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=pCLhffuyxNNdjWRejoL6DVdVAjuLkaJ3BPcwk5IXeFE,18540
|
|
6
|
-
mergeron_extra-2024.739148.5.dist-info/METADATA,sha256=mljwpNIFZrUEVjnfQ6dWKxdZHD6V6ZiQqbdk1g4OvY0,3691
|
|
7
|
-
mergeron_extra-2024.739148.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
8
|
-
mergeron_extra-2024.739148.5.dist-info/RECORD,,
|