dycw-utilities 0.151.11__py3-none-any.whl → 0.151.12__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.151.11.dist-info → dycw_utilities-0.151.12.dist-info}/METADATA +1 -1
- {dycw_utilities-0.151.11.dist-info → dycw_utilities-0.151.12.dist-info}/RECORD +7 -8
- utilities/__init__.py +1 -1
- utilities/polars.py +34 -1
- utilities/dnspython.py +0 -17
- {dycw_utilities-0.151.11.dist-info → dycw_utilities-0.151.12.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.151.11.dist-info → dycw_utilities-0.151.12.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.151.11.dist-info → dycw_utilities-0.151.12.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=CToBsJ7ahHohUxklvuPmWZ4QaYXiq2IS6xmnb7POeZo,61
|
2
2
|
utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
|
3
3
|
utilities/asyncio.py,sha256=r75HVwm6QoCOz7bEe3_KO47G4_IIhNCYcPDrJTi4i_4,16777
|
4
4
|
utilities/atomicwrites.py,sha256=tPo6r-Rypd9u99u66B9z86YBPpnLrlHtwox_8Z7T34Y,5790
|
@@ -11,7 +11,6 @@ utilities/contextvars.py,sha256=J8OhC7jqozAGYOCe2KUWysbPXNGe5JYz3HfaY_mIs08,883
|
|
11
11
|
utilities/cryptography.py,sha256=_CiK_K6c_-uQuUhsUNjNjTL-nqxAh4_1zTfS11Xe120,972
|
12
12
|
utilities/cvxpy.py,sha256=Rv1-fD-XYerosCavRF8Pohop2DBkU3AlFaGTfD8AEAA,13776
|
13
13
|
utilities/dataclasses.py,sha256=G05UH-fqUbcRPjQ8arK6K0Ap2fRbzEm0SZahJKCqYfY,32643
|
14
|
-
utilities/dnspython.py,sha256=HfFaxjA_25XhjsTM5Bg03GCFatKzL8dOV4E0c9oMsho,384
|
15
14
|
utilities/enum.py,sha256=5l6pwZD1cjSlVW4ss-zBPspWvrbrYrdtJWcg6f5_J5w,5781
|
16
15
|
utilities/errors.py,sha256=mFlDGSM0LI1jZ1pbqwLAH3ttLZ2JVIxyZLojw8tGVZU,1479
|
17
16
|
utilities/eventkit.py,sha256=FRCZisJfY9hAS9GHV4ZO3ZHDs89XZod7Xf99WzBt7jQ,12636
|
@@ -47,7 +46,7 @@ utilities/pathlib.py,sha256=77wT9naY2Nnrbar8nJiIYd2r3MfabMQM9VguuuivrdQ,8481
|
|
47
46
|
utilities/period.py,sha256=c4-N8N1GIUyomoHmSO7yPfYgK8tc__dxNSB79knlx2w,12471
|
48
47
|
utilities/pickle.py,sha256=MBT2xZCsv0pH868IXLGKnlcqNx2IRVKYNpRcqiQQqxw,653
|
49
48
|
utilities/platform.py,sha256=pTn7gw6N4T6LdKrf0virwarof_mze9WtoQlrGMzhGVI,2798
|
50
|
-
utilities/polars.py,sha256=
|
49
|
+
utilities/polars.py,sha256=uxV4liIQoCO92aERDO-AMfa8Es_-xCKgwZoyTO3PazQ,74410
|
51
50
|
utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
|
52
51
|
utilities/postgres.py,sha256=juXaOguCCX4oAw4y2JajRVIhhKKZarCyapNyyr4Tn4Q,12538
|
53
52
|
utilities/pottery.py,sha256=u0uvyGgYyujxftEMlsv6ppYTKQoVVjHt5jnVxxYz9s4,6596
|
@@ -89,8 +88,8 @@ utilities/zoneinfo.py,sha256=FBMcUQ4662Aq8SsuCL1OAhDQiyANmVjtb-C30DRrWoE,1966
|
|
89
88
|
utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
90
89
|
utilities/pytest_plugins/pytest_randomly.py,sha256=NXzCcGKbpgYouz5yehKb4jmxmi2SexKKpgF4M65bi10,414
|
91
90
|
utilities/pytest_plugins/pytest_regressions.py,sha256=Iwhfv_OJH7UCPZCfoh7ugZ2Xjqjil-BBBsOb8sDwiGI,1471
|
92
|
-
dycw_utilities-0.151.
|
93
|
-
dycw_utilities-0.151.
|
94
|
-
dycw_utilities-0.151.
|
95
|
-
dycw_utilities-0.151.
|
96
|
-
dycw_utilities-0.151.
|
91
|
+
dycw_utilities-0.151.12.dist-info/METADATA,sha256=NGGUpkviTSqFVd23pWs_5MGWRsb6OLal8p1dbJWqMIc,1697
|
92
|
+
dycw_utilities-0.151.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.151.12.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
|
94
|
+
dycw_utilities-0.151.12.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.151.12.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/polars.py
CHANGED
@@ -7,7 +7,7 @@ from collections.abc import Set as AbstractSet
|
|
7
7
|
from contextlib import suppress
|
8
8
|
from dataclasses import asdict, dataclass
|
9
9
|
from functools import partial, reduce
|
10
|
-
from itertools import chain, product
|
10
|
+
from itertools import chain, pairwise, product
|
11
11
|
from math import ceil, log
|
12
12
|
from pathlib import Path
|
13
13
|
from typing import TYPE_CHECKING, Any, Literal, assert_never, cast, overload, override
|
@@ -1471,6 +1471,37 @@ class _GetSeriesNumberOfDecimalsAllNullError(GetSeriesNumberOfDecimalsError):
|
|
1471
1471
|
##
|
1472
1472
|
|
1473
1473
|
|
1474
|
+
@overload
|
1475
|
+
def increasing_horizontal(*columns: ExprLike) -> Expr: ...
|
1476
|
+
@overload
|
1477
|
+
def increasing_horizontal(*columns: Series) -> Series: ...
|
1478
|
+
@overload
|
1479
|
+
def increasing_horizontal(*columns: IntoExprColumn) -> Expr | Series: ...
|
1480
|
+
def increasing_horizontal(*columns: IntoExprColumn) -> Expr | Series:
|
1481
|
+
"""Check if a set of columns are increasing."""
|
1482
|
+
columns2 = ensure_expr_or_series_many(*columns)
|
1483
|
+
if len(columns2) == 0:
|
1484
|
+
return lit(value=True, dtype=Boolean)
|
1485
|
+
return all_horizontal(prev < curr for prev, curr in pairwise(columns2))
|
1486
|
+
|
1487
|
+
|
1488
|
+
@overload
|
1489
|
+
def decreasing_horizontal(*columns: ExprLike) -> Expr: ...
|
1490
|
+
@overload
|
1491
|
+
def decreasing_horizontal(*columns: Series) -> Series: ...
|
1492
|
+
@overload
|
1493
|
+
def decreasing_horizontal(*columns: IntoExprColumn) -> Expr | Series: ...
|
1494
|
+
def decreasing_horizontal(*columns: IntoExprColumn) -> Expr | Series:
|
1495
|
+
"""Check if a set of columns are decreasing."""
|
1496
|
+
columns2 = ensure_expr_or_series_many(*columns)
|
1497
|
+
if len(columns2) == 0:
|
1498
|
+
return lit(value=True, dtype=Boolean)
|
1499
|
+
return all_horizontal(prev > curr for prev, curr in pairwise(columns2))
|
1500
|
+
|
1501
|
+
|
1502
|
+
##
|
1503
|
+
|
1504
|
+
|
1474
1505
|
def insert_after(df: DataFrame, column: str, value: IntoExprColumn, /) -> DataFrame:
|
1475
1506
|
"""Insert a series after an existing column; not in-place."""
|
1476
1507
|
columns = df.columns
|
@@ -2472,6 +2503,7 @@ __all__ = [
|
|
2472
2503
|
"cross",
|
2473
2504
|
"dataclass_to_dataframe",
|
2474
2505
|
"dataclass_to_schema",
|
2506
|
+
"decreasing_horizontal",
|
2475
2507
|
"deserialize_dataframe",
|
2476
2508
|
"drop_null_struct_series",
|
2477
2509
|
"ensure_data_type",
|
@@ -2483,6 +2515,7 @@ __all__ = [
|
|
2483
2515
|
"get_expr_name",
|
2484
2516
|
"get_frequency_spectrum",
|
2485
2517
|
"get_series_number_of_decimals",
|
2518
|
+
"increasing_horizontal",
|
2486
2519
|
"insert_after",
|
2487
2520
|
"insert_before",
|
2488
2521
|
"insert_between",
|
utilities/dnspython.py
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from ipaddress import IPv4Address
|
4
|
-
|
5
|
-
from dns.resolver import resolve
|
6
|
-
|
7
|
-
from utilities.functools import cache
|
8
|
-
|
9
|
-
|
10
|
-
@cache
|
11
|
-
def nslookup(address: str, /) -> list[IPv4Address]:
|
12
|
-
"""Look up a set of addresses."""
|
13
|
-
ans = resolve(address) # skipif-ci-and-mac
|
14
|
-
return [IPv4Address(str(rd)) for rd in ans] # skipif-ci-and-mac
|
15
|
-
|
16
|
-
|
17
|
-
__all__ = ["nslookup"]
|
File without changes
|
File without changes
|
File without changes
|