-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Feat] Ability to interpolate an array of coordinates #324
Conversation
@@ -7,7 +7,9 @@ | |||
import gemmi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of the changes in this file are formatting changes - do we have auto formatting in this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
Thanks for this PR. I've had several questions regarding grid interpolation over the last few years, and I've been meaning to re-think the API and address various requests for a long time. Let's get back to it next week. I'll be in a meeting most of this week, and I'm in the middle of moving python bindings from pybind11 to nanobind – I need to finish that first. |
Sorry it takes so long. 5 weeks ago, when I wrote I'll get back to it next week, I was too optimistic. Switching from pybind11 to nanobind is still an ongoing process, in a separate branch. For the record, I remembered that a few years ago I added another grid interpolating function for a friendly project: I'll get back to this PR in a couple weeks. |
Thanks @wojdyr for coming back to this. We rely heavily on grid interpolation to do tasks and would welcome any improvements to this area! |
in C++: interpolate_value() renamed to trilinear_interpolation() interpolate() renamed to interpolate_value() default order=1 makes it backward compatible the order argument: was 1/2/3, now it's 0/1/3 and corresponds to polynomial order. in Python: the same, but interpolate() had no bindings Also, added optional arg to_frac to grid.interpolate_position_array() rewritten the Interpolation section in docs it's a follow up to #324 functions that do Grid to Grid interpolation still need some work
Thanks again, it's now documented as BTW, my colleagues use some of the software you provide. Recently, I've been hearing about coordgenlibs. |
Related Issue
#323
Summary
Ccp4Map.grid.interpolate_values
expects the points to be organized on a regular grid. We often want to interpolate a numpy array of 3D coordinates and return the value at each point. I've added an example of what we would like to see added as an API, as well as testing and some documentation. I'm open to any ideas and I am definitely not settled on the naming of this function - the naming will become quite confusing as is...Example Usage
Testing
I built gemmi with:
Unit tests are passing with:
python3 -m unittest discover -v -s tests/
Docs are building with: