diff --git a/NEWS.md b/NEWS.md
index 6fa624f6..aad56560 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -19,6 +19,9 @@ Listing news on any major breaking changes in DFG. For regular changes, see int
- Deprecate listVariableSolverData -> listVariableStates
- Deprecate getVariableSolverDataAll -> getVariableStates
- Deprecate getSolverData -> getVariableState/getFactorState
+- Deprecate getBlobentryFirst -> getfirstBlobentry, see #1114
+- OrderedDict is no longer exported
+- FolderStore path now includes the store label.
# v0.26
- Graph structure plotting now uses GraphMakie.jl instead of GraphPlot.jl. Update by replacing `using GraphPlot` with `using GraphMakie`.
diff --git a/Project.toml b/Project.toml
index 5ab17ac9..cdd4b116 100644
--- a/Project.toml
+++ b/Project.toml
@@ -21,7 +21,6 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
-Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
@@ -64,7 +63,6 @@ Pkg = "1.4, 1.5"
ProgressMeter = "1"
Random = "1.10"
RecursiveArrayTools = "2, 3"
-Reexport = "1"
SHA = "0.7, 1"
SparseArrays = "1.10"
StaticArrays = "1"
diff --git a/README.md b/README.md
index 30200148..88a085ac 100644
--- a/README.md
+++ b/README.md
@@ -2,13 +2,13 @@
Click on badges to follow links:
-| Release v0.25 | Dev | Coverage | Documentation |
+| Release v0.26 | Dev | Coverage | Documentation |
|---------------|-----|----------|---------------|
| [![CI][dfg-ci-stb-img]][dfg-ci-stb-url] | [![CI][dfg-ci-dev-img]][dfg-ci-dev-url]
[](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url]
[](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/)
[](http://juliarobotics.github.io/Caesar.jl/latest/)
[dfg-ci-dev-img]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml/badge.svg
[dfg-ci-dev-url]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml
-[dfg-ci-stb-img]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml/badge.svg?branch=release%2Fv0.25
+[dfg-ci-stb-img]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml/badge.svg?branch=release%2Fv0.26
[dfg-ci-stb-url]: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/actions/workflows/ci.yml
[dfg-cov-img]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl/coverage.svg?branch=develop
[dfg-cov-url]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl?branch=develop
diff --git a/src/DataBlobs/entities/BlobEntry.jl b/src/DataBlobs/entities/BlobEntry.jl
index 6439bff4..ce9712cc 100644
--- a/src/DataBlobs/entities/BlobEntry.jl
+++ b/src/DataBlobs/entities/BlobEntry.jl
@@ -17,7 +17,7 @@ Base.@kwdef struct Blobentry
id::Union{UUID, Nothing} = nothing
""" Machine friendly and globally unique identifier of the 'Blob', usually assigned from a common point in the system. This can be used to guarantee unique retrieval of the large data blob. """
blobId::Union{UUID, Nothing} = uuid4() #Deprecated in v0.25 TODO remove union, blobId is mandatory
- """ Machine friendly and locally assigned identifier of the 'Blob'. `.originId`s are mandatory upon first creation at the origin regardless of network access. Separate from `.blobId` since some architectures do not allow edge processes to assign a uuid4 to data store elements. """
+ """ TBD if Deprecated. Machine friendly and locally assigned identifier of the 'Blob'."""
originId::Union{UUID, Nothing} = blobId #Deprecated in v0.25 TODO remove union or remove originId completely
""" Human friendly label of the `Blob` and also used as unique identifier per node on which a `Blobentry` is added. E.g. do "LEFTCAM_1", "LEFTCAM_2", ... of you need to repeat a label on the same variable. """
label::Symbol
diff --git a/src/DataBlobs/services/BlobEntry.jl b/src/DataBlobs/services/BlobEntry.jl
index a208acca..76e7d582 100644
--- a/src/DataBlobs/services/BlobEntry.jl
+++ b/src/DataBlobs/services/BlobEntry.jl
@@ -44,7 +44,6 @@ function Base.show(io::IO, ::MIME"text/plain", entry::Blobentry)
println(io, "Blobentry {")
println(io, " id: ", entry.id)
println(io, " blobId: ", entry.blobId)
- println(io, " originId: ", entry.originId)
println(io, " label: ", entry.label)
println(io, " blobstore: ", entry.blobstore)
println(io, " hash: ", entry.hash)
@@ -84,23 +83,26 @@ function getBlobentry(var::VariableDFG, key::Symbol)
return var.blobEntries[findfirst(x -> x.label == key, var.blobEntries)]
end
-#TODO maybe rename to getBlobentryFirst
-function getBlobentry(var::AbstractDFGVariable, blobId::UUID)
+"""
+ $(SIGNATURES)
+Finds and returns the first blob entry that matches the filter.
+
+Also see: [`getBlobentry`](@ref)
+"""
+function getfirstBlobentry(var::AbstractDFGVariable, blobId::UUID)
for (k, v) in var.dataDict
- if blobId in [v.originId, v.blobId]
+ if blobId == v.blobId
return v
end
end
throw(KeyError("No blobEntry with blobId $(blobId) found in variable $(getLabel(var))"))
end
-"""
- $(SIGNATURES)
-Finds and returns the first blob entry that matches the regex.
+function getfirstBlobentry(dfg::AbstractDFG, label::Symbol, blobId::UUID)
+ return getfirstBlobentry(getVariable(dfg, label), blobId)
+end
-Also see: [`getBlobentry`](@ref)
-"""
-function getBlobentryFirst(var::AbstractDFGVariable, key::Regex)
+function getfirstBlobentry(var::AbstractDFGVariable, key::Regex)
for (k, v) in var.dataDict
if occursin(key, string(v.label))
return v
@@ -113,7 +115,7 @@ function getBlobentryFirst(var::AbstractDFGVariable, key::Regex)
)
end
-function getBlobentryFirst(var::VariableDFG, key::Regex)
+function getfirstBlobentry(var::VariableDFG, key::Regex)
firstIdx = findfirst(x -> contains(string(x.label), key), var.blobEntries)
if isnothing(firstIdx)
throw(KeyError("$key"))
@@ -121,7 +123,7 @@ function getBlobentryFirst(var::VariableDFG, key::Regex)
return var.blobEntries[firstIdx]
end
-function getBlobentryFirst(dfg::AbstractDFG, label::Symbol, key::Regex)
+function getfirstBlobentry(dfg::AbstractDFG, label::Symbol, key::Regex)
els = listBlobentries(dfg, label)
firstIdx = findfirst(contains(key), string.(els))
isnothing(firstIdx) && throw(
@@ -136,13 +138,13 @@ end
# verbNoun(dfg::VariableCompute, label::Symbol, args...; kwargs...) = verbNoun(getVariable(dfg, label), args...; kwargs...)
# with something like:
# getvariablemethod = [
-# :getBlobentryFirst,
+# :getfirstBlobentry,
# ]
# for met in methodstooverload
# @eval DistributedFactorGraphs $met(dfg::AbstractDFG, label::Symbol, args...; kwargs...) = $met(getVariable(dfg, label), args...; kwargs...)
# end
-function getBlobentry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol, UUID})
+function getBlobentry(dfg::AbstractDFG, label::Symbol, key::Symbol)
return getBlobentry(getVariable(dfg, label), key)
end
# getBlobentry(dfg::AbstractDFG, label::Symbol, key::Symbol) = getBlobentry(getVariable(dfg, label), key)
diff --git a/src/DataBlobs/services/BlobStores.jl b/src/DataBlobs/services/BlobStores.jl
index 28d8ca1e..436cd645 100644
--- a/src/DataBlobs/services/BlobStores.jl
+++ b/src/DataBlobs/services/BlobStores.jl
@@ -81,7 +81,8 @@ end
##==============================================================================
## AbstractBlobstore derived CRUD for Blob
##==============================================================================
-
+#TODO looking in all the blobstores does not make sense since since there is a chance that the blobId is not unique across blobstores.
+# using the cached blobstore is the right way to go here.
function getBlob(dfg::AbstractDFG, entry::Blobentry)
stores = getBlobstores(dfg)
storekeys = collect(keys(stores))
@@ -111,8 +112,7 @@ function getBlob(dfg::AbstractDFG, entry::Blobentry)
end
function getBlob(store::AbstractBlobstore, entry::Blobentry)
- blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId
- return getBlob(store, blobId)
+ return getBlob(store, entry.blobId)
end
#add
@@ -121,11 +121,10 @@ function addBlob!(dfg::AbstractDFG, entry::Blobentry, data)
end
function addBlob!(store::AbstractBlobstore{T}, entry::Blobentry, data::T) where {T}
- blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId
- return addBlob!(store, blobId, data)
+ return addBlob!(store, entry.blobId, data)
end
-# also creates an originId as uuid4
+# also creates an blobId as uuid4
addBlob!(store::AbstractBlobstore, data) = addBlob!(store, uuid4(), data)
#update
@@ -142,13 +141,15 @@ function deleteBlob!(dfg::AbstractDFG, entry::Blobentry)
end
function deleteBlob!(store::AbstractBlobstore, entry::Blobentry)
- blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId
- return deleteBlob!(store, blobId)
+ return deleteBlob!(store, entry.blobId)
end
#has
+function hasBlob(store::AbstractBlobstore, entry::Blobentry)
+ return hasBlob(store, entry.blobId)
+end
function hasBlob(dfg::AbstractDFG, entry::Blobentry)
- return hasBlob(getBlobstore(dfg, entry.blobstore), entry.originId)
+ return hasBlob(getBlobstore(dfg, entry.blobstore), entry.blobId)
end
#TODO
@@ -182,19 +183,22 @@ end
#TODO added in v0.25 to avoid a breaking change in deserialization old DFGs, remove.
StructTypes.StructType(::Type{<:FolderStore}) = StructTypes.OrderedStruct()
-function FolderStore(foldername::String; label = :default_folder_store, createfolder = true)
- if createfolder && !isdir(foldername)
- @info "Folder '$foldername' doesn't exist - creating."
+function FolderStore(foldername::String; label::Symbol = :default, createfolder = true)
+ storepath = joinpath(foldername, string(label))
+ if createfolder && !isdir(storepath)
+ @info "Folder '$storepath' doesn't exist - creating."
# create new folder
- mkpath(foldername)
+ mkpath(storepath)
end
return FolderStore{Vector{UInt8}}(label, foldername)
end
-blobfilename(store::FolderStore, blobId::UUID) = joinpath(store.folder, string(blobId))
+function blobfilename(store::FolderStore, blobId::UUID)
+ return joinpath(store.folder, string(store.label), string(blobId))
+end
function getBlob(store::FolderStore{T}, blobId::UUID) where {T}
- blobfilename = joinpath(store.folder, string(blobId))
+ blobfilename = joinpath(store.folder, string(store.label), string(blobId))
if isfile(blobfilename)
open(blobfilename) do f
return read(f)
@@ -205,7 +209,7 @@ function getBlob(store::FolderStore{T}, blobId::UUID) where {T}
end
function addBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
- blobfilename = joinpath(store.folder, string(blobId))
+ blobfilename = joinpath(store.folder, string(store.label), string(blobId))
if isfile(blobfilename)
throw(KeyError("Key '$blobId' blob already exists."))
else
@@ -218,7 +222,7 @@ function addBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
end
function updateBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
- blobfilename = joinpath(store.folder, string(blobId))
+ blobfilename = joinpath(store.folder, string(store.label), string(blobId))
if !isfile(blobfilename)
@warn "Key '$blobId' doesn't exist."
else
@@ -230,18 +234,18 @@ function updateBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
end
function deleteBlob!(store::FolderStore{T}, blobId::UUID) where {T}
- blobfilename = joinpath(store.folder, string(blobId))
+ blobfilename = joinpath(store.folder, string(store.label), string(blobId))
rm(blobfilename)
return 1
end
#hasBlob or existsBlob?
function hasBlob(store::FolderStore, blobId::UUID)
- blobfilename = joinpath(store.folder, string(blobId))
+ blobfilename = joinpath(store.folder, string(store.label), string(blobId))
return isfile(blobfilename)
end
-hasBlob(store::FolderStore, entry::Blobentry) = hasBlob(store, entry.originId)
+hasBlob(store::FolderStore, entry::Blobentry) = hasBlob(store, entry.blobId)
listBlobs(store::FolderStore) = readdir(store.folder)
##==============================================================================
@@ -319,7 +323,7 @@ function getBlob(store::LinkStore, blobId::UUID)
end
function addBlob!(store::LinkStore, entry::Blobentry, linkfile::String)
- return addBlob!(store, entry.originId, nothing, linkfile::String)
+ return addBlob!(store, entry.blobId, nothing, linkfile::String)
end
function addBlob!(store::LinkStore, blobId::UUID, blob::Any, linkfile::String)
diff --git a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl
index 7cd6d4e3..acfc67f5 100644
--- a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl
+++ b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl
@@ -87,7 +87,7 @@ function getData(
getlast::Bool = true,
)
_getblobentr(g, v, k) = getBlobentries(g, v, k)
- _getblobentr(g, v, k::UUID) = [getBlobentry(g, v, k);]
+ _getblobentr(g, v, k::UUID) = [getfirstBlobentry(g, v, k);]
de_ = _getblobentr(dfg, vlabel, key)
lbls = (s -> s.label).(de_)
idx = sortperm(lbls; rev = getlast)
@@ -181,8 +181,8 @@ function addData!(
metadata = "",
mimeType::String = "application/octet-stream",
id::Union{UUID, Nothing} = nothing,
- blobId::Union{UUID, Nothing} = nothing, #only assign if blobstore issued you an id
- originId::UUID = uuid4(),
+ blobId::UUID = uuid4(),
+ originId::UUID = blobId,
hashfunction = sha256,
)
#
diff --git a/src/Deprecated.jl b/src/Deprecated.jl
index af363c62..1d971e81 100644
--- a/src/Deprecated.jl
+++ b/src/Deprecated.jl
@@ -62,7 +62,11 @@ const VariableNodeData = VariableState
@deprecate listAgentBlobEntries(args...; kwargs...) listAgentBlobentries(args...; kwargs...)
@deprecate hasBlobEntry(args...; kwargs...) hasBlobentry(args...; kwargs...)
@deprecate getBlobEntry(args...; kwargs...) getBlobentry(args...; kwargs...)
-@deprecate getBlobEntryFirst(args...; kwargs...) getBlobentryFirst(args...; kwargs...)
+@deprecate getBlobEntryFirst(args...; kwargs...) getfirstBlobentry(args...; kwargs...)
+@deprecate getBlobentry(var::AbstractDFGVariable, blobId::UUID) getfirstBlobentry(
+ var::AbstractDFGVariable,
+ blobId::UUID,
+)
@deprecate addBlobEntry!(args...; kwargs...) addBlobentry!(args...; kwargs...)
@deprecate addBlobEntries!(args...; kwargs...) addBlobentries!(args...; kwargs...)
@deprecate mergeBlobEntry!(args...; kwargs...) mergeBlobentry!(args...; kwargs...)
diff --git a/src/DistributedFactorGraphs.jl b/src/DistributedFactorGraphs.jl
index 50fb1d8e..7eb6c7bb 100644
--- a/src/DistributedFactorGraphs.jl
+++ b/src/DistributedFactorGraphs.jl
@@ -20,8 +20,6 @@ using DocStringExtensions
using Dates
using Random
using TimeZones
-using Distributions
-using Reexport
using JSON3
using StructTypes
using LinearAlgebra
@@ -32,11 +30,12 @@ using TensorCast
using ProgressMeter
using SHA
using FileIO
+
+import Distributions
import Tar
import CodecZlib
-using OrderedCollections
-export OrderedDict
+using OrderedCollections: OrderedDict
using CSV
using Tables
@@ -46,7 +45,7 @@ import ManifoldsBase
using ManifoldsBase: AbstractManifold, manifold_dimension
export AbstractManifold, manifold_dimension
-import RecursiveArrayTools: ArrayPartition
+using RecursiveArrayTools: ArrayPartition
export ArrayPartition
using StaticArrays
@@ -57,8 +56,21 @@ using InteractiveUtils: subtypes
##==============================================================================
# Exports
##==============================================================================
+
+# v1 name, signiture, return, and error checked
+
+# v1 name, signiture, and return
+export getFactor, getBlobentry, getGraphBlobentry, getVariableState, getFactorState
+
+# v1 name only
+export getVariable, getBlob, addBlob!
+
+##
const DFG = DistributedFactorGraphs
export DFG
+
+export GraphsDFGs, GraphsDFG
+
##------------------------------------------------------------------------------
## DFG
##------------------------------------------------------------------------------
@@ -78,8 +90,7 @@ export getDescription,
setGraphMetadata!,
getAddHistory
-export getGraphBlobentry,
- getGraphBlobentries,
+export getGraphBlobentries,
addGraphBlobentry!,
addGraphBlobentries!,
mergeGraphBlobentry!,
@@ -102,7 +113,7 @@ export getBlobstore,
# updateGraphMetadata!, deleteAgentMetadata!, deleteGraphMetadata!
# export emptyAgentMetadata!, emptyGraphMetadata!
-# Graph Types: exported from modules or @reexport
+# Graph Types: exported from modules
export InMemoryDFGTypes, LocalDFG
# AbstractDFG Interface
@@ -111,8 +122,6 @@ export exists,
addVariables!,
addFactor!,
addFactors!,
- getVariable,
- getFactor,
mergeVariable!,
mergeFactor!,
deleteVariable!,
@@ -169,7 +178,6 @@ export getSolverDataDict, setSolverData!
export getVariableType, getVariableTypeName
export getObservation
-export getFactorState
export getVariableType
@@ -188,8 +196,7 @@ export getMetadata,
emptyMetadata!
# CRUD & SET
-export getVariableState,
- getVariableStates,
+export getVariableStates,
addVariableState!,
mergeVariableState!,
deleteVariableState!,
@@ -229,8 +236,7 @@ export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph!
##------------------------------------------------------------------------------
export hasBlobentry,
- getBlobentry,
- getBlobentryFirst,
+ getfirstBlobentry,
addBlobentry!,
addBlobentries!,
mergeBlobentry!,
@@ -243,9 +249,8 @@ export getBlobentries
export getBlobentriesVariables
# convenience wrappers
# aliases
-export addBlob!
export packBlob, unpackBlob
-export @format_str
+export @format_str # exported from FileIO
##------------------------------------------------------------------------------
# Factors
@@ -321,7 +326,7 @@ export printFactor, printVariable, printNode
export InMemoryBlobstore
export FolderStore
export Blobentry
-export getBlob, addBlob!, updateBlob!, deleteBlob!, hasBlob, listBlobentries
+export updateBlob!, deleteBlob!, hasBlob, listBlobentries
export listBlobs
export Blobentry
# export copyStore
@@ -372,7 +377,7 @@ include("DataBlobs/services/HelpersDataWrapEntryBlob.jl")
# In Memory Types
include("GraphsDFG/GraphsDFG.jl")
-@reexport using .GraphsDFGs
+using .GraphsDFGs
#supported in Memory fg types
const InMemoryDFGTypes = Union{GraphsDFG}
diff --git a/src/GraphsDFG/services/GraphsDFG.jl b/src/GraphsDFG/services/GraphsDFG.jl
index 7216b477..3200eb05 100644
--- a/src/GraphsDFG/services/GraphsDFG.jl
+++ b/src/GraphsDFG/services/GraphsDFG.jl
@@ -129,6 +129,7 @@ end
function getFactor(dfg::GraphsDFG, label::Symbol)
if !haskey(dfg.g.factors, label)
+ #TODO throw a typed error
error("Factor label '$(label)' does not exist in the factor graph")
end
return dfg.g.factors[label]
diff --git a/src/services/AbstractDFG.jl b/src/services/AbstractDFG.jl
index a7f13558..27cafa66 100644
--- a/src/services/AbstractDFG.jl
+++ b/src/services/AbstractDFG.jl
@@ -339,7 +339,7 @@ end
$(SIGNATURES)
Get a VariableCompute from a DFG using its label.
"""
-function getVariable(dfg::G, label::Union{Symbol, String}) where {G <: AbstractDFG}
+function getVariable(dfg::G, label::Symbol) where {G <: AbstractDFG}
return error("getVariable not implemented for $(typeof(dfg))")
end
@@ -371,7 +371,7 @@ function getVariablesSkeleton end
$(SIGNATURES)
Get a FactorCompute from a DFG using its label.
"""
-function getFactor(dfg::G, label::Union{Symbol, String}) where {G <: AbstractDFG}
+function getFactor(dfg::AbstractDFG, label::Symbol)
return error("getFactor not implemented for $(typeof(dfg))")
end
@@ -523,6 +523,7 @@ end
## CRUD Aliases
##------------------------------------------------------------------------------
+#TODO should this signiture be standardized or removed?
"""
$(SIGNATURES)
Get a VariableCompute with a specific solver key.
diff --git a/src/services/DFGVariable.jl b/src/services/DFGVariable.jl
index e8bb07fd..984c1925 100644
--- a/src/services/DFGVariable.jl
+++ b/src/services/DFGVariable.jl
@@ -702,7 +702,7 @@ function mergeVariableState!(dfg::AbstractDFG, variablekey::Symbol, vnd::Variabl
if !haskey(v.solverDataDict, vnd.solveKey)
addVariableState!(dfg, variablekey, vnd)
else
- v.solverDataDict[vnd.solveKey] = usevnd
+ v.solverDataDict[vnd.solveKey] = vnd
end
return 1
@@ -716,11 +716,10 @@ function copytoVariableState!(
)
newstate = VariableState(
getVariableType(state);
- (k => getproperty(state, k) for k in fieldnames(VariableState))...,
+ (k => deepcopy(getproperty(state, k)) for k in fieldnames(VariableState))...,
solveKey = stateLabel,
)
- #TODO deepcopy to make extra sure we don't have any references, should be improved in future.
- return mergeVariableState!(dfg, variableLabel, deepcopy(newstate))
+ return mergeVariableState!(dfg, variableLabel, newstate)
end
"""
diff --git a/test/consol_DataEntryBlobTests.jl b/test/consol_DataEntryBlobTests.jl
index f7178594..034684c5 100644
--- a/test/consol_DataEntryBlobTests.jl
+++ b/test/consol_DataEntryBlobTests.jl
@@ -86,8 +86,7 @@ dataset2 = rand(UInt8, 1000)
##==============================================================================
# Create a data store and add it to DFG
-mkpath("/tmp/dfgFolderStore")
-ds = FolderStore{Vector{UInt8}}(:filestore, "/tmp/dfgFolderStore")
+ds = FolderStore("/tmp/dfgFolderStore"; label = :filestore)
addBlobstore!(dfg, ds)
ade = addData!(dfg, :filestore, :x1, :random, dataset1)
@@ -122,7 +121,7 @@ deleteData!(dfg, :x2, :random)
#test default folder store
dfs = FolderStore("/tmp/defaultfolderstore")
@test dfs.folder == "/tmp/defaultfolderstore"
-@test getLabel(dfs) == :default_folder_store
+@test getLabel(dfs) == :default
@test dfs isa FolderStore{Vector{UInt8}}
##==============================================================================
diff --git a/test/iifInterfaceTests.jl b/test/iifInterfaceTests.jl
index 39830652..9f03ac1d 100644
--- a/test/iifInterfaceTests.jl
+++ b/test/iifInterfaceTests.jl
@@ -223,7 +223,7 @@ end
@testset "Data Entries" begin
de1 = Blobentry(;
- originId = uuid4(),
+ blobId = uuid4(),
label = :key1,
blobstore = :test,
hash = "",
@@ -233,7 +233,7 @@ end
)
de2 = Blobentry(;
- originId = uuid4(),
+ blobId = uuid4(),
label = :key2,
blobstore = :test,
hash = "",
@@ -243,7 +243,7 @@ end
)
de2_update = Blobentry(;
- originId = uuid4(),
+ blobId = uuid4(),
label = :key2,
blobstore = :test,
hash = "",
diff --git a/test/runtests.jl b/test/runtests.jl
index 80a5cc11..434bd5ec 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -8,6 +8,8 @@ using SHA
using UUIDs
using Aqua
+using DistributedFactorGraphs: ArrayPartition, OrderedDict
+
# If you want to enable debugging logging (very verbose!)
# using Logging
# logger = SimpleLogger(stdout, Logging.Debug)
diff --git a/test/testBlocks.jl b/test/testBlocks.jl
index df7c71a5..124135aa 100644
--- a/test/testBlocks.jl
+++ b/test/testBlocks.jl
@@ -258,7 +258,6 @@ function GraphAgentBlobentries!(fg::AbstractDFG)
be = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :key1,
blobstore = :b,
hash = "",
@@ -909,7 +908,6 @@ function DataEntriesTestBlock!(fg, v2)
storeEntry = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :a,
blobstore = :b,
hash = "",
@@ -928,7 +926,6 @@ function DataEntriesTestBlock!(fg, v2)
de1 = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :key1,
blobstore = :b,
hash = "",
@@ -943,7 +940,6 @@ function DataEntriesTestBlock!(fg, v2)
de2 = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :key2,
blobstore = :b,
hash = "",
@@ -958,7 +954,6 @@ function DataEntriesTestBlock!(fg, v2)
de2_update = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :key2,
blobstore = :b,
hash = "",
@@ -1018,7 +1013,6 @@ function blobsStoresTestBlock!(fg)
de1 = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :label1,
blobstore = :store1,
hash = "AAAA",
@@ -1030,7 +1024,6 @@ function blobsStoresTestBlock!(fg)
de2 = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :label2,
blobstore = :store2,
hash = "FFFF",
@@ -1043,7 +1036,6 @@ function blobsStoresTestBlock!(fg)
de2_update = Blobentry(;
id = uuid4(),
blobId = uuid4(),
- originId = uuid4(),
label = :label2,
blobstore = :store2,
hash = "0123",
@@ -1130,8 +1122,8 @@ function blobsStoresTestBlock!(fg)
@test data[1].hash == newData.hash #[1]
data = getData(fg, :a, r"testing") # convenience wrapper over getBlob
@test data[1].hash == newData.hash #[1]
- be = getBlobentryFirst(fg, :a, r"testing")
- data = getData(fg, :a, be.originId) # convenience wrapper over getBlob
+ be = getfirstBlobentry(fg, :a, r"testing")
+ data = getData(fg, :a, be.blobId) # convenience wrapper over getBlob
@test data[1].hash == newData.hash #[1]
# @test data[2] == newData[2]
# Updating