-
Notifications
You must be signed in to change notification settings - Fork 229
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: Use subs for origin in case index is a function #2120
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## master #2120 +/- ##
=======================================
Coverage 87.17% 87.17%
=======================================
Files 222 222
Lines 39368 39378 +10
Branches 5117 5118 +1
=======================================
+ Hits 34319 34328 +9
- Misses 4478 4480 +2
+ Partials 571 570 -1
|
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.
types
isn't a valid tag anymore; you probably should use compiler
or dsl
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.
Can we add a small MFE somewhere?
72b0a3a
to
eb66c63
Compare
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.
Would it be worth having a test to double-check that indices are not affected by staggering? Possibly create two simple 1D kernels containing the absolute of an index, one where the function is staggered and one where it is not and check the generated C string is the same.
Added test |
devito/operations/interpolators.py
Outdated
|
||
# Apply mapper to each variable with origin correction before the | ||
# dimensions get replaced. | ||
vmapper = {} |
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.
equivalent to:
subs = {v: v.subs({k: c - v.origin.get(k, 0) for k, c in mapper.items()})}
?
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.
why does this issue emerge only now?
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.
Before we were just doing index - origin
during indexification which was making the assumption "indices are of the form i + o
" so it didn't matter, but now without the assumption it needs the dimension which is removed and replaced by the ii_rec_...
indices so we need to take care of it here when the dimension is removed
5d9a2a2
to
9d4d121
Compare
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.
OK, thanks
Fixes #1950