-
Notifications
You must be signed in to change notification settings - Fork 230
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
API: fixed callback of PrecomputedInterpolator injection #1691
API: fixed callback of PrecomputedInterpolator injection #1691
Conversation
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.
LGTM. @mloubout ?
tests/test_interpolation.py
Outdated
origin = (0, 0) | ||
result = 0.25 | ||
|
||
r = 2 # Constant for linear interpolation |
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.
nitpicking:
Comment should go before variable?
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.
I have now moved the comments before the variable
tests/test_interpolation.py
Outdated
m = unit_box(shape=shape) | ||
m.data[:] = 0. | ||
|
||
r = 2 # Constant for linear interpolation |
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.
Duplicate?
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.
I have removed the duplicate variable
Codecov Report
@@ Coverage Diff @@
## master #1691 +/- ##
===========================================
- Coverage 86.68% 57.52% -29.16%
===========================================
Files 218 202 -16
Lines 33389 31851 -1538
Branches 4342 4141 -201
===========================================
- Hits 28943 18323 -10620
- Misses 3959 12942 +8983
- Partials 487 586 +99
Continue to review full report at Codecov.
|
Thanks a lot, merging! |
Although the interpolation using PrecomputedInterpolator was working fine, the injection tries to access the
gridpoints
andinterpolation_coeffs
inself
instead of inself.obj
.Also, when injecting with the PrecomputedInterpolator, the preparation of the arguments for the operator calls the
self._parent._arg_defaults
for the gridpoints SubFunction, which does not exist. By changing the parent of the SubFunction toself.obj
this is solved.