You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cluster_pilots.py shows a traceback for a bad --k and leaves outputs when --truth is invalid #232
Describe the bug
Two behaviours of inference/cluster_pilots.py on the #225 branch. An out-of-range --k ends in a raw ValueError traceback. If --truth is invalid, the group and centre CSVs have already been written when the error is raised, so a failed run leaves half its outputs.
To Reproduce
Run generate_synthetic_pilots.py, then compute_features.py on its output.
python inference/cluster_pilots.py --k 1 prints a traceback ending ValueError: k must be 2 to 5 for 15 pilots, got 1.
Repeat a row in inference/Data/synthetic_pilot_tiers.csv, then run python inference/cluster_pilots.py --k 3 --truth inference/Data/synthetic_pilot_tiers.csv. pilot_clusters.csv and group_centres.csv are written, then ValueError: Pilot(s) repeated in truth: P01.
Expected behavior
A one-line usage error and exit status 2 for a bad --k, as --truth without --k already gives. No output files when the run fails.
Screenshots
Not applicable.
Additional context
Fit and score first, then write; use parser.error for input errors. Needs CLI tests in tests/test_cluster_pilots.py.
Activity