dycw-utilities 0.146.7__py3-none-any.whl → 0.146.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.146.7
3
+ Version: 0.146.9
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=xHIuMHU5Lm8NKguNzEs3sy-FGAfuCc6tlT3xVRB7S4w,60
1
+ utilities/__init__.py,sha256=TuChRb5OgNhC1Cunka6x7TS6wN_8B5wyF2sdqO2Ugew,60
2
2
  utilities/aiolimiter.py,sha256=mD0wEiqMgwpty4XTbawFpnkkmJS6R4JRsVXFUaoitSU,628
3
3
  utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
4
4
  utilities/asyncio.py,sha256=aB0EtUbUJ5ZKQ5ET-Xfyx6wfUJG2G4vihEX0blK4TGE,14964
@@ -50,7 +50,7 @@ utilities/platform.py,sha256=Ue9LSxYvg9yUXGKuz5aZoy_qkUEXde-v6B09exgSctU,2813
50
50
  utilities/polars.py,sha256=BgiDryAVOapi41ddfJqN0wYh_sDj8BNEYtPB36LaHdo,71824
51
51
  utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
52
52
  utilities/postgres.py,sha256=jAxd0ouhpt5J42JuegcTsR95nFFEYpQw3rYgQQKGFpU,7607
53
- utilities/pottery.py,sha256=qGW0jhu9Dl93jeCrvvUtXmHC6bdCmK6z71XWqPcCKQg,6908
53
+ utilities/pottery.py,sha256=doqA59CMGvErUTK3vubTUe1sYqY90VvdnIjws4W5Ta0,6953
54
54
  utilities/pqdm.py,sha256=BTsYPtbKQWwX-iXF4qCkfPG7DPxIB54J989n83bXrIo,3092
55
55
  utilities/psutil.py,sha256=KUlu4lrUw9Zg1V7ZGetpWpGb9DB8l_SSDWGbANFNCPU,2104
56
56
  utilities/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -86,14 +86,14 @@ utilities/tzlocal.py,sha256=KyCXEgCTjqGFx-389JdTuhMRUaT06U1RCMdWoED-qro,728
86
86
  utilities/uuid.py,sha256=32p7DGHGM2Btx6PcBvCZvERSWbpupMXqx6FppPoSoTU,612
87
87
  utilities/version.py,sha256=ufhJMmI6KPs1-3wBI71aj5wCukd3sP_m11usLe88DNA,5117
88
88
  utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
89
- utilities/whenever.py,sha256=QGlPSKSIQGbvSFIIaTvS6UQUidz8hgrcmUS0qEaU_qA,44847
89
+ utilities/whenever.py,sha256=nG9IbFcJTKQJuRxoS35I7ww7pRwKHc1MHxff7vVmJls,44131
90
90
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
91
91
  utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
92
92
  utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
93
93
  utilities/pytest_plugins/pytest_randomly.py,sha256=NXzCcGKbpgYouz5yehKb4jmxmi2SexKKpgF4M65bi10,414
94
94
  utilities/pytest_plugins/pytest_regressions.py,sha256=Iwhfv_OJH7UCPZCfoh7ugZ2Xjqjil-BBBsOb8sDwiGI,1471
95
- dycw_utilities-0.146.7.dist-info/METADATA,sha256=iPBqEyCoD2sRzMeE9eX5VPXYA1bYFRvqyzR_1OvhjhE,1697
96
- dycw_utilities-0.146.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
97
- dycw_utilities-0.146.7.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
98
- dycw_utilities-0.146.7.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
99
- dycw_utilities-0.146.7.dist-info/RECORD,,
95
+ dycw_utilities-0.146.9.dist-info/METADATA,sha256=g3UwlF7SBgSmylm4_hxRi7glD9L-M9RgeN-DkAxVdK0,1697
96
+ dycw_utilities-0.146.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
97
+ dycw_utilities-0.146.9.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
98
+ dycw_utilities-0.146.9.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
99
+ dycw_utilities-0.146.9.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.146.7"
3
+ __version__ = "0.146.9"
utilities/pottery.py CHANGED
@@ -109,7 +109,9 @@ class CoroutineLooper:
109
109
  message="coroutine '.*' was never awaited", category=RuntimeWarning
110
110
  ):
111
111
  del coro
112
- get_logger(logger=self.logger).error("Error running %r", name)
112
+ get_logger(logger=self.logger).error(
113
+ "Error running %r", name, exc_info=True
114
+ )
113
115
 
114
116
 
115
117
  ##
utilities/whenever.py CHANGED
@@ -316,20 +316,16 @@ def min_max_date(
316
316
  max_age: DateDelta | None = None,
317
317
  time_zone: TimeZoneLike = UTC,
318
318
  ) -> tuple[Date | None, Date | None]:
319
- """Ucompute the min/max date given a combination of dates/ages."""
319
+ """Compute the min/max date given a combination of dates/ages."""
320
320
  today = get_today(time_zone=time_zone)
321
321
  min_parts: list[Date] = []
322
322
  if min_date is not None:
323
- if min_date > today:
324
- raise _MinMaxDateMinDateError(min_date=min_date, today=today)
325
323
  min_parts.append(min_date)
326
324
  if max_age is not None:
327
325
  min_parts.append(today - max_age)
328
326
  min_date_use = max(min_parts, default=None)
329
327
  max_parts: list[Date] = []
330
328
  if max_date is not None:
331
- if max_date > today:
332
- raise _MinMaxDateMaxDateError(max_date=max_date, today=today)
333
329
  max_parts.append(max_date)
334
330
  if min_age is not None:
335
331
  max_parts.append(today - min_age)
@@ -344,34 +340,13 @@ def min_max_date(
344
340
 
345
341
 
346
342
  @dataclass(kw_only=True, slots=True)
347
- class MinMaxDateError(Exception): ...
348
-
349
-
350
- @dataclass(kw_only=True, slots=True)
351
- class _MinMaxDateMinDateError(MinMaxDateError):
343
+ class MinMaxDateError(Exception):
352
344
  min_date: Date
353
- today: Date
354
-
355
- @override
356
- def __str__(self) -> str:
357
- return f"Min date must be at most today; got {self.min_date} > {self.today}"
358
-
359
-
360
- @dataclass(kw_only=True, slots=True)
361
- class _MinMaxDateMaxDateError(MinMaxDateError):
362
345
  max_date: Date
363
- today: Date
364
-
365
- @override
366
- def __str__(self) -> str:
367
- return f"Max date must be at most today; got {self.max_date} > {self.today}"
368
346
 
369
347
 
370
348
  @dataclass(kw_only=True, slots=True)
371
349
  class _MinMaxDatePeriodError(MinMaxDateError):
372
- min_date: Date
373
- max_date: Date
374
-
375
350
  @override
376
351
  def __str__(self) -> str:
377
352
  return (