-
Notifications
You must be signed in to change notification settings - Fork 112
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
Drop AbstractArray
inheritance?
#242
Comments
I have a ton of lab-private code which uses them like arrays, but I will take a peek sometime and evaluate how important that really is. |
This would obviously need a (quite long) deprecation period; completely dropping support would be a very long term goal. |
As I've mentioned in other threads I would like the getindex notation to index into the parent array e.g. The contouring method is a quick and dirty way of calculating the trajectories, but there are cases when accuracy/precision is required and solving the ODE is preferred. I would like to support both methods using the same object. |
@lstagner Slightly off-topic, but what is your field of work/research? Your descriptions sound a lot like the fusion plasma physics work I did in my master's thesis... :) |
@tlycken Yes, I am a Postdoc at General Atomics doing fusion research, specifically in energetic particles hence the need for calculating particle trajectories. |
@lstagner Fun! The reason I got involved in the work that eventually led to creating this package was that I needed cubic b-splines for calculating alpha particle trajectories in tokamaks (specifically JET and ITER) :) You're probably past the point of learning much from it, but my thesis is available online if you'd be interested. I'd love to see the results of your work at some point :) |
Re-reading this issue after a while, and I still think it seems like there are more cases when If your purpose, @lstagner, is to get at the underlying data, why not use the data from before you created the interpolation object? Reasonably, you have something like this today:
Why can't you just do marching squares on If that's for some reason impossible, it should be quite easy to implement a wrapping type that can do the translation from I imagine something like this:
With this, we can drop the |
This doesn't actually solve my problem. It's not like I am going to code up the marching squares algorithm from scratch. I want to throw the interpolation object into the Contour.jl's contours function and just have it work. Similarly for plotting libraries. ( The advantage of subtyping P.S. I put my thesis online if you would like to check it out. Basically, I came up with a way to infer the entire fast-ion distribution function from experimental measurements. |
@lstagner That still doesn't answer my question, though: if you have an @timholy Your private lab-code probably uses |
I'm designing a library that will (hopefully) be used by other people who won't know that they would have to call Let me ask you this. What do we gain by dropping the |
I'm in favor of dropping this interface. For my lab I suspect it won't be entirely trivial because I think I mix Interpolations together with some of the other AbstractArray wrapper types, but I don't really remember for sure, and in any event we should do what makes most sense. I just haven't put any time in this package for a while. I'll mark this issue up-for-grabs. |
I don't see what you gain by having this inheritance. Hardly any function that requires an What you lose is that it confuses dispatch (in cases where functions do different things on array and non-array arguments), and makes error messages more confusing (since you get a |
At one point there was a drive to generalize AbstractArray indexing to well beyond integers. But I think that drive has gone by the wayside. |
Now that #206 is implemented and the main way to use Interpolations.jl is with function call semantics, I think we should evaluate what value
AbstractArray
semantics provide, and whether maybe we should drop it completely.My only strong opinion here, is that we should try to minimize the complexity of the package (it's already quite complex...), so if there are features or functionality we can drop without disappointing our users, I think we should.
There are already a couple of places where dropping or changing the semantics of
itp[x]
have been mentioned, e.g. #238 (comment) and #227.The text was updated successfully, but these errors were encountered: