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
Hey @d-chambers, I just ran this, and it works with applying units:
importdascoreasdcfromdascore.unitsimportstime=dc.to_timedelta64(2)
pa_tapered_1=pa.taper(time=time*s)
pa_tapered_2=pa.taper(time=2*s)
assertp_tapered_1==p_tapered_2assertnp.array_equal(pa_tapered_1.data, pa_tapered_2.data), "The arrays are not equal."
It's expected to use units with taper since kwarg is the percentage of the total length of the dimension or absolute units.
I also tried rolling (without specifying units) and got the same result:
importdascoreasdctime=dc.to_timedelta64(2)
mean_pa_1=pa.rolling(time=time, step=0.5).mean()
mean_pa_2=pa.rolling(time=2, step=0.5).mean()
assertnp.array_equal(mean_pa_1.dropna("time").data, mean_pa_2.dropna("time").data), "The arrays are not equal."
Hey @d-chambers, I just ran this, and it works with applying units:
Interesting. Yes, I think the current issue is when a single timedelta64 is passed without applying units to it. Timedelta64 is a bit of a weird case in that it already has units implied.
Description
Both numpy and python time deltas should be recognized as time units.
For example, this currently fails:
It should recognize
time
as a time.Versions
The text was updated successfully, but these errors were encountered: