Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (some) non-tuple index warnings #8936

Merged
merged 3 commits into from
Jun 19, 2018
Merged

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Jun 16, 2018

As a companion to gh-8879, fix the non-tuple index warnings in signal, interpolate and stats.

@ev-br ev-br added the maintenance Items related to regular maintenance tasks label Jun 16, 2018
Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable to me, +1 for merge

@@ -2546,7 +2546,7 @@ def __init__(self, shape):
self._v = np.arange(np.prod(shape)).reshape(shape)

def __getitem__(self, idx):
return self._v[idx]
return self._v[tuple(idx)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make more sense to let the error propagate here, and fix it at the caller instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I failed to trigger this warning with the numpy HEAD, so I've just reverted this change.

@@ -488,7 +488,7 @@ def _reverse_and_conj(x):
Reverse array `x` in all dimensions and perform the complex conjugate
"""
reverse = [slice(None, None, -1)] * x.ndim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just change this one to a tuple literal rather than a list

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done

@larsoner larsoner merged commit 2597c46 into scipy:master Jun 19, 2018
@larsoner
Copy link
Member

Thanks @ev-br

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants