Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit c15b280

Browse files
authored
Merge pull request #147 from jepler/update-pre-commit
2 parents e7abe54 + f3b865f commit c15b280

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: reuse
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
2323
# Ruff version.
24-
rev: v0.11.7
24+
rev: v0.12.1
2525
hooks:
2626
# Run the linter.
2727
- id: ruff

src/uwwvb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: GPL-3.0-only
44

5-
# ruff: noqa: C405 PYI024 PLR2004 FBT001 FBT002
5+
# ruff: noqa: C405, PYI024, FBT001, FBT002
66

77
"""Implementation of a WWVB state machine & decoder for resource-constrained systems
88

src/wwvb/__init__.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def __new__( # noqa: PYI034
384384
minute: int,
385385
dst: DstStatus | int | None = None,
386386
ut1: int | None = None,
387+
*,
387388
ls: bool | None = None,
388389
ly: bool | None = None,
389390
) -> WWVBMinute:
@@ -659,15 +660,15 @@ def _fill_pm_timecode(self, t: WWVBTimecode) -> None:
659660
else:
660661
self._fill_pm_timecode_regular(t)
661662

662-
def next_minute(self, newut1: int | None = None, newls: bool | None = None) -> WWVBMinute:
663+
def next_minute(self, *, newut1: int | None = None, newls: bool | None = None) -> WWVBMinute:
663664
"""Return an object representing the next minute"""
664665
d = self.as_datetime() + datetime.timedelta(minutes=1)
665-
return self.from_datetime(d, newut1, newls, self)
666+
return self.from_datetime(d, newut1=newut1, newls=newls, old_time=self)
666667

667-
def previous_minute(self, newut1: int | None = None, newls: bool | None = None) -> WWVBMinute:
668+
def previous_minute(self, *, newut1: int | None = None, newls: bool | None = None) -> WWVBMinute:
668669
"""Return an object representing the previous minute"""
669670
d = self.as_datetime() - datetime.timedelta(minutes=1)
670-
return self.from_datetime(d, newut1, newls, self)
671+
return self.from_datetime(d, newut1=newut1, newls=newls, old_time=self)
671672

672673
@classmethod
673674
def _get_dut1_info(cls: type, year: int, days: int, old_time: WWVBMinute | None = None) -> tuple[int, bool]: # noqa: ARG003
@@ -696,18 +697,19 @@ def fromstring(cls, s: str) -> WWVBMinute:
696697
days = d.pop("days")
697698
hour = d.pop("hour")
698699
minute = d.pop("minute")
699-
dst: int | None = d.pop("dst", None)
700-
ut1: int | None = d.pop("ut1", None)
700+
dst = d.pop("dst", None)
701+
ut1 = d.pop("ut1", None)
701702
ls = d.pop("ls", None)
702703
d.pop("ly", None)
703704
if d:
704705
raise ValueError(f"Invalid options: {d}")
705-
return cls(year, days, hour, minute, dst, ut1, None if ls is None else bool(ls))
706+
return cls(year, days, hour, minute, dst, ut1=ut1, ls=None if ls is None else bool(ls))
706707

707708
@classmethod
708709
def from_datetime(
709710
cls,
710711
d: datetime.datetime,
712+
*,
711713
newut1: int | None = None,
712714
newls: bool | None = None,
713715
old_time: WWVBMinute | None = None,
@@ -760,7 +762,7 @@ def from_timecode_am(cls, t: WWVBTimecode) -> WWVBMinute | None: # noqa: PLR091
760762
dst = t._get_am_bcd(57, 58)
761763
if dst is None:
762764
return None
763-
return cls(year, days, hour, minute, dst, ut1, ls, ly)
765+
return cls(year, days, hour, minute, dst, ut1, ls=ls, ly=ly)
764766

765767

766768
class WWVBMinuteIERS(WWVBMinute):
@@ -858,7 +860,7 @@ def _put_am_bcd(self, v: int, *poslist: int) -> None:
858860
else:
859861
self.am[p] = AmplitudeModulation.ZERO
860862

861-
def _put_pm_bit(self, i: int, v: PhaseModulation | int | bool) -> None:
863+
def _put_pm_bit(self, i: int, v: PhaseModulation | int) -> None:
862864
"""Update a bit of the Phase Modulation signal"""
863865
self.phase[i] = PhaseModulation(v)
864866

test/testuwwvb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# SPDX-License-Identifier: GPL-3.0-only
66

7-
# ruff: noqa: N802 D102
7+
# ruff: noqa: N802
88
import datetime
99
import random
1010
import sys

test/testwwvb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/python3
2-
# ruff: noqa: E501
32

43
"""Test most wwvblib functionality"""
54

0 commit comments

Comments
 (0)