api: add mul interp mode#2788
Conversation
80c1334 to
01d3d1a
Compare
0823c5f to
7821fc1
Compare
f91130f to
136f771
Compare
edd10f2 to
26490d4
Compare
233c8fb to
99fd21a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2788 +/- ##
==========================================
+ Coverage 83.35% 83.42% +0.07%
==========================================
Files 248 249 +1
Lines 51734 51984 +250
Branches 4463 4479 +16
==========================================
+ Hits 43122 43368 +246
- Misses 7859 7860 +1
- Partials 753 756 +3
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:
|
99fd21a to
198aedc
Compare
198aedc to
8cc5c13
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
2f6f0cf to
64aca73
Compare
da47926 to
be046cb
Compare
|
|
||
| # Code generation options for derivatives | ||
| o['expand'] = oo.pop('expand', cls.EXPAND) | ||
| o['interp-mode'] = oo.pop('interp-mode', cls.INTERP_MODE) |
There was a problem hiding this comment.
nitpicking, this should stay in a separate section being something related to the numerics, rather than performance (which is the case of all other opt-options).
As in, later on, perhaps around line 103, with a suitable comment
I'm also not sure if we really want this to be an Operator opt-option, as opposed to a Function parameter for example or something else
There was a problem hiding this comment.
it also won't play well with the tuner this way, unless we specialise it somehow
| return not self or all(s == 0 for s in self) | ||
|
|
||
| def __eq__(self, other): | ||
| # Two empty-or-all-zero Staggerings are equivalent regardless of arity |
There was a problem hiding this comment.
imho this could/should rather be normalized at __new__
There was a problem hiding this comment.
Well not easily no, because you can't have a wide variety of things, like 2D functions in 3D and so on that you can't really normalize.
| evalf_table[Pow] = evalf_table[sympy.Pow] | ||
|
|
||
|
|
||
| def _interp_mapper(source, target, dims): |
There was a problem hiding this comment.
would it be worth moving all of the interpolation-related stuff into a separate module finite_differences/interpolations.py ?
There was a problem hiding this comment.
Seconded - it would make it easier to find things and limit the size of files
| Interpolation mode used by `Mul._eval_at` when projecting a multi-factor | ||
| expression onto a target staggered location: | ||
|
|
||
| * `'direct'` (default): each factor is shifted to `func`'s location |
There was a problem hiding this comment.
what's func here (and below) ?
| `func`'s, the symmetric form `I * (a * I^T * b)` is built -- all | ||
| factors are gathered at the highest-priority "block" location via | ||
| `I^T`, multiplied there, and the product is interpolated to `func` | ||
| via `I`. Use this for operators whose continuous form decomposes as |
There was a problem hiding this comment.
this sentence "Use this ..." doesn't seem to be the complement of the other sentence you used for the "direct" mode above i.e. "the mode to pick unless ..."
There was a problem hiding this comment.
Nitpick: might as well call it 08_staggered_interpolation for minimum ambiguity. Looks super good though. Is this a Claude job? Less typos than usual 😅
There was a problem hiding this comment.
This is a side-quest PR, so yeah definitely claude tutorial :D
| evalf_table[Pow] = evalf_table[sympy.Pow] | ||
|
|
||
|
|
||
| def _interp_mapper(source, target, dims): |
There was a problem hiding this comment.
Seconded - it would make it easier to find things and limit the size of files
cb9b140 to
64ef414
Compare
64ef414 to
883d31e
Compare
Uh oh!
There was an error while loading. Please reload this page.