Repository navigation
fix(examples): use real backtest-harness API in adapter example/test - #16
Merged
Merged
Conversation
…r example and test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
examples/backtest_adapter.pyandtests/integration/test_backtest_adapter.pycalledbacktest_harness.load_kalshi_sample_trades()and passedseed=toMonteCarloSimulator.simulate_equity_paths. Neither exists in verdict-backtest (git log --all -S load_kalshi_sample_tradesin verdict-backtest: no hits).The breakage was hidden: CI does not install verdict-backtest, so
pytest.importorskipalways skipped the test.Proof on master with verdict-backtest (origin/master 537c3d1) installed:
python examples/backtest_adapter.py→ImportError: cannot import name 'load_kalshi_sample_trades'pytest tests/integration→ 1 failedFix: use the real public, seeded entry point
backtest_harness.run_counterfactual. The test now also checks that the same seed gives the sameresults_hashacross the package boundary.After the fix, with verdict-backtest installed: the example runs, and
pytest tests/integrationgives 3 passed, 1 skipped. In the default CI env: 53 passed, 3 skipped. Ruff check and format pass.Follow-up, not in this PR: install verdict-backtest in one CI job so the skip no longer hides failures.
(The marker warning is fixed separately in #14.)