Skip to content

Commit 60fb609

Browse files
committed
Merge branch 'master' into 22Q4/enh/moregetppe
2 parents eebf530 + 73c7f8a commit 60fb609

File tree

84 files changed

+2816
-7228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2816
-7228
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
version:
21-
- '1.6'
2221
- '1.8'
2322
- '~1.9.0-0'
2423
- 'nightly'
@@ -58,7 +57,7 @@ jobs:
5857
5958
- name: Run tests
6059
env:
61-
IIF_TEST: false
60+
IIF_TEST: true
6261
DO_CGDFG_TESTS: false
6362
DFG_USE_CGDFG: false
6463
uses: julia-actions/julia-runtest@latest
@@ -72,83 +71,6 @@ jobs:
7271
with:
7372
file: lcov.info
7473

75-
test-cfg:
76-
# if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release**'
77-
name: w/ LGPL ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
78-
runs-on: ${{ matrix.os }}
79-
env:
80-
JULIA_PKG_SERVER: ""
81-
strategy:
82-
fail-fast: false
83-
matrix:
84-
version:
85-
- '1.8'
86-
os:
87-
- ubuntu-latest
88-
arch:
89-
- x64
90-
steps:
91-
- name: Checkout
92-
uses: actions/checkout@v2
93-
94-
- name: Setup Julia
95-
uses: julia-actions/setup-julia@v1
96-
with:
97-
version: ${{ matrix.version }}
98-
arch: ${{ matrix.arch }}
99-
100-
- name: Install neo4j
101-
run: |
102-
sudo add-apt-repository -y ppa:openjdk-r/ppa
103-
sudo apt-get update
104-
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
105-
echo 'deb https://debian.neo4j.com stable 3.5' | sudo tee /etc/apt/sources.list.d/neo4j.list
106-
sudo apt-get update
107-
apt list -a neo4j
108-
sudo apt-get install neo4j
109-
sudo service neo4j start
110-
sleep 10
111-
curl -v POST http://neo4j:neo4j@localhost:7474/user/neo4j/password -d"password=test"
112-
# sudo neo4j-admin set-initial-password test
113-
curl -I http://localhost:7474/
114-
115-
- name: Cache Artifacts
116-
uses: actions/cache@v1
117-
env:
118-
cache-name: cache-artifacts
119-
with:
120-
path: ~/.julia/artifacts
121-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
122-
restore-keys: |
123-
${{ runner.os }}-test-${{ env.cache-name }}-
124-
${{ runner.os }}-test-
125-
${{ runner.os }}-
126-
127-
- name: Julia Build Pkg
128-
env:
129-
DFG_USE_CGDFG: true
130-
uses: julia-actions/julia-buildpkg@latest
131-
132-
- name: Git Test Credentials
133-
run: |
134-
git config --global user.name Tester
135-
git config --global user.email [email protected]
136-
137-
- name: Run tests
138-
env:
139-
IIF_TEST: false
140-
DO_CGDFG_TESTS: true
141-
DFG_USE_CGDFG: true
142-
uses: julia-actions/julia-runtest@latest
143-
144-
- name: Process Coverage
145-
uses: julia-actions/julia-processcoverage@v1
146-
147-
- name: Code Coverage
148-
uses: codecov/codecov-action@v1
149-
with:
150-
file: lcov.info
151-
15274
docs:
15375
needs: test
15476
name: Documentation

NEWS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
Listing news on any major breaking changes in DFG. For regular changes, see integrated Github.com project milestones for DFG.
22

3+
# v0.20
4+
5+
- Throw `KeyError` if `getBlobEntry` is not found, previously was `ErrorException`.
6+
- Change return type on `addData!` convenience wrappers to only return new `BlobEntry`.
7+
- Fix `addBlob!` calls for `FolderStore` and `InMemoryBlobStore` to use `BlobEntry.originId` and not previous bug `entry.id`.
8+
- Close long running serialization redo (#590) using only JSON3.jl and StructTypes.jl going forward.
9+
- Standardize BlobEntry=>Blob naming of functions, and keeping convenience wrappers `{get,add,update,delete}Data[!]`.
10+
- Consolidate to only one `BlobEntry` definition, dropping use of `AbstractBlobEntry`.
11+
- Include type field `VariableNodeData.covar`.
12+
- Drop minimum Julia compat to 1.8.
13+
14+
# v0.19
15+
16+
- Add ids and metadata to data types.
17+
- Use `Base.@kwdef` on stuct types for default values and serialization.
18+
- Dropped dependency on Unmarshal.jl.
19+
- Note src/Serialization.jl was refactored and currently contains lots of legacy code for DFG v0.18 compat, and much will be deleted in DFG v0.20 to standardize serialization around JSON3.jl, see #590.
20+
- `Neo4jDFG` has been removed.
21+
- `LightDFG` has been removed, and `GraphsDFG` is not the standard in-memory driver for alias `LocalDFG`.
22+
- Standardize all timestamp fields to `ZonedDateTime` from previous `DateTime` so that time zones will always be available.
23+
- internal `getDFGVersion()` function now returns a `::VersionNumber`.
24+
- Use `userLabel, robotLabel, sessionLabel` instead of legacy `userId, robotId, sessionId`.
25+
326
# v0.18.0
427

528
- Unpack of GenericFactorNodeData with `reconstrFactorData` now gets `dfg::AbstractDFG` and `varOrder::Vector{Symbol}`, deprecating previous use of `convert` without the graph context (#832).

Project.toml

Lines changed: 9 additions & 14 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.18.9"
3+
version = "0.20.1"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -9,12 +9,9 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
99
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1010
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1111
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
12-
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
13-
JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
14-
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
12+
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
1513
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1614
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
17-
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1815
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
1916
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2017
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
@@ -23,34 +20,32 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2320
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2421
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
2522
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
23+
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
2624
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
2725
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
2826
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
29-
Unmarshal = "cbff2730-442d-58d7-89d1-8e530c41eb02"
3027

3128
[compat]
3229
Colors = "0.10, 0.11, 0.12"
3330
Distributions = "0.23, 0.24, 0.25"
3431
DocStringExtensions = "0.8, 0.9"
3532
GraphPlot = "0.5.0"
3633
Graphs = "1.4"
37-
JSON = "0.21"
38-
JSON2 = "0.3.1"
39-
LightGraphs = "1.2, 1.3"
40-
ManifoldsBase = "0.11, 0.12, 0.13"
41-
Neo4j = "2"
34+
JSON3 = "1"
35+
ManifoldsBase = "0.12, 0.13, 0.14"
4236
OrderedCollections = "1.4"
4337
Pkg = "1.4, 1.5"
4438
ProgressMeter = "1"
4539
RecursiveArrayTools = "2"
4640
Reexport = "1"
4741
Requires = "1"
42+
StructTypes = "1"
4843
TensorCast = "0.3.3, 0.4"
4944
TimeZones = "1.3.1"
50-
Unmarshal = "0.4"
51-
julia = "1.6"
45+
julia = "1.8"
5246

5347
[extras]
48+
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
5449
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
5550
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
5651
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
@@ -59,4 +54,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
5954
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6055

6156
[targets]
62-
test = ["Test", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"]
57+
test = ["Test", "DataStructures", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg", "Statistics"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ add DistributedFactorGraphs
3434

3535
# Usage
3636

37-
The in-memory implementation is the default, using LightGraphs.jl.
37+
The in-memory implementation is the default, using Graphs.jl.
3838

3939
It is recommended to use `IncrementalInference` to create factor graphs as they will be solvable.
4040
```julia
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22

3-
# @generated function ==(x::FileDataEntry, y::FileDataEntry)
3+
# @generated function ==(x::BlobEntry, y::BlobEntry)
44
# mapreduce(n -> :(x.$n == y.$n), (a,b)->:($a && $b), fieldnames(x))
55
# end
66

77
#
8-
# getHash(entry::AbstractDataEntry) = hex2bytes(entry.hash)
8+
# getHash(entry::AbstractBlobEntry) = hex2bytes(entry.hash)
99

1010

1111
##==============================================================================
12-
## FileDataEntry Common
12+
## BlobEntry Common
1313
##==============================================================================
14-
blobfilename(entry::FileDataEntry) = joinpath(entry.folder,"$(entry.id).dat")
15-
entryfilename(entry::FileDataEntry) = joinpath(entry.folder,"$(entry.id).json")
14+
blobfilename(entry::BlobEntry) = joinpath(entry.folder,"$(entry.id).dat")
15+
entryfilename(entry::BlobEntry) = joinpath(entry.folder,"$(entry.id).json")
1616

1717

1818
##==============================================================================
19-
## FileDataEntry Blob CRUD
19+
## BlobEntry Blob CRUD
2020
##==============================================================================
2121

22-
function getDataBlob(dfg::AbstractDFG, entry::FileDataEntry)
22+
function getBlob(dfg::AbstractDFG, entry::BlobEntry)
2323
if isfile(blobfilename(entry))
2424
open(blobfilename(entry)) do f
2525
return read(f)
@@ -30,7 +30,7 @@ function getDataBlob(dfg::AbstractDFG, entry::FileDataEntry)
3030
end
3131
end
3232

33-
function addDataBlob!(dfg::AbstractDFG, entry::FileDataEntry, data::Vector{UInt8})
33+
function addBlob!(dfg::AbstractDFG, entry::BlobEntry, data::Vector{UInt8})
3434
if isfile(blobfilename(entry))
3535
error("Key '$(entry.id)' blob already exists.")
3636
elseif isfile(entryfilename(entry))
@@ -42,37 +42,40 @@ function addDataBlob!(dfg::AbstractDFG, entry::FileDataEntry, data::Vector{UInt8
4242
open(entryfilename(entry), "w") do f
4343
JSON.print(f, entry)
4444
end
45-
return getDataBlob(dfg, entry)::Vector{UInt8}
45+
# FIXME update for entry.blobId vs entry.originId
46+
return UUID(entry.id)
47+
# return getBlob(dfg, entry)::Vector{UInt8}
4648
end
4749
end
4850

49-
function updateDataBlob!(dfg::AbstractDFG, entry::FileDataEntry, data::Vector{UInt8})
51+
function updateBlob!(dfg::AbstractDFG, entry::BlobEntry, data::Vector{UInt8})
5052
if !isfile(blobfilename(entry))
5153
@warn "Entry '$(entry.id)' does not exist, adding."
52-
return addDataBlob!(dfg, entry, data)
54+
return addBlob!(dfg, entry, data)
5355
else
5456
# perhaps add an explicit force update flag and error otherwise
5557
@warn "Key '$(entry.id)' already exists, data will be overwritten."
56-
deleteDataBlob!(dfg, entry)
57-
return addDataBlob!(dfg, entry, data)
58+
deleteBlob!(dfg, entry)
59+
return addBlob!(dfg, entry, data)
5860
end
5961
end
6062

61-
function deleteDataBlob!(dfg::AbstractDFG, entry::FileDataEntry)
62-
data = getDataBlob(dfg, entry)
63+
function deleteBlob!(dfg::AbstractDFG, entry::BlobEntry)
64+
data = getBlob(dfg, entry)
6365
rm(blobfilename(entry))
6466
rm(entryfilename(entry))
6567
return data
6668
end
6769

6870
##==============================================================================
69-
## FileDataEntry CRUD Helpers
71+
## BlobEntry CRUD Helpers
7072
##==============================================================================
7173

72-
function addData!(::Type{FileDataEntry}, dfg::AbstractDFG, label::Symbol, key::Symbol, folder::String, blob::Vector{UInt8}, timestamp=now(localzone());
74+
function addData!(::Type{BlobEntry}, dfg::AbstractDFG, label::Symbol, key::Symbol, folder::String, blob::Vector{UInt8}, timestamp=now(localzone());
7375
id::UUID = uuid4(), hashfunction = sha256)
74-
fde = FileDataEntry(key, id, folder, bytes2hex(hashfunction(blob)), timestamp)
75-
de = addDataEntry!(dfg, label, fde)
76-
db = addDataBlob!(dfg, fde, blob)
77-
return de=>db
76+
fde = BlobEntry(key, id, folder, bytes2hex(hashfunction(blob)), timestamp)
77+
blobId = addBlob!(dfg, fde, blob) |> UUID
78+
newEntry = BlobEntry(fde; id=blobId, blobId)
79+
de = addBlobEntry!(dfg, label, newEntry)
80+
return de # de=>db
7881
end

attic/DataStoreTests.jl

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)