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

fix grid_lebedev() due to quadpy API changes #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fs446
Copy link
Member

@fs446 fs446 commented Jan 25, 2021

We use the quadpy package for creating Lebedev spherical grids. quadpy API changed a lot meanwhile, so I tried to fixed this issue with this PR. The fix is not the nicest, since the current quadpy API handling with quadpy.u3.get_good_scheme(degree) does not fully cover all available Lebedev grids. Thus, I decided to use more lower level features calling lebedev_xxx() function directly, these functions should last longer as the upper part of the API. The API also changed the coordinate handling, it now returns cartesian coordinates. So our function must convert to az, colat, r. That's why I also copied the sph2cart and cart2sph routines from sfs toolbox into the util.py

What do you think? Thanks for suggestions and help.

@chris-hld
Copy link

I was facing the same problem. Also the API seems to change quite frequently...
Eventually I gave up on chasing them (couldn't fix to a specific old version for other reasons.).
If this is interesting, I compiled a mat file of Lebedev grids that then gets loaded and returns the correct grid. Actually, quadpy is not doing anything else last time I checked, just returning hard coded values.
Feel free to copy:
https://github.com/chris-hld/spaudiopy/blob/add74e0d05cebd83073b121d3a9aad2688506b7c/spaudiopy/grids.py#L114

@fs446
Copy link
Member Author

fs446 commented Feb 15, 2021

I was facing the same problem. Also the API seems to change quite frequently...
Eventually I gave up on chasing them (couldn't fix to a specific old version for other reasons.).
If this is interesting, I compiled a mat file of Lebedev grids that then gets loaded and returns the correct grid. Actually, quadpy is not doing anything else last time I checked, just returning hard coded values.
Feel free to copy:
https://github.com/chris-hld/spaudiopy/blob/add74e0d05cebd83073b121d3a9aad2688506b7c/spaudiopy/grids.py#L114

Yeah, thanks for the hint and offer! How should we do this?

I personally like the development effort on quadpy, since it collects a lot of spatial sampling strategies for different geometries and the API evolves to a consistent handling at the moment. In long term we might not only focusing on spherical geometry and we might want to use such a package.
On the other hand, a middle term solution is to copy the code from grid.pyas suggested by chris-hld.
Or using the (really bad) coding starting this PR as a hot fix short term solution.

Any preferences here?

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.

2 participants