Skip to content

Commit ee4c93d

Browse files
authored
Merge branch 'develop' into compathelper/new_version/2025-10-03-01-06-04-647-02452626131
2 parents 7dd5bc9 + 1657788 commit ee4c93d

21 files changed

Lines changed: 1147 additions & 1088 deletions

Project.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.27.1"
3+
version = "0.28.0"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -13,7 +13,7 @@ DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1313
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
1414
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1515
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
16-
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
16+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1717
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1818
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
1919
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
@@ -24,7 +24,6 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2424
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
2525
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2626
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
27-
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
2827
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
2928
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
3029
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
@@ -46,19 +45,18 @@ Base64 = "1.10"
4645
CSV = "0.10"
4746
CodecZlib = "0.7"
4847
Colors = "0.10, 0.11, 0.12, 0.13"
49-
DataStructures = "0.18"
5048
Dates = "1.10"
5149
Distributions = "0.23, 0.24, 0.25"
5250
DocStringExtensions = "0.8, 0.9"
5351
FileIO = "1"
5452
GraphMakie = "0.5.14, 0.6"
5553
Graphs = "1.4"
5654
InteractiveUtils = "1.10"
57-
JSON3 = "1"
55+
JSON = "1.0.0"
5856
LieGroups = "0.1"
5957
LinearAlgebra = "1.10"
60-
Manifolds = "0.9, 0.10"
61-
ManifoldsBase = "0.14, 0.15, 1, 2"
58+
Manifolds = "0.10, 0.11"
59+
ManifoldsBase = "1, 2"
6260
OrderedCollections = "1.4"
6361
Pkg = "1.4, 1.5"
6462
ProgressMeter = "1"
@@ -68,7 +66,6 @@ SHA = "0.7, 1"
6866
SparseArrays = "1.10"
6967
StaticArrays = "1"
7068
Statistics = "1.10"
71-
StructTypes = "1"
7269
Tables = "v1.11.1"
7370
Tar = "1.9"
7471
TensorCast = "0.3.3, 0.4"
@@ -79,7 +76,6 @@ julia = "1.10"
7976

8077
[extras]
8178
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
82-
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
8379
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
8480
LieGroups = "6774de46-80ba-43f8-ba42-e41071ccfc5f"
8581
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -89,4 +85,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
8985
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9086

9187
[targets]
92-
test = ["Aqua", "Test", "DataStructures", "GraphMakie", "LinearAlgebra", "Manifolds", "Pkg", "Statistics", "LieGroups"]
88+
test = ["Aqua", "Test", "GraphMakie", "LinearAlgebra", "Manifolds", "Pkg", "Statistics", "LieGroups"]

docs/src/blob_ref.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Pages = [
2626
"DataBlobs/services/BlobEntry.jl",
2727
"DataBlobs/services/BlobStores.jl",
2828
"DataBlobs/services/BlobPacking.jl",
29-
"DataBlobs/services/HelpersDataWrapEntryBlob.jl",
29+
"DataBlobs/services/BlobWrappers.jl",
3030
]
3131
3232
```

src/DataBlobs/entities/BlobEntry.jl

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
##==============================================================================
33
## Blobentry
44
##==============================================================================
5-
5+
#TODO think origin and buildSourceString should be deprecated, description can be used instead
6+
#TODO hash - maybe use both crc32c for fast error check and sha256 for strong integrity check
7+
# stored seperately as crc and sha or as a tuple `hash::Tuple{Symbol, String}` where Symbol is :crc32c or :sha256
8+
# or an enum with suppored hash types
69
"""
710
$(TYPEDEF)
811
@@ -16,9 +19,7 @@ Base.@kwdef struct Blobentry
1619
""" Remotely assigned and globally unique identifier for the `Blobentry` itself (not the `.blobId`). """
1720
id::Union{UUID, Nothing} = nothing
1821
""" 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. """
19-
blobId::Union{UUID, Nothing} = uuid4() #Deprecated in v0.25 TODO remove union, blobId is mandatory
20-
""" TBD if Deprecated. Machine friendly and locally assigned identifier of the 'Blob'."""
21-
originId::Union{UUID, Nothing} = blobId #Deprecated in v0.25 TODO remove union or remove originId completely
22+
blobId::UUID = uuid4()
2223
""" 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. """
2324
label::Symbol
2425
""" A hint about where the `Blob` itself might be stored. Remember that a Blob may be duplicated over multiple blobstores. """
@@ -28,7 +29,7 @@ Base.@kwdef struct Blobentry
2829
""" Context from which a Blobentry=>Blob was first created. E.g. agent|graph|varlabel. """
2930
origin::String = ""
3031
""" number of bytes in blob as a string"""
31-
size::Union{String, Nothing} = "-1" #TODO remove union -> size::String = "-1"
32+
size::String = "-1"
3233
""" Additional information that can help a different user of the Blob. """
3334
description::String = ""
3435
""" MIME description describing the format of binary data in the `Blob`, e.g. 'image/png' or 'application/json; _type=CameraModel'. """
@@ -45,6 +46,41 @@ Base.@kwdef struct Blobentry
4546
_version::VersionNumber = _getDFGVersion()
4647
end
4748

48-
StructTypes.StructType(::Type{Blobentry}) = StructTypes.UnorderedStruct()
49-
StructTypes.idproperty(::Type{Blobentry}) = :id
50-
StructTypes.omitempties(::Type{Blobentry}) = (:id,)
49+
function Blobentry(label::Symbol, blobstore = :default; kwargs...)
50+
return Blobentry(; label, blobstore, kwargs...)
51+
end
52+
# construction helper from existing Blobentry for user overriding via kwargs
53+
function Blobentry(
54+
entry::Blobentry;
55+
id::Union{UUID, Nothing} = entry.id,
56+
blobId::UUID = entry.blobId,
57+
label::Symbol = entry.label,
58+
blobstore::Symbol = entry.blobstore,
59+
hash::String = entry.hash,
60+
size::Union{String, Int, Nothing} = entry.size,
61+
origin::String = entry.origin,
62+
description::String = entry.description,
63+
mimeType::String = entry.mimeType,
64+
metadata::String = entry.metadata,
65+
timestamp::ZonedDateTime = entry.timestamp,
66+
createdTimestamp = entry.createdTimestamp,
67+
lastUpdatedTimestamp = entry.lastUpdatedTimestamp,
68+
_version = entry._version,
69+
)
70+
return Blobentry(;
71+
id,
72+
blobId,
73+
label,
74+
blobstore,
75+
hash,
76+
origin,
77+
size = string(size),
78+
description,
79+
mimeType,
80+
metadata,
81+
timestamp,
82+
createdTimestamp,
83+
lastUpdatedTimestamp,
84+
_version,
85+
)
86+
end

src/DataBlobs/services/BlobEntry.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##==============================================================================
22
## Blobentry - common
33
##==============================================================================
4-
4+
#TODO think origin and buildSourceString should be deprecated, description can be used instead
55
"""
66
$(SIGNATURES)
77
Function to generate source string - agentLabel|graphLabel|varLabel
@@ -329,15 +329,16 @@ If the blob label `datalabel_1` already exists, then this function will return t
329329
"""
330330
function incrDataLabelSuffix(
331331
dfg::AbstractDFG,
332-
vla::Union{Symbol, <:AbstractString},
333-
bllb::S;
332+
vla::Symbol,
333+
bllb::Union{Symbol, <:AbstractString};
334334
datalabel = Ref(""),
335-
) where {S <: Union{Symbol, <:AbstractString}}
335+
)
336336
count = 1
337337
hasund = false
338338
len = 0
339339
try
340-
de, _ = getData(dfg, Symbol(vla), bllb)
340+
de = getfirstBlobentry(dfg, vla; labelFilter = contains(string(bllb)))
341+
isnothing(de) && return Symbol(bllb) # no match, return as is
341342
bllb = string(bllb)
342343
# bllb *= bllb[end] != '_' ? "_" : ""
343344
datalabel[] = string(de.label)
@@ -361,5 +362,5 @@ function incrDataLabelSuffix(
361362
end
362363
bllb *= string(count)
363364

364-
return S(bllb)
365+
return Symbol(bllb)
365366
end

src/DataBlobs/services/BlobStores.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ struct FolderStore{T} <: AbstractBlobstore{T}
123123
folder::String
124124
end
125125

126-
#TODO added in v0.25 to avoid a breaking change in deserialization old DFGs, remove.
127-
StructTypes.StructType(::Type{<:FolderStore}) = StructTypes.OrderedStruct()
128-
129126
function FolderStore(foldername::String; label::Symbol = :default, createfolder = true)
130127
storepath = joinpath(foldername, string(label))
131128
if createfolder && !isdir(storepath)
@@ -367,13 +364,6 @@ function addBlob!(store::RowBlobstore{T}, blobId::UUID, blob::T) where {T}
367364
return blobId
368365
end
369366

370-
function updateBlob!(store::RowBlobstore{T}, blobId::UUID, blob::T) where {T}
371-
if haskey(store.blobs, blobId)
372-
@warn "Key '$blobId' doesn't exist."
373-
end
374-
return store.blobs[blobId] = RowBlob(blobId, blob)
375-
end
376-
377367
function deleteBlob!(store::RowBlobstore, blobId::UUID)
378368
if !haskey(store.blobs, blobId)
379369
throw(IdNotFoundError("Blob", blobId))

0 commit comments

Comments
 (0)