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
It's doesn't presently appear possible to automatically save Date variables, as opposed to DateTime variables, but it's of course entirely possible that I'm mis-using the package. Specifically:
ERROR: MethodError: no method matching -(::Date, ::DateTimeStandard)
Closest candidates are:-(::Date, ::Day) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Dates/src/arithmetic.jl:75-(::Date, ::Week) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Dates/src/arithmetic.jl:73-(::Date, ::Month) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Dates/src/arithmetic.jl:66...
Stacktrace:
[1] fromdate at /homes/wct23/.julia/packages/NCDatasets/eDnxY/src/cfvariable.jl:497 [inlined]
[2] CFinvtransform at /homes/wct23/.julia/packages/NCDatasets/eDnxY/src/cfvariable.jl:517 [inlined]
[3] macro expansion at /homes/wct23/.julia/packages/NCDatasets/eDnxY/src/cfvariable.jl:571 [inlined]
[4] macro expansion at ./simdloop.jl:77 [inlined]
[5] CFinvtransformdata at /homes/wct23/.julia/packages/NCDatasets/eDnxY/src/cfvariable.jl:570 [inlined]
[6] setindex!(::NCDatasets.CFVariable{DateTime,1,NCDatasets.Variable{Int64,1,NCDataset},NCDatasets.Attributes{NCDataset{Nothing}},NamedTuple{(:fillvalue, :scale_factor, :add_offset, :calendar, :time_origin, :time_factor),Tuple{Nothing,Nothing,Nothing,String,DateTimeStandard,Int64}}}, ::StepRange{Date,Day}, ::Colon) at /homes/wct23/.julia/packages/NCDatasets/eDnxY/src/cfvariable.jl:624
[7] top-level scope at REPL[120]:1
This workaround is fine for now:
t[:] =DateTime.(dates)
but perhaps it would be desirable to make it possible to do this conversion automatically? Or, if this functionality is intentional, so as to ensure that you get the same data types when loading a file back up, perhaps this workaround could be documented via some kind of error?
The text was updated successfully, but these errors were encountered:
It's doesn't presently appear possible to automatically save
Date
variables, as opposed toDateTime
variables, but it's of course entirely possible that I'm mis-using the package. Specifically:yields
This workaround is fine for now:
but perhaps it would be desirable to make it possible to do this conversion automatically? Or, if this functionality is intentional, so as to ensure that you get the same data types when loading a file back up, perhaps this workaround could be documented via some kind of error?
The text was updated successfully, but these errors were encountered: