Skip to content

Commit 971b70f

Browse files
authored
Merge pull request #978 from JuliaRobotics/bug/fixing_small_bugs
Fixing naming and small serialization issues.
2 parents 84784ca + d98863d commit 971b70f

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

src/DataBlobs/DataBlobs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
using SHA
33

4-
include("entities/AbstractBlobEntries.jl")
4+
include("entities/BlobEntry.jl")
55
include("entities/BlobStores.jl")
66

77
include("services/AbstractBlobEntries.jl")

src/DataBlobs/entities/AbstractBlobEntries.jl renamed to src/DataBlobs/entities/BlobEntry.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
##==============================================================================
3-
## BlobStoreEntry
3+
## BlobEntry
44
##==============================================================================
55

66
"""
@@ -26,5 +26,10 @@ General Data Store Entry.
2626
_version::String = string(_getDFGVersion()) # TBD consider upgrading to ::VersionNumber
2727
end
2828

29+
StructTypes.StructType(::Type{BlobEntry}) = StructTypes.UnorderedStruct()
30+
StructTypes.idproperty(::Type{BlobEntry}) = :id
31+
StructTypes.omitempties(::Type{BlobEntry}) = (:id,)
32+
33+
2934

3035
_fixtimezone(cts::NamedTuple) = ZonedDateTime(cts.utc_datetime*"+00")

src/entities/DFGVariable.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Base.@kwdef struct PackedVariable
186186
timestamp::ZonedDateTime
187187
nstime::Int
188188
ppes::Vector{MeanMaxPPE}
189-
dataEntries::Vector{BlobEntry}
189+
blobEntries::Vector{BlobEntry}
190190
variableType::String
191191
_version::String
192192
metadata::String

src/services/Serialization.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function packVariable(v::AbstractDFGVariable; includePPEs::Bool=true, includeSol
158158
metadata = base64encode(JSON3.write(v.smallData)),
159159
solvable = v.solvable,
160160
variableType = DFG.typeModuleName(DFG.getVariableType(v)),
161-
dataEntries = collect(values(v.dataDict)),
161+
blobEntries = collect(values(v.dataDict)),
162162
_version = string(DFG._getDFGVersion()))
163163
end
164164

@@ -174,7 +174,7 @@ function unpackVariable(variable::PackedVariable; skipVersionCheck::Bool=false)
174174
solverDict = Dict{Symbol, VariableNodeData{variableType, pointType}}(
175175
map(sd -> sd.solveKey, variable.solverData) .=>
176176
map(sd -> DFG.unpackVariableNodeData(sd), variable.solverData))
177-
dataDict = Dict{Symbol, BlobEntry}(map(de -> de.label, variable.dataEntries) .=> variable.dataEntries)
177+
dataDict = Dict{Symbol, BlobEntry}(map(de -> de.label, variable.blobEntries) .=> variable.blobEntries)
178178
metadata = JSON3.read(base64decode(variable.metadata), Dict{Symbol, DFG.SmallDataTypes})
179179

180180
return DFGVariable(
@@ -215,11 +215,11 @@ function _packSolverData(
215215
end
216216
end
217217

218-
# returns ::Dict{String, <:Any}
218+
# returns PackedFactor
219219
function packFactor(dfg::AbstractDFG, f::DFGFactor)
220220
fnctype = getSolverData(f).fnc.usrfnc!
221221
return PackedFactor(;
222-
id = f.id !== nothing ? string(f.id) : nothing,
222+
id = f.id,
223223
label = f.label,
224224
tags = collect(f.tags),
225225
_variableOrderSymbols = f._variableOrderSymbols,

test/data/0_20_0.tar.gz

-2 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)