Files
NODEDC_MISSION_CORE/simulation/urban-plan-research/survey_index.py
T
DCCONSTRUCTIONS 69dc566665 feat(research): preserve urban geometry pipelines and qualification suites
Preserve offline geometry, marking, replay and evaluation pipelines with source manifests and synthetic tests. Research qualification does not activate these methods as production navigation.
2026-10-29 09:10:00 +03:00

24 lines
1.1 KiB
Python

"""Read surveyed observations by manifest identity, never filename convention."""
from pathlib import Path
import json
def surveyed_ids(root,*,evidence=None):
root=Path(root);index=json.loads((root/'tile-index.json').read_text())
names=[]
for tile in index['tiles']:
if tile['status']!='surveyed':continue
name=tile['id']
if not isinstance(name,str) or not name or name in {'.','..'} or '/'in name or '\\'in name:
raise ValueError('Invalid observation identity')
names.append(name)
if not names:raise ValueError('Survey manifest contains no completed observations')
if len(set(names))!=len(names):raise ValueError('Duplicate observation identity')
for name in names:
required=[root/name/'job.json',root/name/'top.geometry.npz']
if evidence is not None:
e=Path(evidence);required += [e/(name+'.normal.npz'),e/'road-prompt'/(name+'.normal.npz')]
for path in required:
if not path.is_file():raise ValueError('Incomplete surveyed observation: '+str(path))
return sorted(names)