-
Notifications
You must be signed in to change notification settings - Fork 14
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
fixed the __eq__ check,and acouple bugs about out of bounds. #83
base: main
Are you sure you want to change the base?
Conversation
added lots of tests -- up to 96% coverage. tiny bit of refactoring.
Any change to interp_alpha behavior should be done in conjunction with index_of and Variable._time_interp. I'm happy with the way its been the last seven years or so but if you want to change it or fix it go ahead. interp_alpha is a totally valid call on a constant Time object. Variable._time_interp would probably explain the values it gives the best. gridded has never really had a need for eq. In GNOME object comparison is usually a big deal because of serialization, but that doesn't really apply to Grids or Variables because nothing of importance is saved as JSON. I suppose it does matter for Time because that does get saved in the JSON. |
OK, I'll look then, I thought you might remember what's going on. But the behaviour should be well defined and documented.
Which makes sense -- but it's always returning 0.0 -- which doesn't make sense -- I can't see how that could possibly be useful.
I'll take a look there -- this is a bit of an intertwined API, s a bit hard to know where behavior is defined.
Gridded isn't a sub-module of PyGNOME -- it's it's own thing. But anyway, a broken
Well, it's getting used in the code that's trying to manage references -- but maybe object identity is all we need there -- the trick is that it's using the build in The point is that ANY class in Python should have a well-behaved eq -- e.g. it shouldn't raise, and it shouldn't return True when the objects are not truly equal. |
added lots of tests -- up to 96% coverage. tiny bit of refactoring.
…into update_time
merging -- not a lot changed, but one important bug -- and some added tests and lint cleanup |
added lots of tests -- up to 96% coverage. tiny bit of refactoring.
…into update_time
added lots of tests -- up to 96% coverage.
tiny bit of refactoring.
@jay-hennen: I'm not merging right away because I'm not sure about the
interp_alpha
function for a constant_time Time series (i.e. one with only one datetime). It is always returning 0.0 -- shouldn't it always return 1.0? or maybe 0.0 for before, and 1.0 for after??I'm got a known fail test in test_time for this -- could you please decide and document what it's supposed to do, and make the test correct.
It could be that there's never a reason to call
interp_alpha
for constant time data -- but them what is constant_time for? In any case, if it's useless, it should raise an error maybe.Anyway, after addressing this one issue, please merge -- this is not a good bug.
Here's a few more thoughts in the Time object that we can think about later:
#82
Also: The eq for grids seems to be VERY broken, that could cause issues! And we should probably have a eq for Variables -- I think in PyGNOME, it's using the one provided by Gnome_id, but seems it should be built in.
#81