Conversation
…nal setitem Fixes bukosabino#354, bukosabino#357, bukosabino#339, bukosabino#348. In PSARIndicator._run, one assignment (self._psar[i] = high2) used bare positional __setitem__ while the surrounding code already used .iloc[i] consistently. This triggers pandas' FutureWarning for Series.__setitem__ positional indexing and is inconsistent with the rest of the method, as reported independently across four issues. Changed to self._psar.iloc[i] = high2 to match the rest of the method.
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.
Summary
Fixes #354, #357, #339, #348 — all four report the same root cause independently.
In
PSARIndicator._run(ta/trend.py), one line uses bare positional indexing:Every other read/write of
self._psarin this method already goes through.iloc[i]. The one exception triggers pandas'FutureWarning: Series.__setitem__ treating keys as positions is deprecated(reported in #357, #339, #348) and was also flagged directly as an indexing inconsistency in #354, which includes the exact proposed fix.Change
→
One line, no behavior change —
.iloc[i]and positional[i]currently resolve to the same element for this integer-indexed Series; the fix only removes the deprecated code path and makes the method internally consistent.Test plan
self._psarin the method — all other accesses already use.iloc.