Repository navigation
Conversation
russlan23
force-pushed
the
agent/fix-dataframe-information-ratio
branch
from
August 8, 2026 09:16
3626cea to
69a6f9a
Compare
russlan23
marked this pull request as ready for review
August 8, 2026 09:17
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> # Conflicts: # tests/test_core.py
timkpaine
pushed a commit
that referenced
this pull request
Sep 5, 2026
DataFrame-minus-Series subtraction aligns the Series against the frame's columns, so calc_prob_mom returned an all-NaN array the length of the calendar instead of one probability per column. Subtract along the index for that shape, and restore the column labels that t.cdf drops. This is the same defect fixed in calc_information_ratio by #310 and in to_excess_returns by #324. calc_prob_mom calls calc_information_ratio, so the two disagreed on identical inputs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
calc_information_ratioworks for a Series, but a DataFrame's tracking-error calculation returns a Series of per-column standard deviations. The current scalar guard then asks pandas to coerce that Series to a single Boolean and raisesValueError: The truth value of a Series is ambiguous.Fix
Handle DataFrame results per column. Columns with valid tracking error return their information ratio; zero or missing tracking error returns
0.0, matching the function's existing Series convention.The regression covers both a varying active-return series and a zero-tracking-error series.
Testing
python -m pytest -q- 63 passedpython -m ruff check ffn docs/source/conf.py- passedgit diff --check- passedAI assistance was used to scan for the untested DataFrame path and help draft the regression. I reproduced the failure in a clean Python 3.13 container and reviewed the implementation, expectations, and final diff before publication.