From 2d17c2b8703b1ada169393cfbbe1aadacf339546 Mon Sep 17 00:00:00 2001 From: Stanislav Gryumov <33372067+gryumov@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:27:03 +0300 Subject: [PATCH] Added fit_origin function for various window start points (#7) --- Project.toml | 2 +- src/resample.jl | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 4b51c47..cd41313 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TimeArrays" uuid = "058eeebf-2231-41de-8410-62311c15f51e" -version = "1.1.0" +version = "1.1.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/resample.jl b/src/resample.jl index e4ffb72..ad75267 100644 --- a/src/resample.jl +++ b/src/resample.jl @@ -57,11 +57,7 @@ end return typemin(T) end -@inline function fit_origin(t_array::TimeArray{T,V}, ::Val{ORIGIN_OF_WINDOW}) where {T<:Date,V<:Any} - return trunc(ta_timestamp(t_array[begin]), Year) -end - -@inline function fit_origin(t_array::TimeArray{T,V}, ::Val{ORIGIN_OF_WINDOW}) where {T<:DateTime,V<:Any} +@inline function fit_origin(t_array::TimeArray{T,V}, ::Val{ORIGIN_OF_WINDOW}) where {T<:TimeType,V<:Any} return trunc(ta_timestamp(t_array[begin]), Year) end