dycw-utilities 0.138.11__py3-none-any.whl → 0.138.13__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.
- {dycw_utilities-0.138.11.dist-info → dycw_utilities-0.138.13.dist-info}/METADATA +2 -2
- {dycw_utilities-0.138.11.dist-info → dycw_utilities-0.138.13.dist-info}/RECORD +8 -8
- utilities/__init__.py +1 -1
- utilities/polars.py +21 -0
- utilities/whenever.py +22 -0
- {dycw_utilities-0.138.11.dist-info → dycw_utilities-0.138.13.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.138.11.dist-info → dycw_utilities-0.138.13.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.138.11.dist-info → dycw_utilities-0.138.13.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dycw-utilities
|
3
|
-
Version: 0.138.
|
3
|
+
Version: 0.138.13
|
4
4
|
Author-email: Derek Wan <d.wan@icloud.com>
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.12
|
@@ -12,7 +12,7 @@ Provides-Extra: logging
|
|
12
12
|
Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'logging'
|
13
13
|
Provides-Extra: test
|
14
14
|
Requires-Dist: dycw-pytest-only<2.2,>=2.1.1; extra == 'test'
|
15
|
-
Requires-Dist: hypothesis<6.136,>=6.135.
|
15
|
+
Requires-Dist: hypothesis<6.136,>=6.135.16; extra == 'test'
|
16
16
|
Requires-Dist: pudb<2025.2,>=2025.1; extra == 'test'
|
17
17
|
Requires-Dist: pytest-asyncio<1.1,>=1.0.0; extra == 'test'
|
18
18
|
Requires-Dist: pytest-cov<6.2,>=6.1.1; extra == 'test'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=H_o_NgK-Ik1btEjTSpGwNncTNEm929ZR7pKgfRuqfHU,61
|
2
2
|
utilities/aiolimiter.py,sha256=mD0wEiqMgwpty4XTbawFpnkkmJS6R4JRsVXFUaoitSU,628
|
3
3
|
utilities/altair.py,sha256=HeZBVUocjkrTNwwKrClppsIqgNFF-ykv05HfZSoHYno,9104
|
4
4
|
utilities/asyncio.py,sha256=dcGeKQzjLBXxKzZkVIk5oZsFXEcynVbRB9iNB5XEDZk,38526
|
@@ -46,7 +46,7 @@ utilities/pathlib.py,sha256=5p9MI8m7iUFksNVGiLavN4MZ3cj1CpBiLBlgaCR0LCs,8334
|
|
46
46
|
utilities/period.py,sha256=6jEff_qAiE7xdFaQ1DnKgNf10D2wHhzt7hQXCBoKlgc,6842
|
47
47
|
utilities/pickle.py,sha256=MBT2xZCsv0pH868IXLGKnlcqNx2IRVKYNpRcqiQQqxw,653
|
48
48
|
utilities/platform.py,sha256=5uCKRf_ij7ukJDcbnNfhY2ay9fbrpiNLRO1t2QvcwqQ,2825
|
49
|
-
utilities/polars.py,sha256=
|
49
|
+
utilities/polars.py,sha256=Q7eGBZ-P3tg2HXVk-rF7yceodeuPoj-sfPbYWawqyRM,63886
|
50
50
|
utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
|
51
51
|
utilities/pottery.py,sha256=RN3XwOEsVAPXvEfsRPmn3ZSKgTzK_c182PNrtksq-bg,3429
|
52
52
|
utilities/pqdm.py,sha256=BTsYPtbKQWwX-iXF4qCkfPG7DPxIB54J989n83bXrIo,3092
|
@@ -85,11 +85,11 @@ utilities/tzlocal.py,sha256=KyCXEgCTjqGFx-389JdTuhMRUaT06U1RCMdWoED-qro,728
|
|
85
85
|
utilities/uuid.py,sha256=32p7DGHGM2Btx6PcBvCZvERSWbpupMXqx6FppPoSoTU,612
|
86
86
|
utilities/version.py,sha256=ufhJMmI6KPs1-3wBI71aj5wCukd3sP_m11usLe88DNA,5117
|
87
87
|
utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
88
|
-
utilities/whenever.py,sha256=
|
88
|
+
utilities/whenever.py,sha256=z2x79yEElAEaQ3roWC8LFl-rwFuv4WgcFiGQoAbSVJA,22004
|
89
89
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
90
90
|
utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
|
91
|
-
dycw_utilities-0.138.
|
92
|
-
dycw_utilities-0.138.
|
93
|
-
dycw_utilities-0.138.
|
94
|
-
dycw_utilities-0.138.
|
95
|
-
dycw_utilities-0.138.
|
91
|
+
dycw_utilities-0.138.13.dist-info/METADATA,sha256=XM3QnEEq6J7ZY99VLuNV6kqaRrfGabIAkgoD9eh1mUw,1639
|
92
|
+
dycw_utilities-0.138.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.138.13.dist-info/entry_points.txt,sha256=uLj5QWWVXv8tnMaRX3ZGYpt7w1xzLWU6LxbFhELEpkc,68
|
94
|
+
dycw_utilities-0.138.13.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.138.13.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/polars.py
CHANGED
@@ -1833,6 +1833,26 @@ def normal(
|
|
1833
1833
|
##
|
1834
1834
|
|
1835
1835
|
|
1836
|
+
@overload
|
1837
|
+
def order_of_magnitude(column: ExprLike, /, *, round_: bool = False) -> Expr: ...
|
1838
|
+
@overload
|
1839
|
+
def order_of_magnitude(column: Series, /, *, round_: bool = False) -> Series: ...
|
1840
|
+
@overload
|
1841
|
+
def order_of_magnitude(
|
1842
|
+
column: IntoExprColumn, /, *, round_: bool = False
|
1843
|
+
) -> Expr | Series: ...
|
1844
|
+
def order_of_magnitude(
|
1845
|
+
column: IntoExprColumn, /, *, round_: bool = False
|
1846
|
+
) -> Expr | Series:
|
1847
|
+
"""Compute the order of magnitude of a column."""
|
1848
|
+
column = ensure_expr_or_series(column)
|
1849
|
+
result = column.abs().log10()
|
1850
|
+
return result.round().cast(Int64) if round_ else result
|
1851
|
+
|
1852
|
+
|
1853
|
+
##
|
1854
|
+
|
1855
|
+
|
1836
1856
|
def reify_exprs(
|
1837
1857
|
*exprs: IntoExprColumn, **named_exprs: IntoExprColumn
|
1838
1858
|
) -> Expr | Series | DataFrame:
|
@@ -2184,6 +2204,7 @@ __all__ = [
|
|
2184
2204
|
"nan_sum_agg",
|
2185
2205
|
"nan_sum_cols",
|
2186
2206
|
"normal",
|
2207
|
+
"order_of_magnitude",
|
2187
2208
|
"replace_time_zone",
|
2188
2209
|
"set_first_row_as_columns",
|
2189
2210
|
"struct_dtype",
|
utilities/whenever.py
CHANGED
@@ -552,6 +552,26 @@ def to_local_plain(date_time: ZonedDateTime, /) -> PlainDateTime:
|
|
552
552
|
##
|
553
553
|
|
554
554
|
|
555
|
+
def to_months(delta: DateDelta, /) -> int:
|
556
|
+
"""Compute the number of months in a date delta."""
|
557
|
+
months, days = delta.in_months_days()
|
558
|
+
if days != 0:
|
559
|
+
raise ToMonthsError(days=days)
|
560
|
+
return months
|
561
|
+
|
562
|
+
|
563
|
+
@dataclass(kw_only=True, slots=True)
|
564
|
+
class ToMonthsError(Exception):
|
565
|
+
days: int
|
566
|
+
|
567
|
+
@override
|
568
|
+
def __str__(self) -> str:
|
569
|
+
return f"Date delta must not contain days; got {self.days}"
|
570
|
+
|
571
|
+
|
572
|
+
##
|
573
|
+
|
574
|
+
|
555
575
|
def to_nanos(delta: DateTimeDelta, /) -> int:
|
556
576
|
"""Compute the number of nanoseconds in a date-time delta."""
|
557
577
|
try:
|
@@ -801,6 +821,7 @@ __all__ = [
|
|
801
821
|
"MeanDateTimeError",
|
802
822
|
"MinMaxDateError",
|
803
823
|
"ToDaysError",
|
824
|
+
"ToMonthsError",
|
804
825
|
"ToNanosError",
|
805
826
|
"ToPyTimeDeltaError",
|
806
827
|
"WheneverLogRecord",
|
@@ -819,6 +840,7 @@ __all__ = [
|
|
819
840
|
"to_date_time_delta",
|
820
841
|
"to_days",
|
821
842
|
"to_local_plain",
|
843
|
+
"to_months",
|
822
844
|
"to_nanos",
|
823
845
|
"to_py_time_delta",
|
824
846
|
"to_zoned_date_time",
|
File without changes
|
File without changes
|
File without changes
|