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

Implement masked view #102

Merged

Conversation

martinRenou
Copy link
Member

No description provided.

@martinRenou martinRenou force-pushed the implement_masked_view branch 3 times, most recently from ce98bfb to b441e3b Compare June 15, 2018 07:15
@martinRenou martinRenou force-pushed the implement_masked_view branch 2 times, most recently from 987380b to a2a9418 Compare June 21, 2018 15:36
@martinRenou martinRenou force-pushed the implement_masked_view branch 2 times, most recently from 3b3fe1f to dedb521 Compare June 22, 2018 09:53
@martinRenou martinRenou changed the title WIP: Implement masked view Implement masked view Jun 25, 2018
@martinRenou
Copy link
Member Author

@wolfv
Copy link
Member

wolfv commented Jun 25, 2018

what's the equivalent to a masked_view in pandas / xarray?

@wolfv
Copy link
Member

wolfv commented Jun 25, 2018

ok, i see it's the where op in xarray.

template <class S>
disable_integral_t<S, reference> operator[](const S& index);
template <class I>
reference operator[](std::initializer_list<I> index);
Copy link
Member

Choose a reason for hiding this comment

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

I think we should not make this an initializer_list of any more. I've noted the same for xtensor. There is a cost when it get's casted from int32 to int64 which can be avoided by making it size_t from the start.

Copy link
Member Author

Choose a reason for hiding this comment

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

So you want me to remove it completely ? Isn't it a breaking change in xtensor ?

Copy link
Member

Choose a reason for hiding this comment

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

actually we need to define what we make it i guess.
I think it should take an index_type (i.e. std::array<std::size_t, ... > or svector<size_t>) then we can still easily construct it from an initializer list.

we need to discuss this (anyways, since it is implemented like this in xtensor, we can prob keep it for now :)

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 I see :) maybe we should open an issue in xtensor ?

@JohanMabille JohanMabille merged commit 530f7f9 into xtensor-stack:master Jul 4, 2018
@martinRenou martinRenou deleted the implement_masked_view branch July 17, 2018 07:56
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.

3 participants