diff --git a/Project.toml b/Project.toml index 1ddc9da1..ad31ed51 100644 --- a/Project.toml +++ b/Project.toml @@ -60,6 +60,7 @@ TimeZones = "1.3.1" julia = "1.9" [extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -69,4 +70,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "DataStructures", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"] +test = ["Aqua", "Test", "DataStructures", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"] diff --git a/src/DataBlobs/services/BlobStores.jl b/src/DataBlobs/services/BlobStores.jl index 7435cde8..333f2561 100644 --- a/src/DataBlobs/services/BlobStores.jl +++ b/src/DataBlobs/services/BlobStores.jl @@ -112,7 +112,7 @@ function addBlob!(dfg::AbstractDFG, entry::BlobEntry, data) return addBlob!(getBlobStore(dfg, entry.blobstore), entry, data) end -function addBlob!(store::AbstractBlobStore, entry::BlobEntry, data) +function addBlob!(store::AbstractBlobStore{T}, entry::BlobEntry, data::T) where {T} blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId return addBlob!(store, blobId, data) end @@ -125,7 +125,9 @@ function addBlob!(store::AbstractBlobStore, blobId::UUID, data, ::String) return addBlob!(store, blobId, data) end -addBlob!(store::AbstractBlobStore, data, ::String) = addBlob!(store, uuid4(), data) +function addBlob!(store::AbstractBlobStore{T}, data::T, ::String) where {T} + return addBlob!(store, uuid4(), data) +end #update function updateBlob!(dfg::AbstractDFG, entry::BlobEntry, data::T) where {T} @@ -336,3 +338,6 @@ end function deleteBlob!(store::LinkStore, args...) return error("deleteDataBlob(::LinkStore) not supported") end + +deleteBlob!(store::LinkStore, ::BlobEntry) = deleteBlob!(store) +deleteBlob!(store::LinkStore, ::UUID) = deleteBlob!(store) diff --git a/src/Deprecated.jl b/src/Deprecated.jl index 8d842e74..6daa4f4f 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -94,9 +94,7 @@ abstract type AbstractBlobEntry end @deprecate addDataEntry!(w...; kw...) addBlobEntry!(w...; kw...) @deprecate updateDataEntry!(w...; kw...) updateBlobEntry!(w...; kw...) @deprecate deleteDataEntry!(w...; kw...) deleteBlobEntry!(w...; kw...) -@deprecate listDataEntry(w...; kw...) listBlobEntry(w...; kw...) @deprecate listDataEntrySequence(w...; kw...) listBlobEntrySequence(w...; kw...) -@deprecate mergeDataEntry!(w...; kw...) mergeBlobEntry!(w...; kw...) # @deprecate getData(w...;kw...) getBlob(w...;kw...) @deprecate getDataBlob(w...; kw...) getBlob(w...; kw...) diff --git a/src/DistributedFactorGraphs.jl b/src/DistributedFactorGraphs.jl index 651ba754..a3b5fdc6 100644 --- a/src/DistributedFactorGraphs.jl +++ b/src/DistributedFactorGraphs.jl @@ -152,7 +152,6 @@ export DFGFactor, DFGFactorSummary, SkeletonDFGFactor, PackedFactor # Common export getSolvable, setSolvable!, isSolvable -export getInternalId export getVariableLabelNumber # accessors @@ -164,9 +163,6 @@ export isSolveInProgress, getSolveInProgress # CRUD & SET export listTags, mergeTags!, removeTags!, emptyTags! -#this isn't acttually implemented. TODO remove or implement -export addTags! - ##------------------------------------------------------------------------------ # Variable ##------------------------------------------------------------------------------ @@ -185,8 +181,6 @@ export getVariableType export getDimension, getManifold, getPointType export getPointIdentity, getPoint, getCoordinates -export getManifolds # TODO Deprecate? - # Small Data CRUD export SmallDataTypes, getSmallData, @@ -242,12 +236,11 @@ export hasBlobEntry, addBlobEntry!, updateBlobEntry!, deleteBlobEntry!, - listBlobEntry, listBlobEntrySequence, - mergeBlobEntry! + mergeBlobEntries! export incrDataLabelSuffix -export getBlobEntries, listDataEntries, hasDataEntry, hasDataEntry +export getBlobEntries, hasDataEntry, hasDataEntry export getBlobEntriesVariables export listDataEntrySequence # convenience wrappers @@ -319,7 +312,6 @@ export compare, compareFactor, compareAllVariables, compareSimilarVariables, - compareSubsetFactorGraph, compareSimilarFactors, compareFactorGraphs diff --git a/test/runtests.jl b/test/runtests.jl index 2e3ae496..384c1acc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,6 +6,7 @@ using Dates using TimeZones using SHA using UUIDs +using Aqua # If you want to enable debugging logging (very verbose!) # using Logging @@ -142,3 +143,14 @@ struct NotImplementedDFG{T} <: AbstractDFG{T} end @test_throws ErrorException isVariable(dfg, :a) @test_throws ErrorException isFactor(dfg, :a) end + +@testset "Testing Code Quality with Aqua" begin + Aqua.test_ambiguities([DistributedFactorGraphs]) + Aqua.test_unbound_args(DistributedFactorGraphs) + Aqua.test_undefined_exports(DistributedFactorGraphs) + Aqua.test_piracy(DistributedFactorGraphs) + Aqua.test_project_extras(DistributedFactorGraphs) + Aqua.test_stale_deps(DistributedFactorGraphs; ignore = [:Colors]) + Aqua.test_deps_compat(DistributedFactorGraphs) + Aqua.test_project_toml_formatting(DistributedFactorGraphs) +end