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

Add "where" based ufunc masked array support decorator #98

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DocOtak
Copy link
Contributor

@DocOtak DocOtak commented Jun 25, 2022

This PR replaces the match_args_return decorator in _wrapped_ufuncs with the one proposed/discussed in #97 (comment) .

I don't think it's ready for merging: needs tests, more discussion, and the non ufunc functions need to be considered. But I wanted to show what a change like this might look like.

@efiring
Copy link
Member

efiring commented Oct 8, 2022

This certainly looks more elegant than what I originally came up with. I'm entirely open
to making the switch once it's clear it won't break anything.

@ocefpaf
Copy link
Member

ocefpaf commented Oct 10, 2022

@DocOtak and @efiring I believe that we should mint a new release with the latest changes and fixes. Should we wait to include this PR in it or should we release it now and mint a fresh one when this is done?

@efiring
Copy link
Member

efiring commented Oct 10, 2022

I think it makes sense to release both GSW-C and GSW-Python now.

@DocOtak
Copy link
Contributor Author

DocOtak commented Oct 10, 2022

I agree, don't wait on this PR.

@ocefpaf
Copy link
Member

ocefpaf commented Oct 11, 2022

I think it makes sense to release both GSW-C and GSW-Python now.

Done and done!

@DocOtak
Copy link
Contributor Author

DocOtak commented Oct 13, 2022

I am interested in continuing work on this, but would appreciate some guidance. This decorator does not work with the non ufunc functions we have.

Reading through my code comments, I think I should at least make it clear that the where=True ufunc default is the default of all ufuncs by numpy definition, not just here in this decorator. i.e. if you don't pass a where arg, numpy passes True for you.

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.

None yet

3 participants