@@ -95,7 +95,7 @@ StructUtils.lift(::Type{<:State}, obj) = DFG.unpackState(obj)
9595
9696# #------------------------------------------------------------------------------
9797# # States - OrderedDict{Symbol, State}
98- const States = OrderedDict{Symbol, State{T, P, N}} where {T<: AbstractStateType ,P, N}
98+ const States = OrderedDict{Symbol, State{T, P, N}} where {T <: AbstractStateType , P, N}
9999
100100StructUtils. dictlike (:: Type{<:States} ) = false
101101StructUtils. structlike (:: Type{<:States} ) = false
@@ -107,7 +107,11 @@ function StructUtils.lower(states::States)
107107 end
108108end
109109
110- function StructUtils. lift (:: StructUtils.StructStyle , S:: Type{<:States{T}} , json_vector) where T
110+ function StructUtils. lift (
111+ :: StructUtils.StructStyle ,
112+ S:: Type{<:States{T}} ,
113+ json_vector,
114+ ) where {T}
111115 states = S ()
112116 foreach (json_vector) do obj
113117 return push! (states, Symbol (obj. label) => StructUtils. make (State{T}, obj))
@@ -170,7 +174,10 @@ version(::Type{<:VariableDFG}) = v"0.29"
170174refStates (v:: VariableDFG ) = v. states
171175
172176# NOTE fielddefaults and fieldtags not through @kwarg macro due to error with State{T, P, N}
173- function StructUtils. fielddefaults (:: StructUtils.StructStyle , :: Type{VariableDFG{T,P,N}} ) where {T,P,N}
177+ function StructUtils. fielddefaults (
178+ :: StructUtils.StructStyle ,
179+ :: Type{VariableDFG{T, P, N}} ,
180+ ) where {T, P, N}
174181 return (
175182 timestamp = TimeDateZone (now (localzone ())),
176183 tags = Set {Symbol} (),
@@ -223,8 +230,12 @@ function VariableDFG(
223230 timestamp = TimeDateZone (timestamp)
224231 end
225232 if ! isnothing (nanosecondtime)
226- @assert isnothing (steadytime), " nanosecondtime is replaced by steadytime. Cannot specify both steadytime and nanosecondtime"
227- Base. depwarn (" nanosecondtime kwarg is deprecated, use steadytime instead" , :VariableDFG )
233+ @assert isnothing (steadytime),
234+ " nanosecondtime is replaced by steadytime. Cannot specify both steadytime and nanosecondtime"
235+ Base. depwarn (
236+ " nanosecondtime kwarg is deprecated, use steadytime instead" ,
237+ :VariableDFG ,
238+ )
228239 steadytime = Nanosecond (nanosecondtime)
229240 end
230241 if ! isnothing (smalldata)
@@ -235,25 +246,13 @@ function VariableDFG(
235246
236247 N = getDimension (T)
237248 P = getPointType (T)
238- return VariableDFG {T, P, N} (;
239- label,
240- steadytime,
241- solvable,
242- tags,
243- timestamp,
244- kwargs... ,
245- )
249+ return VariableDFG {T, P, N} (; label, steadytime, solvable, tags, timestamp, kwargs... )
246250end
247251
248252function VariableDFG (label:: Symbol , state:: State ; kwargs... )
249- return VariableCompute (;
250- label,
251- states = OrderedDict (state. label => state),
252- kwargs... ,
253- )
253+ return VariableCompute (; label, states = OrderedDict (state. label => state), kwargs... )
254254end
255255
256-
257256# Base.getproperty(x::VariableCompute, f::Symbol) = begin
258257# if f == :solvable
259258# getfield(x, f)[]
@@ -321,10 +320,7 @@ Base.@kwdef struct VariableSkeleton <: AbstractGraphVariable
321320 tags:: Set{Symbol} = Set {Symbol} ()
322321end
323322
324- function VariableSkeleton (
325- label:: Symbol ,
326- tags = Set {Symbol} ();
327- )
323+ function VariableSkeleton (label:: Symbol , tags = Set {Symbol} ();)
328324 return VariableSkeleton (label, tags)
329325end
330326
0 commit comments