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 Cython functions as Numpy ufuncs #72

Closed
lpsinger opened this issue Apr 17, 2018 · 4 comments · Fixed by #110
Closed

Implement Cython functions as Numpy ufuncs #72

lpsinger opened this issue Apr 17, 2018 · 4 comments · Fixed by #110
Assignees
Labels
Milestone

Comments

@lpsinger
Copy link
Contributor

This will eliminate the need for all of the manual broadcasting and type checking.

I have written lots of examples in plain C, but there are also examples in Cython.

@astrofrog
Copy link
Member

That would be nice! My only hesitation is that we might lose the benefits of multi-threading? (I don't think Numpy applies ufuncs in a multi-threaded way?)

@lpsinger
Copy link
Contributor Author

My only hesitation is that we might lose the benefits of multi-threading? (I don't think Numpy applies ufuncs in a multi-threaded way?)

Sure, you can run ufuncs in multithreaded code. Nothing stops you from releasing the GIL inside your ufunc loop function.

@lpsinger
Copy link
Contributor Author

Actually, looking at the Numpy source code, I kind of think that Numpy itself releases the GIL while it is calling your ufunc loop function.

@astrofrog
Copy link
Member

astrofrog commented Apr 22, 2018

@lpsinger - ok cool! If this is something you fancy working on, please feel free to as I don't know much about ufuncs :)

lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Apr 24, 2018
This eliminates the need for much of the explicit broadasting and
type checking.

At the moment, the patch just implements `healpix_to_lonlat_ring`.
I'd like to ask for feedback on the basic approach before
undertaking conversion of the other functions.

Fixes astropy#72.
@cdeil cdeil added the question label Apr 24, 2018
@cdeil cdeil added this to the 1.0 milestone Apr 24, 2018
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Apr 24, 2018
This eliminates the need for much of the explicit broadasting and
type checking.

At the moment, the patch just implements `healpix_to_lonlat`.
I'd like to ask for feedback on the basic approach before
undertaking conversion of the other functions.

Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Apr 24, 2018
This eliminates the need for much of the explicit broadasting and
type checking.

At the moment, the patch just implements `healpix_to_lonlat`.
I'd like to ask for feedback on the basic approach before
undertaking conversion of the other functions.

Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Apr 24, 2018
This eliminates the need for much of the explicit broadasting and
type checking.

At the moment, the patch just implements `healpix_to_lonlat`.
I'd like to ask for feedback on the basic approach before
undertaking conversion of the other functions.

Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Apr 24, 2018
This eliminates the need for much of the explicit broadasting and
type checking.

At the moment, the patch just implements `healpix_to_lonlat`.
I'd like to ask for feedback on the basic approach before
undertaking conversion of the other functions.

Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically. Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically. Fixes astropy#72.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 30, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 31, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 31, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
lpsinger added a commit to lpsinger/astropy-healpix that referenced this issue Oct 31, 2018
As a result, broadcasting across nside and ipix is supported
automatically.

Fixes astropy#72, closes astropy#75.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants