Uh oh!
There was an error while loading. Please reload this page.
Implement an equivalent to numpy.roll - #1823
Conversation
serge-sans-paille
commented
Nov 27, 2019
It's just a WIP, when there's no axis given. Feel free to comment, I'm new to xtensor's internal. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c89e666 to
77fb3e6CompareThere was a problem hiding this comment.
I didn't notice the first time (maybe you switched to another machine), it seems that the indentation in the roll function is 2 spaces instead of 4 (like it is in the cpp for testing or other functions in the header).
Once the nformatting is fixed, do you want this PR to be merged and to implement the overload taking an axis parameter in another PR? Or do you prefer to implement everything in a single PR?
| } | ||
| template<class E> | ||
| inline auto roll(E&& e, std::ptrdiff_t shift) { |
There was a problem hiding this comment.
Formatting: opening curly brace should be on a new line
| std::copy(eflat_view.begin(), eflat_view.begin() + shift, | ||
| std::copy(eflat_view.begin() + shift, eflat_view.end(), cpyflat_view.begin())); | ||
| } | ||
| else { |
77fb3e6 to
e7a7c2fCompareserge-sans-paille
commented
Nov 29, 2019
Validation fixed and comments taken into account!
I'll implement the axis stuff first, if that's okay with you. |
e7a7c2f to
46ab9ccCompare
JohanMabille
left a comment
There was a problem hiding this comment.
I think you still have a mix of 2 spaces and 4 spaces indentation.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JohanMabille
commented
Dec 1, 2019
Also regarding travis-ci:
|
fba18d3 to
fb1ba45Compareserge-sans-paille
commented
Dec 2, 2019
@JohanMabille everything looks fine now? |
fb1ba45 to
1c0aeefCompareJohanMabille
commented
Dec 2, 2019
Almost, it seems that the indentation is still 2 spaces instead of 4. |
JohanMabille
commented
Dec 2, 2019
Also notice that the error on travisci will disappear when the PR is merged (or if it is rebased on master before merging). |
JohanMabille
commented
Dec 2, 2019
There are actually other parts of the library with 2 spaces indentation, let's merge as is, I will do another pass to clean everything at once. |
Fix#1766