api: fix injection expression indices#2927
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2927 +/- ##
=======================================
Coverage 83.35% 83.35%
=======================================
Files 248 248
Lines 51734 51734
Branches 4463 4463
=======================================
+ Hits 43122 43124 +2
+ Misses 7859 7858 -1
+ Partials 753 752 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # List of indirection indices for all adjacent grid points | ||
| idx_subs, temps = self._interp_idx(fields, implicit_dims=implicit_dims, | ||
| pos_only=variables, subdomain=subdomain) | ||
| finterp = fields + as_tuple(variables) if interp_expr else fields |
There was a problem hiding this comment.
nitpicking, it'd read better with an explicit
if inter_expr:
<stmt0>
<stmt1>
else:
...
| @check_radius | ||
| @check_coords | ||
| def inject(self, field, expr, implicit_dims=None): | ||
| def inject(self, field, expr, implicit_dims=None, interp_expr=False): |
There was a problem hiding this comment.
the docstring should be updated now
also, if interp_expr is a boolean, maybe it could be given a more representative name, because for a good couple of minutes, while scrolling up and down through the PR, I thought it was an expression
| __rargs__ = ('field', 'expr', 'implicit_dims') + UnevaluatedSparseOperation.__rargs__ | ||
|
|
||
| def __new__(cls, field, expr, implicit_dims, interpolator): | ||
| def __new__(cls, field, expr, implicit_dims, interpolator, interp_expr=False): |
There was a problem hiding this comment.
btw, don't we need the equivalent for Interpolation too?
There was a problem hiding this comment.
No we don't. Interpolation is by definition "interpolate whole expr" so it doesn't have a way to ignore terms
No description provided.