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

API: fixed callback of PrecomputedInterpolator injection #1691

Merged
merged 3 commits into from
May 17, 2021
Merged

API: fixed callback of PrecomputedInterpolator injection #1691

merged 3 commits into from
May 17, 2021

Conversation

ccuetom
Copy link
Contributor

@ccuetom ccuetom commented May 10, 2021

Although the interpolation using PrecomputedInterpolator was working fine, the injection tries to access the gridpoints and interpolation_coeffs in self instead of in self.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 to self.obj this is solved.

@mloubout mloubout added the API api (symbolics, types, ...) label May 10, 2021
@mloubout mloubout changed the title compiler: fixed callback of PrecomputedInterpolator injection API: fixed callback of PrecomputedInterpolator injection May 10, 2021
@FabioLuporini FabioLuporini requested a review from mloubout May 11, 2021 07:06
Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @mloubout ?

origin = (0, 0)
result = 0.25

r = 2 # Constant for linear interpolation
Copy link
Contributor

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?

Copy link
Contributor Author

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

m = unit_box(shape=shape)
m.data[:] = 0.

r = 2 # Constant for linear interpolation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate?

Copy link
Contributor Author

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

@mloubout mloubout added bug-py and removed API api (symbolics, types, ...) labels May 11, 2021
@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #1691 (8f63507) into master (299b116) will decrease coverage by 29.15%.
The diff coverage is 5.26%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
devito/operations/interpolators.py 69.81% <0.00%> (-20.13%) ⬇️
tests/test_interpolation.py 13.92% <6.25%> (-82.08%) ⬇️
examples/seismic/viscoacoustic/operators.py 8.81% <0.00%> (-91.19%) ⬇️
examples/seismic/self_adjoint/operators.py 9.23% <0.00%> (-90.77%) ⬇️
tests/test_dimension.py 9.81% <0.00%> (-90.19%) ⬇️
tests/test_skewing.py 10.86% <0.00%> (-88.05%) ⬇️
tests/test_caching.py 12.99% <0.00%> (-86.78%) ⬇️
tests/test_dse.py 13.08% <0.00%> (-86.68%) ⬇️
tests/test_lower_exprs.py 11.82% <0.00%> (-86.03%) ⬇️
tests/test_operator.py 12.94% <0.00%> (-84.89%) ⬇️
... and 158 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 299b116...8f63507. Read the comment docs.

@FabioLuporini
Copy link
Contributor

Thanks a lot, merging!

@FabioLuporini FabioLuporini merged commit f1ae84e into devitocodes:master May 17, 2021
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 this pull request may close these issues.

4 participants