Inital Version
This commit is contained in:
commit
94cd6b984b
211 changed files with 4765 additions and 0 deletions
15
tools/check_real_frames.py
Normal file
15
tools/check_real_frames.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""Assert explicitly labeled real FITS examples against persisted automatic decisions."""
|
||||
import json,sys
|
||||
from pathlib import Path
|
||||
p=json.loads(Path(sys.argv[1] if len(sys.argv)>1 else 'projects/Sample Survey/project.json').read_text(encoding='utf-8'))
|
||||
if not p['Complete']:
|
||||
raise SystemExit('Analysis is incomplete; no classification regression result can be reported.')
|
||||
labels=json.loads(Path('tests/real-frame-labels.json').read_text(encoding='utf-8'))['frames']
|
||||
by_name={Path(f['Path']).name:f for f in p['Frames']}
|
||||
failures=0
|
||||
for label in labels:
|
||||
f=by_name[label['file']];actual=f['Automatic'];good=actual==label['expected'];failures+=not good
|
||||
print(f"{'PASS' if good else 'FAIL'} {label['file']}: {actual} -> expected {label['expected']}")
|
||||
print(' '+f['Cause'])
|
||||
print(f'{len(labels)-failures}/{len(labels)} real regression examples pass. These examples do not establish general accuracy.')
|
||||
sys.exit(1 if failures else 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue