Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3127 +/- ##
===========================================
- Coverage 83.40% 52.26% -31.14%
===========================================
Files 260 260
Lines 59671 59809 +138
Branches 5036 5054 +18
===========================================
- Hits 49769 31262 -18507
- Misses 9022 27498 +18476
- Partials 880 1049 +169
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mloubout
left a comment
There was a problem hiding this comment.
Sorry quite a few comments. What made those pop up?
| @property | ||
| def neighborhood(self): | ||
| """ | ||
| As in `Distributor.neighborhood`, but skipping the MPI ranks owning no |
There was a problem hiding this comment.
This is a very weird corner case. I don't see how practical usage of SubGrid would end up in such a setup. I understand what it does but i think this is overkill and such odd case should just error as this is not what the api is intended for.
| if f < 1: | ||
| raise ValueError(f"Subsampling factor must be >= 1, got `{f}`") | ||
|
|
||
| for d, n, f in zip(parent.dimensions, parent.shape, factors, strict=True): |
There was a problem hiding this comment.
This prevents using dummy tiny grids to build an operator, those shape checks should only be done at arg processing
| v = Function(name='v', grid=target, space_order=4) | ||
| u.data[:] = np.sin(np.arange(u.data.size).reshape(u.shape)/7.) | ||
|
|
||
| if interpolation == 'precomputed': |
There was a problem hiding this comment.
there is utilities in test_interpolation for that.
|
|
||
| assert not d.is_NonlinearDerived | ||
| # Only a subsampled Dimension may be iterated over, e.g. a SubGrid's | ||
| assert not d.is_NonlinearDerived or d.is_Conditional |
There was a problem hiding this comment.
iterated subdimension needs is_Strided
| d = interval.dim | ||
| while d.is_Derived and not d.is_Conditional: | ||
| d = d.parent | ||
| if d.is_Conditional: |
There was a problem hiding this comment.
Likely need to check Strided as well
| mappers = [] | ||
| for d in self.dimensions: | ||
| mapper = {d.spacing: 1, -d.spacing: -1} | ||
| # A subsampled Dimension's spacing is a multiple of its root's, e.g. |
There was a problem hiding this comment.
Why is it touching d.root it's not the dimension that indexes self?
| for d in self.dimensions: | ||
| mapper = {d.spacing: 1, -d.spacing: -1} | ||
| # A subsampled Dimension's spacing is a multiple of its root's, e.g. | ||
| # `2*h_x`, so rescale the root's instead to also map `4*h_x` to `2` |
There was a problem hiding this comment.
Why is it checking root here. self.dimension are the ones indxing self and are the Subdim.
| ((33, 33), (2, 3), ('advanced', {'blockrelax': True})), | ||
| ((17, 17, 17), (2, 2, 4), 'advanced'), | ||
| ]) | ||
| def test_high_order_derivatives(self, so, shape, factor, opt): |
There was a problem hiding this comment.
Seems to mix different things. The cire part should be tested as a standalone in the test_dse with the other cire test and checks the Array itself.
| else: | ||
| pd = d.parent | ||
| writeto.append(interval.relaxed) | ||
| writeto.append(_relaxed(interval)) |
There was a problem hiding this comment.
Not sure i understand why this is needed. The subsampling pass already does that.
SubGridstencils (basic.py):so>=4derivatives failed to compile or build.indexifynow rescales the root spacing, soxs + 4*h_xbecomesxs + 2. This also coversFunctionson aSubDomainof aSubGrid.SubGrids(aliases.py): temporaries along aSubGridDimensionwere indexed by the parentDimension. A new_relaxedhelper keeps them on theSubGridDimension. The assert is narrowed rather than removed, so other non-linearDimensions (e.g. modulo ones) still trip it.SubGrids(interpolators.py): interpolation gave wrong values and injection didn't compile. They now use theSubGrid's ownDimensions. Linear, sinc and precomputed now match a plainGridexactly, including onSubDomains.SubGridpoints (distributed.py): these crashed or hung on the first halo exchange.SubGridDistributor.neighborhoodnow skips empty ranks.grid.py): a factor that leaves a single point along an axis now raises a clearValueError.