-
Notifications
You must be signed in to change notification settings - Fork 26
Decision: Separate the concepts of boundary condition and extrapolation behavior #37
Comments
I think that's a good idea. The main concern will be the combinatorial increase of cases to handle. #36, if that happens, might make some of this easier. (Depending on how we do it; I should say, it could conceivably also make this harder!) The basic idea I have in mind for #36 is that rather than writing a generic It's a little hard to know how this would play out until we try. I wonder if I need to at least post a couple of examples of what #36 might look like before you make big decisions about this issue? |
Yeah, if we're going to make a rewrite anyway for performance reasons, this can very well wait to be included there. I think we can still do quite a lot of stuff with generic functions and get this working well, though - the boundary conditions basically affect the equation system to solve (i.e. the various incarnations of |
Since this is handled in Interpolations.jl, I don't think Grid.jl needs to be concerned about this. |
After thinking a little about #32 as well as poking around in the code to see what I can do about the problems with
InterpCubic
(#29, #31, #33) I'm getting more and more frustrated with the lack of separation between the two concepts "boundary conditions" and "extrapolation behavior". As I see it, those are two separate concepts:x in [2,3]
also forx in [1,2]
. An alternative way of terminating the interpolation would be to use a linear interpolation in the edge interval, and still require smoothness at the edge.x
is provided which is outside the domain (e.g. anyx < 1
). Currently, there are a couple of behaviors:BCnil
andBCnan
both do something to indicate an undefined value, whileBCfill
defines a constant extrapolation independent of the function value at the edge, andBCnearest
is in effect a simple constant extrapolation. But this is (could be) independent of what happens inside the domain - it is only concerned with behavior outside.Some of today's boundary conditions capture both these concepts -
BCperiodic
andBCreflect
intrinsically defines both the boundary condition and the extrapolation behavior - but that's more a special circumstance than anything else.Separating these two concepts would probably be a quite substantial rewrite of parts of
interp.jl
, and breaking API changes are likely (if they are separate concepts, both need to be specified by the user...). This is unfortunate, since Grid is used by a lot of people, and in a lot of packages.Before I start working on anything, I'd love to hear some input from others on whether this is a good idea or not, and (if it is) if there are any special considerations that I might not have thought of.
The text was updated successfully, but these errors were encountered: