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
The main problem is that a TimeArray is a parametric type, which is difficult to implement, see.
The meta::Any field is not serializable as a JSON in any case. JSON.json even results in a stack overflow error.
This does work, but still makes the assumption that the timestamps are DateTime.
They can be anything: Date, DateTime, TimeZones.ZonedDateTime, TimesDates.TimeDate, TimesDates.TimeDateZone
StructTypes.StructType(::Type{<:TimeSeries.TimeArray}) = StructTypes.CustomStruct()
function StructTypes.lower(x::TimeSeries.TimeArray)
returnDict(
"timestamp"=> TimeSeries.timestamp(x),
"values"=> [TimeSeries.values(x[c]) for c in TimeSeries.colnames(x)],
"colnames"=>String.(TimeSeries.colnames(x)),
)
endfunction StructTypes.construct(::Type{TimeSeries.TimeArray}, x)
return TimeSeries.TimeArray(
Dates.DateTime.(x["timestamp"]),
reduce(hcat, x["values"]),
Symbol.(x["colnames"]),
)
end
The text was updated successfully, but these errors were encountered:
The main problem is that a
TimeArray
is a parametric type, which is difficult to implement, see.The
meta::Any
field is not serializable as a JSON in any case.JSON.json
even results in a stack overflow error.This does work, but still makes the assumption that the timestamps are
DateTime
.They can be anything:
Date
,DateTime
,TimeZones.ZonedDateTime
,TimesDates.TimeDate
,TimesDates.TimeDateZone
The text was updated successfully, but these errors were encountered: