Skip to content

Commit f4fcf1d

Browse files
committed
simpler pack variable
1 parent e0df965 commit f4fcf1d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Deprecated.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
99
return DateTime(ts, Local)
1010
end
1111

12+
13+
## ================================================================================
14+
## Add @deprecate in v0.19, remove after v0.20
15+
##=================================================================================
16+
17+
18+
# TODO ADD DEPRECATION
19+
packVariable(::AbstractDFG, v::DFGVariable) = packVariable(v)
20+
21+
22+
1223
## ================================================================================
1324
## Deprecate before v0.20 - Kept longer with error
1425
##=================================================================================

src/services/Serialization.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ end
120120
##==============================================================================
121121
## Variable Packing and unpacking
122122
##==============================================================================
123-
function packVariable(dfg::AbstractDFG, v::DFGVariable)
123+
function packVariable(v::DFGVariable)
124124
props = Dict{String, Any}()
125125
props["label"] = string(v.label)
126126
props["timestamp"] = Dates.format(v.timestamp, "yyyy-mm-ddTHH:MM:SS.ssszzz")
127127
props["nstime"] = string(v.nstime.value)
128128
props["tags"] = JSON2.write(v.tags)
129129
props["ppeDict"] = JSON2.write(v.ppeDict)
130-
props["solverDataDict"] = JSON2.write(Dict(keys(v.solverDataDict) .=> map(vnd -> packVariableNodeData(dfg, vnd), values(v.solverDataDict))))
130+
props["solverDataDict"] = JSON2.write(Dict(keys(v.solverDataDict) .=> map(vnd -> packVariableNodeData(vnd), values(v.solverDataDict))))
131131
props["smallData"] = JSON2.write(v.smallData)
132132
props["solvable"] = v.solvable
133133
props["variableType"] = typeModuleName(getVariableType(v))
@@ -137,6 +137,7 @@ function packVariable(dfg::AbstractDFG, v::DFGVariable)
137137
return props::Dict{String, Any}
138138
end
139139

140+
140141
"""
141142
$(SIGNATURES)
142143

0 commit comments

Comments
 (0)