-
Notifications
You must be signed in to change notification settings - Fork 232
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
dsl: Introduce ability to define Functions on Subdomains #2245
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2245 +/- ##
==========================================
+ Coverage 87.30% 87.53% +0.22%
==========================================
Files 238 238
Lines 46001 46972 +971
Branches 4075 4139 +64
==========================================
+ Hits 40161 41115 +954
- Misses 5151 5165 +14
- Partials 689 692 +3 ☔ View full report in Codecov by Sentry. |
5fc54ee
to
a0742f0
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
9fe8916
to
1092e78
Compare
1d37846
to
d462af1
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.
For the amount of changes introduced, I'd prefer to see a lot more new tests.
Shouldn't all (most) of the old tests that @rhodrin wrote be here as well?
588c25e
to
2cd952e
Compare
2cd952e
to
341ee08
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.
quick pass
4268c54
to
af06ba9
Compare
a3706d7
to
438b5f7
Compare
extra = filter_ordered([i for v in extras for i in v.dimensions | ||
if i not in self._gdims and | ||
if i not in gdims and |
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 didn't the previous version break any test?
devito/operations/interpolators.py
Outdated
for v in extras: | ||
try: | ||
egrid = v.grid | ||
if egrid is not None and egrid.is_SubDomain: |
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.
egrid is not None
isn't needed
the line egrid = v.grid
can probably be dropped too
devito/operations/interpolators.py
Outdated
|
||
def _augment_implicit_dims(self, implicit_dims, extras=None): | ||
if extras is not None: | ||
# If variables are defined on a SubDomain of the Grid, then temprarily add |
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, just a wording thing) this comments reads odd, nothing is really to added to self._gdims
devito/operations/interpolators.py
Outdated
|
||
def _augment_implicit_dims(self, implicit_dims, extras=None): | ||
if extras is not None: | ||
# If variables are defined on a SubDomain of the Grid, then temprarily add | ||
# their dimensions to self._gdims for the purpose of checking if extra | ||
# dimensions have been included. |
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.
no full stop needed
self._shape_local = tuple(0 if i.is_empty else i.end-i.start + 1 if i.is_Interval | ||
else 1 for i in self.distributor.intervals) | ||
|
||
def __subdomain_finalize_legacy__(self, grid): |
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.
if so, we need to do it a way that does not pollute the output log (e.g. emitting one warning per SubDomain instance ... something you can obtain easily by adding a new handler here https://github.com/devitocodes/devito/blob/master/devito/deprecations.py)
Add Functions on SubDomains functionality.
Remaining todo (for future PRs I think):