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: cleanup SubDimension and SubDomain #2219

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

mloubout
Copy link
Contributor

No description provided.

@mloubout mloubout added the API api (symbolics, types, ...) label Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #2219 (ca76218) into master (b610ccf) will decrease coverage by 0.02%.
The diff coverage is 63.15%.

@@            Coverage Diff             @@
##           master    #2219      +/-   ##
==========================================
- Coverage   87.09%   87.08%   -0.02%     
==========================================
  Files         228      228              
  Lines       40756    40762       +6     
  Branches     7463     7465       +2     
==========================================
+ Hits        35498    35499       +1     
- Misses       4654     4657       +3     
- Partials      604      606       +2     
Files Coverage Δ
devito/types/grid.py 92.63% <ø> (ø)
tests/test_subdomains.py 100.00% <100.00%> (ø)
devito/passes/clusters/implicit.py 81.44% <50.00%> (-4.28%) ⬇️

@@ -120,7 +121,7 @@ def callback(self, clusters, prefix):
# once and for all at the top of the current IterationInterval,
# and reuse them for one or more (potentially non-consecutive)
# `clusters`
if ispaceN not in seen:
if ispaceN not in seen or (not ispaceN and d not in seend):
Copy link
Contributor

Choose a reason for hiding this comment

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

two questions:

  • Is the not ispaceN really necessary? we get to this point only if len(ispaceN) == 0, so it should be implicit?
  • Instead of adding seend, can we not just put everything inside seen? that is, seen contains both IterationSpaces and plain Dimensions...

On second thought, I'm confused by the original code. If len(ispaceN) == 0, then it means ispaceN == IterationSpace([]) no? I think I'm not seeing something obvious, and therefore at least the first comment above might make no sense...

BTw, since you're touching this file... could you polish:

  • Interval(i, 0, 0) -> Interval(i) (a few lines above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that you could have an IterationSpace of length 0 but not empty in some weird corner case which is why was needed. but yeah can probably drop the not ispaceN

@mloubout mloubout force-pushed the multi-multisubdoman branch 3 times, most recently from 7ed87f2 to b19ea1a Compare September 28, 2023 13:26
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.

OK, GTG now

@mloubout mloubout merged commit c27159d into master Sep 28, 2023
32 checks passed
@mloubout mloubout deleted the multi-multisubdoman branch September 28, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API api (symbolics, types, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants