Repository navigation
Conversation
Signed-off-by: Tim Paine <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #386 +/- ##
===========================================
+ Coverage 57.32% 81.02% +23.70%
===========================================
Files 4 4
Lines 1174 1481 +307
Branches 254 304 +50
===========================================
+ Hits 673 1200 +527
+ Misses 435 217 -218
+ Partials 66 64 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was previously deployed
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.
Problem
When
PerformanceStatsreceives a risk-free price series on a denser calendar than the asset, daily excess returns currently compare different holding intervals. For example, a Friday-to-Monday asset return is reduced by the benchmark's Sunday-to-Monday return.This produces nonzero excess performance even when the asset is the risk-free holding itself:
On the base commit this prints
11.224972160321826 inf. Both holdings have identical endpoint prices, so interval excess returns are zero; both ratios should beNaN, consistent with the existing zero-excess convention.Change
The existing daily price-series expectation in
test_performance_stats_reuses_excess_returnsintentionally changes: it previously preserved returns calculated on the benchmark's own calendar. Its scalar/dtype/call-count checks and monthly/yearly expectations remain. New regression tests cover equal holdings on daily/business/gapped/intraday calendars, nonzero excess returns with a missing endpoint, GroupStats date-range rebuilding, and mixed timezone rejection.Validation
All test inputs were synthetic or bundled fixtures; runtime networking was disabled. These checks do not establish all dependency versions, exact intraday fixing-time equivalence, or correctness of the unchanged monthly/yearly alignment.
AI assistance disclosure: Claude Code (Opus 5.5) identified the caller issue and proposed this patch; Codex independently reproduced it, ran the tests/oracles, reviewed the change, and prepared this PR.