Skip to content

Fix _tp() to always return pandas Series - #202

Merged
jealous merged 1 commit into
masterfrom
fix-tp-return-series
Jan 24, 2026
Merged

jealous merged 1 commit into
masterfrom
fix-tp-return-series

Conversation

@jealous

@jealous jealous commented Jan 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix _tp() method to consistently return a pandas Series regardless of whether amount column is present
  • When amount column exists, the method was returning a numpy array instead of a Series, causing issues in downstream indicators like MFI
  • Added test case for MFI calculation when amount column is present
  • Version bump to 0.6.7

Test plan

  • Added test_mfi_with_amount test to verify MFI works correctly with amount column
  • Run full test suite with pytest --cov=stockstats test.py
  • Verify flake8 passes

🤖 Generated with Claude Code

When amount column is present, _tp() was returning a numpy array instead
of a pandas Series, causing inconsistent behavior in downstream indicators
like MFI. Now both code paths consistently return a Series via to_series().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jealous
jealous merged commit df5ae63 into master Jan 24, 2026
4 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.

1 participant