-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make time axis #348
Make time axis #348
Conversation
Still to do: *Fix all of the stuff that broke with these changes *Test methods and make sure defaults are all the same |
|
@CommonClimate You're mostly correct. However, all of the methods will be allowed to specify finer time resolutions. The defaults for bin and gkernel will be to avoid this behavior, though the user will be free to do these things if they so wish. So 'make all defaults are the same' is a bit misleading on my part, I think that was the product of friday brain fog. I meant it should be that if you pass in the same arguments to each function, you'll receive the same time axis. The value axis will ideally be the main thing that varies between each method. If this is out of line with your expectations I'm happy to discuss further, I was under the impression that one of the main reasons we were overhauling these functions was to put them on similar semantic ground |
Yes, we are in agreement ; I was just thrown off by 'make all defaults are the same' . The function will indeed be common to all regridding methods, and I was envisioning that it would be called within the API level functions BTW, I am thinking that instead of |
I see, currently most of the work done for each of these functions is done within the utilities, so just to be explicit we would be changing that to having the time axis step done at the API level right? Currently I have this being done within the utilities as well, though it should be straightforward to change. |
Yes, done within the utils-level function, but the setting of the step should be done at the API level, because it will vary between those regridding types (.e.g interp will use a different step style than bin). Do |
The key is to have all the common bits handled by the same piece of code, to minimize unwanted variation. But some variations are desirable, and should be made explicit! |
Well put! One minor question that has risen with regards to how start,step and stop are interpreted is with regards to the difference between interp and bin. For interp these arguments are used to specify the time axis which will serve as the basis for interpolation. This usage is also possible for bin and gkernel, but requires "half bins" at the beginning and end of the time axis, as the bin edges must be set as the midpoints between times, but should not (in my opinion) extend beyond the start and stop times. For example, if start = 0, stop 3, and step (or bin_size) = 1, the time axis = [0,1,2,3], but the bins are [0,.5,1.5,2.5,3] (note the "half bins" at the beginning and end). The alternative is to have the "time axis" in this case just define the bin edges, in which case, using the above example, bin_edges = [0,1,2,3] and the time_axis = [.5,1.5,2.5]. I think the latter makes more sense from a contextless perspective, but it does mean that the arguments are interpreted differently between the functions. Do you have any thoughts? @khider might also have an opinion. If my description just elicits more confusion, we can also save this discussion for the dev meeting tomorrow. |
Thanks for that. This is a clear indication that the very meaning of "time axis" varies from one application to the next, particularly this issue of edges vs midpoints. We do want to be very explicit about that, and maybe there should be two separate functions (one for bins, one for interpolation times)? Perhaps not, but worth thinking about. As long as the doc is clear, I think it's OK to have one function that does different things depending on context (edges vs midpoints), but you'll find out when implementing/testing whether that's the right approach! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good ; the bigger question is, does it work? Can you apply this to paleohack NB3, where I do a tour of those methods, to check that they really do work? Also, it would be good for this NB to include the option of passing a time axis, which wasn’t available before.
NB3 looks like it works, so I'll merge. |
Addresses #330