merge: dev into feat/series4-sfm-parity -- v0.32.0, #42, #47/#49, #44/#45, the S3 decode checker
Brings the branch up to dev (41 commits) before the 1c bench fixes, which touch code dev changed: the histogram reader (#47/#49, bench finding #2), the v0.32.0 event-time rules, the Blastware file's setup-block fields (#44/#45), and the decode checker for verifying stored S3 downloads. One conflict: the top of the Series-III reference's change table -- both sides added rows; kept all, in date order, CRLF preserved. CLAUDE.md, README, blastware_file.py, models.py and database.py merged cleanly. Suite: the known 16 failures only (15 test_bw_ascii_report, test_save_imported_bw_without_report_ works_unchanged, which also fails on dev); 1237 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
commit
342c69602d
54 files changed
+22279
-264
No files matched your search
@@ -152,6 +152,7 @@ from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import re
|
||||
import struct
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union
|
||||
@@ -416,6 +417,31 @@ def _make_stem(ts_local: datetime.datetime) -> str:
|
||||
return s
|
||||
|
||||
|
||||
_BW_NAME = re.compile(r"^[B-Z]\d{3}([0-9A-Z]{4})\.([0-9A-Z]{2})0[WH]?$")
|
||||
|
||||
|
||||
def blastware_filename_time(name: str) -> Optional[datetime.datetime]:
|
||||
"""The event time a Blastware filename encodes, or None for any other name.
|
||||
|
||||
The inverse of `blastware_filename`: `<prefix><serial3><stem 4>.<AB>0[W|H]`,
|
||||
time = 1985-01-01 + stem*1296 + AB seconds. This is Blastware's own time
|
||||
to the second -- it equals the report's Event Time on 1,330/1,330
|
||||
report-paired waveforms (81 prod-store, 1,249 DL2) and the report's
|
||||
Histogram Start Time on 13,089/13,089 histograms (measured 2026-10-26).
|
||||
Only the V10.72 `AB0` form is decoded; anything else gives None.
|
||||
"""
|
||||
m = _BW_NAME.match((name or "").upper())
|
||||
if not m:
|
||||
return None
|
||||
stem = 0
|
||||
for c in m.group(1):
|
||||
stem = stem * 36 + _STEM_CHARS.index(c)
|
||||
ab = _STEM_CHARS.index(m.group(2)[0]) * 36 + _STEM_CHARS.index(m.group(2)[1])
|
||||
if ab >= _STEM_UNIT_SEC:
|
||||
return None
|
||||
return _INSTANTEL_EPOCH + datetime.timedelta(seconds=stem * _STEM_UNIT_SEC + ab)
|
||||
|
||||
|
||||
def blastware_filename(event: Event, serial: str, ach: bool = False) -> str:
|
||||
"""
|
||||
Return the correct Blastware filename for an event.
|
||||
|
||||
Reference in new issue
Block a user