Skip to content

Commit

Permalink
critical bugfix in time_in_days
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Dec 7, 2020
1 parent 713c602 commit 48a4b6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimateBase"
uuid = "35604d93-0fb8-4872-9436-495b01d137e2"
authors = ["Datseris <[email protected]>", "Philippe Roy <[email protected]>"]
version = "0.10.0"
version = "0.10.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
8 changes: 5 additions & 3 deletions src/physical_dimensions/temporal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ function time_in_days(t::AbstractArray{<:TimeType}, T = Float32)
ts = temporal_sampling(t)
if ts == :monthly
truetime = daysinmonth.(t)
r = T.(cumsum(truetime))
return r = T.(cumsum(truetime))
elseif ts == :yearly
error("Todo!")
truetime = daysinmonth.(t)
return r = T.(cumsum(truetime))
elseif ts == :daily
return T.(1:length(t))
else
error("Don't know how to find days for sampling $(ts)")
end
return r
end

#########################################################################
Expand Down

0 comments on commit 48a4b6b

Please sign in to comment.