Skip to content

Commit 1a77280

Browse files
_timeencode to timeencode
1 parent a06ba28 commit 1a77280

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/conversions.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ function timedecode(::Type{DateTime}, data, units)
411411
return to_datetime.(timedecode(DateTimeProlepticGregorian, data, units))
412412
end
413413

414-
_timeencode(::Type{DT2}, dt::Missing) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod} = missing
414+
timeencode(::Type{DT2}, dt::Missing) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod} = missing
415415
# fast pass, prevent type promotion in division
416-
function _timeencode(::Type{DT2}, dt::DT2) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod}
416+
function timeencode(::Type{DT2}, dt::DT2) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod}
417417
return Dates.value(dt)
418418
end
419-
function _timeencode(::Type{DT2}, dt) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod}
419+
function timeencode(::Type{DT2}, dt) where {DT2 <: AbstractCFDateTime{Tperiod}} where {Tperiod}
420420
t0 = origin(DT2)
421421
Δt = oneunit(Tperiod)
422422
return (dt - t0) / Δt
@@ -490,15 +490,15 @@ function timeencode(
490490
) where {DT <: Union{AbstractCFDateTime, Missing}}
491491
T = Int64 # use type promotion?
492492
DTT = timetype(Tcalendar, units, T)
493-
return _timeencode.(DTT, data)
493+
return timeencode.(DTT, data)
494494
end
495495

496496
# homogenous array should preserve the type of the underlying duration
497497
function timeencode(
498498
data::Union{DT, AbstractArray{DT}}, units, Tcalendar::Type{<:AbstractCFDateTime},
499499
) where {DT <: AbstractCFDateTime{TPeriod}} where {TPeriod <: Period{T}} where {T}
500500
DTT = timetype(Tcalendar, units, T)
501-
return _timeencode.(DTT, data)
501+
return timeencode.(DTT, data)
502502
end
503503

504504
# do not transform data is not a vector of DateTime

0 commit comments

Comments
 (0)