Skip to content

Rollaxis always return view - #5464

Merged
jaimefrio merged 3 commits into
numpy:masterfrom
charris:rollaxis-always-return-view
Jan 19, 2015
Merged

jaimefrio merged 3 commits into
numpy:masterfrom
charris:rollaxis-always-return-view

Conversation

@charris

@charris charris commented Jan 19, 2015

Copy link
Copy Markdown
Member

Rollaxiis did not returned a view unless the axis order was unchanged, in which case it returned the input array. This PR makes it always return a view and adds tests, of which there were none before.

@charris

charris commented Jan 19, 2015

Copy link
Copy Markdown
Member Author

See also #5260.

@jnothman

Copy link
Copy Markdown
Member

I assume you'll fix up swapaxes too?

@charris

charris commented Jan 19, 2015

Copy link
Copy Markdown
Member Author

Thinking about it :)

Comment thread numpy/core/tests/test_numeric.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Iteration over a dictionary is over the keys by default, no need for the .keys() here.

Previous to this commit, rollaxis returned a view unless the order of
the axis was unchanged, in which case the input array was returned.
There were no tests previous to this.
@charris
charris force-pushed the rollaxis-always-return-view branch from a315925 to cf41fce Compare January 19, 2015 16:16
@charris

charris commented Jan 19, 2015

Copy link
Copy Markdown
Member Author

@jaimefrio Fixed, thanks for the review.

jaimefrio added a commit that referenced this pull request Jan 19, 2015
@jaimefrio
jaimefrio merged commit 4ed1587 into numpy:master Jan 19, 2015
@jaimefrio

Copy link
Copy Markdown
Member

Merged, thanks!

@charris
charris deleted the rollaxis-always-return-view branch January 19, 2015 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants