@@ -214,28 +214,38 @@ end
214
214
$SIGNATURES
215
215
The default DFGVariable constructor.
216
216
"""
217
- DFGVariable (label:: Symbol , softtype:: T ;
217
+ function DFGVariable (label:: Symbol , softtype:: T ;
218
218
timestamp:: Union{DateTime,ZonedDateTime} = now (localzone ()),
219
219
nstime:: Nanosecond = Nanosecond (0 ),
220
220
tags:: Set{Symbol} = Set {Symbol} (),
221
221
estimateDict:: Dict{Symbol, <: AbstractPointParametricEst} = Dict {Symbol, MeanMaxPPE} (),
222
222
solverDataDict:: Dict{Symbol, VariableNodeData{T}} = Dict {Symbol, VariableNodeData{T}} (),
223
223
smallData:: Dict{String, String} = Dict {String, String} (),
224
224
dataDict:: Dict{Symbol, AbstractDataEntry} = Dict {Symbol,AbstractDataEntry} (),
225
- solvable:: Int = 1 ) where {T <: InferenceVariable } =
226
- DFGVariable {T} (label, timestamp, nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref (solvable))
225
+ solvable:: Int = 1 ) where {T <: InferenceVariable }
227
226
227
+ if timestamp isa DateTime
228
+ DFGVariable {T} (label, ZonedDateTime (timestamp, localzone ()), nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref (solvable))
229
+ else
230
+ DFGVariable {T} (label, timestamp, nstime, tags, estimateDict, solverDataDict, smallData, dataDict, Ref (solvable))
231
+ end
232
+ end
228
233
229
- DFGVariable (label:: Symbol ,
234
+ function DFGVariable (label:: Symbol ,
230
235
solverData:: VariableNodeData{T} ;
231
236
timestamp:: Union{DateTime,ZonedDateTime} = now (localzone ()),
232
237
nstime:: Nanosecond = Nanosecond (0 ),
233
238
tags:: Set{Symbol} = Set {Symbol} (),
234
239
estimateDict:: Dict{Symbol, <: AbstractPointParametricEst} = Dict {Symbol, MeanMaxPPE} (),
235
240
smallData:: Dict{String, String} = Dict {String, String} (),
236
241
dataDict:: Dict{Symbol, AbstractDataEntry} = Dict {Symbol,AbstractDataEntry} (),
237
- solvable:: Int = 1 ) where {T <: InferenceVariable } =
238
- DFGVariable {T} (label, timestamp, nstime, tags, estimateDict, Dict {Symbol, VariableNodeData{T}} (:default => solverData), smallData, dataDict, Ref (solvable))
242
+ solvable:: Int = 1 ) where {T <: InferenceVariable }
243
+ if timestamp isa DateTime
244
+ DFGVariable {T} (label, ZonedDateTime (timestamp, localzone ()), nstime, tags, estimateDict, Dict {Symbol, VariableNodeData{T}} (:default => solverData), smallData, dataDict, Ref (solvable))
245
+ else
246
+ DFGVariable {T} (label, timestamp, nstime, tags, estimateDict, Dict {Symbol, VariableNodeData{T}} (:default => solverData), smallData, dataDict, Ref (solvable))
247
+ end
248
+ end
239
249
240
250
Base. getproperty (x:: DFGVariable ,f:: Symbol ) = begin
241
251
if f == :solvable
0 commit comments