v0.20.0 -- Full s3 event parse and PDF creation. #28
@@ -54,14 +54,26 @@ log = logging.getLogger("backfill_sidecars")
|
|||||||
|
|
||||||
|
|
||||||
def _looks_like_event_file(path: Path) -> bool:
|
def _looks_like_event_file(path: Path) -> bool:
|
||||||
"""Same heuristic as the importer CLI."""
|
"""Same heuristic as the importer CLI.
|
||||||
|
|
||||||
|
Filters to BW (Series III) event files only — Thor (Series IV)
|
||||||
|
`.IDFW` / `.IDFH` files share the store but have their own ingest
|
||||||
|
path (`WaveformStore.save_imported_idf`) and are NOT decodable by
|
||||||
|
`event_file_io.read_blastware_file`. Their sidecars are populated
|
||||||
|
at ingest from the paired `.IDFW.txt` ASCII report; nothing the
|
||||||
|
backfill regenerates would improve on them, so we exclude them
|
||||||
|
from scope.
|
||||||
|
"""
|
||||||
if not path.is_file():
|
if not path.is_file():
|
||||||
return False
|
return False
|
||||||
if path.name.endswith((".a5.pkl", ".sfm.json")):
|
if path.name.endswith((".a5.pkl", ".sfm.json", ".h5")):
|
||||||
return False
|
return False
|
||||||
ext = path.suffix.lstrip(".")
|
ext = path.suffix.lstrip(".")
|
||||||
if not (3 <= len(ext) <= 4):
|
if not (3 <= len(ext) <= 4):
|
||||||
return False
|
return False
|
||||||
|
# Thor IDF files share the .{W,H}-suffix shape but aren't BW.
|
||||||
|
if ext.upper() in ("IDFW", "IDFH"):
|
||||||
|
return False
|
||||||
if not (ext[-1].upper() in {"W", "H"} or ext.endswith("0")):
|
if not (ext[-1].upper() in {"W", "H"} or ext.endswith("0")):
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user