Skip to content

Commit a382bcd

Browse files
committed
bug fixes
1 parent 59ae304 commit a382bcd

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/DataBlobs/services/AbstractDataEntries.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ end
225225
If the blob label `datalabel` already exists, then this function will return the name `datalabel_1`.
226226
If the blob label `datalabel_1` already exists, then this function will return the name `datalabel_2`.
227227
"""
228-
function incrBlobLabelSuffix(
228+
function incrDataLabelSuffix(
229229
dfg::AbstractDFG,
230230
vla,
231-
bllb;
231+
bllb::S;
232232
datalabel=Ref("")
233-
)
233+
) where {S <: Union{Symbol, <:AbstractString}}
234234
count = 1
235235
hasund = false
236236
try
@@ -253,5 +253,6 @@ function incrBlobLabelSuffix(
253253
end
254254
bllb *= !hasund || bllb[end] != '_' ? "_" : ""
255255
bllb *= string(count)
256-
bllb
256+
257+
S(bllb)
257258
end

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export addDataEntry!, getDataEntry, updateDataEntry!, deleteDataEntry!, getDataE
199199
export listDataEntrySequence
200200
# convenience wrappers
201201
export addDataEntry!, mergeDataEntries!
202-
export incrBlobLabelSuffix
202+
export incrDataLabelSuffix
203203
# aliases
204204
export addData!
205205

test/consol_DataEntryBlobTests.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ ade,adb = addData!(dfg, :filestore, :x1, :random, dataset1)
9595
ade,adb = addData!(dfg, :filestore, :x1, :another_1, dataset1)
9696
gde,gdb = getData(dfg, :x1, :random)
9797

98-
@test incrBlobLabelSuffix(dfg,:x2,:random) == :random_1
99-
@test incrBlobLabelSuffix(dfg,:x2,:another) == :another_2
98+
@test incrDataLabelSuffix(dfg,:x1,:random) == :random_1
99+
@test incrDataLabelSuffix(dfg,:x1,:another) == :another_2
100+
# @test incrDataLabelSuffix(dfg,:x1,"random") == "random_1" # TODO expand support for label::String
100101

101102
dde,ddb = deleteData!(dfg, :x1, :random)
102103

0 commit comments

Comments
 (0)