You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently added a bunch of tests to the Time object, and found a couple bugs in the process.
But a number of questions came up to keep in mind for refactoring.
The constant_time class method -- produced a Time object with one arbitrary datetime in it, and does some magic to make sure that you get a singleton. which I guess is good 'cause then equality testing will work, but:
Maybe a subclass for constant time -- then you don't need to check for length-one in various places, and equality wouldn't require the singleton.
And/or simply create one at module init, and then use that.
Would it make sense to use a numpy datetime array, rather than an array of datetime objects?
tz_offset and displacement are the same thing -- any reason to have them both? If both, maybe tz_ofset would be in hours, rather than a timedelta? -- OK, added this :-) -- you can now pass either a timedelta or a number of hours.
Interpolation: This is about how it fits inot the rest of the system, but shouldn't the interp_alpha return the index as well -- to make sure it's consistent? and/or return two indices and alphas.?
There is logic inthe __init__ about trying to decode the netcdf time variable -- that logic should be in the netcdf loading code, not the main Time init.
The text was updated successfully, but these errors were encountered:
I've recently added a bunch of tests to the Time object, and found a couple bugs in the process.
But a number of questions came up to keep in mind for refactoring.
constant_time
class method -- produced a Time object with one arbitrary datetime in it, and does some magic to make sure that you get a singleton. which I guess is good 'cause then equality testing will work, but:Would it make sense to use a numpy datetime array, rather than an array of datetime objects?
tz_offset
and displacement are the same thing -- any reason to have them both? If both, maybe tz_ofset would be in hours, rather than a timedelta? -- OK, added this :-) -- you can now pass either a timedelta or a number of hours.Interpolation: This is about how it fits inot the rest of the system, but shouldn't the
interp_alpha
return the index as well -- to make sure it's consistent? and/or return two indices and alphas.?There is logic inthe
__init__
about trying to decode the netcdf time variable -- that logic should be in the netcdf loading code, not the main Time init.The text was updated successfully, but these errors were encountered: