Merge pull request #131 from jepler/small-fixes

churn to appease ruff & remove debugging print
This commit is contained in:
Jeff Epler 2025-03-17 16:52:41 -05:00 committed by GitHub
commit 91cb807104
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -49,7 +49,6 @@ def _maybe_warn_update(dt: datetime.date, stacklevel: int = 1) -> None:
# If the date is less than 300 days after today, there should be (possibly)
# prospective available now.
today = datetime.datetime.now(tz=datetime.timezone.utc).date()
print(f"_mwu {today=!r} {dt=!r} {iersdata.end=!r}")
if _date(dt) < today + datetime.timedelta(days=330):
warnings.warn(
"Note: Running `updateiers` may provide better DUT1 and LS information",
@ -727,7 +726,7 @@ class WWVBMinuteIERS(WWVBMinute):
@classmethod
def _get_dut1_info(cls, year: int, days: int, old_time: WWVBMinute | None = None) -> tuple[int, bool]: # noqa: ARG003
d = datetime.datetime(year, 1, 1, tzinfo=datetime.timezone.utc) + datetime.timedelta(days - 1)
return int(round(get_dut1(d) * 10)) * 100, isls(d)
return round(get_dut1(d) * 10) * 100, isls(d)
def _bcd_bits(n: int) -> Generator[bool, None, None]:

View file

@ -52,7 +52,7 @@ def update_iersdata( # noqa: PLR0915
offs_str = r["UT1-UTC"]
if not offs_str:
break
offs = int(round(float(offs_str) * 10))
offs = round(float(offs_str) * 10)
if not offsets:
table_start = datetime.date(1858, 11, 17) + datetime.timedelta(jd)
@ -98,7 +98,7 @@ def update_iersdata( # noqa: PLR0915
cells = row.findAll("td")
when = datetime.datetime.strptime(cells[0].text + "+0000", "%Y-%m-%d%z").date()
dut1 = cells[2].text.replace("s", "").replace(" ", "")
dut1 = int(round(float(dut1) * 10))
dut1 = round(float(dut1) * 10)
if wwvb_dut1 is not None:
assert wwvb_start is not None
patch(wwvb_start, when, wwvb_dut1)