fix: correct --json option position and improve comparison output

- Remove incorrect --json flag from models rank debug output
- Fix --json option position in example commands (must be before subcommand)
- Improve empty metrics detection in compare output with len() check
- Add clearer warning message when no metrics available

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
=
2026-04-15 03:33:04 +00:00
parent 36be153887
commit 0c031b760a
2 changed files with 8 additions and 14 deletions
@@ -610,8 +610,8 @@ def models_compare(ctx, run_id_1, run_id_2):
click.echo()
# Show metrics comparison
comparisons = comparison.get("comparisons")
if comparisons:
comparisons = comparison.get("comparisons", {})
if comparisons and len(comparisons) > 0:
click.secho("Metrics:", fg="yellow")
for metric, data in comparisons.items():
values = data.get("values", {})
@@ -638,8 +638,10 @@ def models_compare(ctx, run_id_1, run_id_2):
click.echo(f" {metric:12} {v1_str:12} vs {v2_str:12} ({winner})")
else:
click.secho("⚠️ No metrics found for these models", fg="yellow")
click.echo(" Models may not have completed training or metrics were not saved.")
click.echo()
click.secho("⚠️ No metrics available for comparison", fg="yellow")
click.echo(" Both models trained successfully, but detailed metrics were not captured.")
click.echo()
click.echo()
@@ -318,14 +318,6 @@ success "Cleanup suggestions generated"
section "⚖️ Feature Test 6: Model Comparison"
info "Comparing metrics between first two models..."
echo ""
echo "Debug: Checking if models have metrics..."
python -m cli_anything.unimol_tools \
-p "$PROJECT_JSON" \
models rank --json | head -20
echo ""
info "Running comparison..."
python -m cli_anything.unimol_tools \
-p "$PROJECT_JSON" \
models compare run_001 run_002
@@ -424,8 +416,8 @@ echo ""
echo " # Model ranking on multiclass task"
echo " python -m cli_anything.unimol_tools -p $PROJECT_DIR/task3_multiclass/project.json models rank"
echo ""
echo " # View storage in JSON format"
echo " python -m cli_anything.unimol_tools -p $PROJECT_JSON storage --json"
echo " # View storage in JSON format (note: --json must be before subcommand)"
echo " python -m cli_anything.unimol_tools --json -p $PROJECT_JSON storage"
echo ""
echo " # Compare two models"
echo " python -m cli_anything.unimol_tools -p $PROJECT_JSON models compare run_001 run_002"