Skip to content

Rank sort_by="ruined" survivors first, as documented - #161

Merged
wdm0006 merged 1 commit into
masterfrom
autopilot/issue-160
Oct 25, 2026
Merged

wdm0006 merged 1 commit into
masterfrom
autopilot/issue-160

Conversation

@wdm0006

@wdm0006 wdm0006 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Closes #160

Summary

"ruined" is now in _ASCENDING in keeks/comparison.py, so sort_by="ruined" ranks survivors (False) before ruined policies (True) in both compare_strategies and compare_multi_outcome_strategies (they share _rank). The compare_strategies docstring already said "max_drawdown and ruined rank smaller first", so no docs changed. The multi-outcome function reuses the same sort-key contract.

Changelog: CHANGELOG.md has no unreleased section (v0.9.0 is already tagged), so I left it alone.

Verification

  • pytest tests/test_comparison.py tests/test_compare_multi_outcome.py: 68 passed.
  • Mutation: removing "ruined" from _ASCENDING fails both new tests (2 failed, 66 passed). Restored and re-ran green.
  • The new tests mix survivors and ruined policies, interleaved in factory order, and assert both the order and that ties keep factory order.
  • Full suite: 3780 passed, 2 skipped, 94 failed. All 94 are tests/test_bit_exactness.py golden-fixture failures that already fail on master here (CPython 3.13 / NumPy 2.5.3) and are unrelated to this change.
  • ruff check and ruff format --check pass.

Screenshots

n/a — no user-visible change.

@wdm0006
wdm0006 merged commit 2ed4afc into master Oct 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[autopilot] Rank sort_by="ruined" survivors first, as the docstring promises

1 participant