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

np.where with broadcasting #3630

Merged
merged 8 commits into from Jan 30, 2019
Merged

np.where with broadcasting #3630

merged 8 commits into from Jan 30, 2019

Conversation

rjenc29
Copy link
Contributor

@rjenc29 rjenc29 commented Dec 28, 2018

Small extension to np.where to support use cases like:

a = np.linspace(-2, 5, 20).reshape(4, 5)
cond = a > 0
mask = np.where(cond, 1, 0)

Initial commit for CI.

@codecov-io
Copy link

codecov-io commented Dec 28, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7d8fca1). Click here to learn what that means.
The diff coverage is 82%.

@@           Coverage Diff            @@
##             master   #3630   +/-   ##
========================================
  Coverage          ?   80.5%           
========================================
  Files             ?     395           
  Lines             ?   81117           
  Branches          ?    9234           
========================================
  Hits              ?   65300           
  Misses            ?   14389           
  Partials          ?    1428

@rjenc29
Copy link
Contributor Author

rjenc29 commented Dec 28, 2018

Hi, let me know what you think of this relatively simple extension. Could arguably be taken further either in this PR or subsequently; might have incremental utility on its own.

@rjenc29 rjenc29 changed the title [WIP] np.where with broadcasting np.where with broadcasting Dec 28, 2018
@stuartarchibald stuartarchibald added this to the Numba 0.43 RC milestone Dec 28, 2018
@stuartarchibald
Copy link
Contributor

Thanks for the patches. Am I right in thinking that this is with view of closing #3339 ?

@rjenc29
Copy link
Contributor Author

rjenc29 commented Jan 3, 2019

I hadn't spotted that one to be honest, but it should fit the bill. It was more of a thought experiment which turned into a PR :)

@stuartarchibald
Copy link
Contributor

This is pending update RE #3650

@stuartarchibald stuartarchibald added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Jan 9, 2019
@rjenc29
Copy link
Contributor Author

rjenc29 commented Jan 12, 2019

The last commit should extend support to cover some basic use cases.

Let me know what you think, ta!

@sklam sklam added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Jan 15, 2019
@sklam sklam added this to Need Review in Active Jan 15, 2019
@sklam sklam moved this from Need Review to Reviewed... discussion/fixes taking place in Active Jan 15, 2019
@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Jan 30, 2019
Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

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

Thanks for the patch, adding support for these additional cases is really useful. Looks good to merge.

@sklam sklam merged commit 92a40f4 into numba:master Jan 30, 2019
Active automation moved this from Reviewed... discussion/fixes taking place to Done Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants