Skip to content

Commit 0e764ff

Browse files
committed
Merge branch 'master' into ci/github
2 parents 784652e + 6b7bfef commit 0e764ff

26 files changed

+672
-280
lines changed

.travis.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@ language: julia
22
sudo: required
33

44
os:
5-
- linux
5+
- linux
66

77
arch:
8-
- amd64
8+
- amd64
99

1010
services:
11-
- neo4j
12-
13-
julia:
14-
- 1.5
15-
- nightly
16-
17-
env:
18-
- IIF_TEST=false
11+
- neo4j
1912

2013
branches:
2114
only:
@@ -26,16 +19,37 @@ branches:
2619

2720
jobs:
2821
include:
29-
- julia: 1.4
22+
- julia: 1.6
23+
env:
24+
- IIF_TEST=false
25+
- DO_CGDFG_TESTS=false
26+
- DFG_USE_CGDFG=false
27+
- JULIA_PKG_SERVER=""
28+
- julia: nightly
29+
env:
30+
- IIF_TEST=false
31+
- DO_CGDFG_TESTS=false
32+
- DFG_USE_CGDFG=false
33+
- JULIA_PKG_SERVER=""
34+
- julia: 1.6
3035
env:
3136
- IIF_TEST=true
37+
- DO_CGDFG_TESTS=true
38+
- DFG_USE_CGDFG=true
39+
- JULIA_PKG_SERVER=""
3240
if: NOT branch =~ /(^v\d+\.\d+(\.\d+)?([-+]\S*)?$)|(^release.*$)/
3341
- arch: arm64
34-
env: SKIP_CGDFG_TESTS=true
42+
env:
43+
- IIF_TEST=false
44+
- DO_CGDFG_TESTS=false
45+
- DFG_USE_CGDFG=false
46+
- JULIA_PKG_SERVER=""
3547
before_script:
3648
- stage: "Documentation"
37-
julia: 1.4
49+
julia: 1.6
3850
os: linux
51+
env:
52+
- JULIA_PKG_SERVER=""
3953
script:
4054
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
4155
- julia --project=docs/ docs/make.jl

LICENSE

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017-2020 NavAbility
1+
Copyright (c) 2017-2021 NavAbility
22

33
NOTICE: this license will be relaxed to be much more permissive soon.
44

@@ -18,13 +18,10 @@ Other general use or modification of the software beyond that of
1818
webservices or clouds (private or public) is permitted
1919
according to terms defined by Apache 2.0 or other library specifc licenses.
2020

21-
Copyright 2017-2020 NavAbility
21+
Copyright 2017-2021 NavAbility
2222

23-
Licensed under the Apache License, Version 2.0 (the "License");
23+
Licensed under a Market Limited version of the Apache License, Version 2.0 (the "License");
2424
you may not use this file except in compliance with the License.
25-
You may obtain a copy of the License at
26-
27-
http://www.apache.org/licenses/LICENSE-2.0
2825

2926
Unless required by applicable law or agreed to in writing, software
3027
distributed under the License is distributed on an "AS IS" BASIS,

Project.toml

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

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
77
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
88
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
99
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1010
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
11-
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1211
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1312
JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
1413
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1514
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15+
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
1616
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1717
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1818
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1919
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2020
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
2121
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
22+
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
2223
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
2324
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
2425
Unmarshal = "cbff2730-442d-58d7-89d1-8e530c41eb02"
@@ -27,22 +28,25 @@ Unmarshal = "cbff2730-442d-58d7-89d1-8e530c41eb02"
2728
Colors = "0.8, 0.9, 0.10, 0.11, 0.12"
2829
Distributions = "0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 1"
2930
DocStringExtensions = "0.8, 0.9, 0.10, 1"
30-
Graphs = "0.10.2, 0.11, 1"
3131
JSON = "0.21"
3232
JSON2 = "0.3.1"
3333
LightGraphs = "1.2, 1.3"
34+
ManifoldsBase = "0.11, 0.12"
3435
Neo4j = "2"
3536
Pkg = "1.4, 1.5"
3637
Reexport = "0.2, 0.3, 0.4, 0.5, 1"
37-
Requires = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 1"
38+
Requires = "0.5, 1"
39+
TensorCast = "0.3.3, 0.4"
3840
TimeZones = "1.3.1"
3941
Unmarshal = "0.4"
40-
julia = "1.2"
42+
julia = "1.4"
4143

4244
[extras]
4345
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
46+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
47+
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
4448
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
4549
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4650

4751
[targets]
48-
test = ["Test", "GraphPlot", "Pkg"]
52+
test = ["Test", "GraphPlot", "LinearAlgebra", "Manifolds", "Pkg"]

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
Click on badges to follow links:
44

5-
Release v0.9 | Release v0.10 | Dev | Coverage | Documentation |
5+
Release v0.13 | Release v0.14 | Dev | Coverage | Documentation |
66
---------|---------|-----|------------|------------|
7-
[![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.9)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.10)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) | [![Build Status](https://api.travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=master)](https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl) <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![Codecov Status](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaRobotics/DistributedFactorGraphs.jl) <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
7+
[![Build Status][dfg-build-v0.13]][dfg-build-url] | [![Build Status][dfg-build-v0.14]][dfg-build-url] | [![Build Status][dfg-build-img]][dfg-build-url] <br> [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![codecov.io][dfg-cov-img]][dfg-cov-url] <br> [![Percentage of issues still open](https://isitmaintained.com/badge/open/JuliaRobotics/DistributedFactorGraphs.jl.svg)](https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues) | [![docs](https://img.shields.io/badge/DFGDocs-latest-blue.svg)](http://juliarobotics.github.io/DistributedFactorGraphs.jl/latest/) <br> [![docs](https://img.shields.io/badge/CaesarDocs-latest-blue.svg)](http://juliarobotics.github.io/Caesar.jl/latest/)
88

99

10+
[dfg-build-v0.13]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.13
11+
[dfg-build-v0.14]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=release/v0.14
12+
13+
[dfg-cov-img]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl/coverage.svg?branch=master
14+
[dfg-cov-url]: https://codecov.io/github/JuliaRobotics/DistributedFactorGraphs.jl?branch=master
15+
[dfg-build-img]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl.svg?branch=master
16+
[dfg-build-url]: https://travis-ci.org/JuliaRobotics/DistributedFactorGraphs.jl
17+
1018
DistributedFactorGraphs.jl provides a flexible factor graph API for use in the [Caesar.jl](https://github.com/JuliaRobotics/Caesar.jl) ecosystem. The package supplies:
1119
* A standardized API for interacting with factor graphs
1220
* Implementations of the API for in-memory and database-driven operation
@@ -42,7 +50,7 @@ dfg = initfg()
4250
# add 2 ContinuousScalar variable types to the new factor graph
4351
addVariable!(dfg, :a, ContinuousScalar)
4452
addVariable!(dfg, :b, ContinuousScalar)
45-
# add a LinearConditional factor
46-
addFactor!(dfg, [:a, :b], LinearConditional(Normal(10.0,1.0)))
53+
# add a LinearRelative factor
54+
addFactor!(dfg, [:a, :b], LinearRelative(Normal(10.0,1.0)))
4755
```
4856

src/DataBlobs/services/AbstractDataEntries.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildSourceString(dfg::AbstractDFG, label::Symbol) =
2929
Get data entry
3030
"""
3131
function getDataEntry(var::AbstractDFGVariable, key::Symbol)
32-
!hasDataEntry(var, key) && error("Data entry $(key) does not exist in variable")
32+
!hasDataEntry(var, key) && error("Data entry $(key) does not exist in variable $(getLabel(var))")
3333
return var.dataDict[key]
3434
end
3535

@@ -42,7 +42,7 @@ end
4242
Add Data Entry to a DFG variable
4343
"""
4444
function addDataEntry!(var::AbstractDFGVariable, bde::AbstractDataEntry)
45-
haskey(var.dataDict, bde.label) && error("Data entry $(bde.label) already exists in variable")
45+
haskey(var.dataDict, bde.label) && error("Data entry $(bde.label) already exists in variable $(getLabel(var))")
4646
var.dataDict[bde.label] = bde
4747
return bde
4848
end
@@ -66,7 +66,7 @@ DevNote
6666
- DF, unclear if `update` verb is applicable in this case, see #404
6767
"""
6868
function updateDataEntry!(var::AbstractDFGVariable, bde::AbstractDataEntry)
69-
!haskey(var.dataDict, bde.label) && (@warn "$(bde.label) does not exist in variable, adding")
69+
!haskey(var.dataDict, bde.label) && (@warn "$(bde.label) does not exist in variable $(getLabel(var)), adding")
7070
var.dataDict[bde.label] = bde
7171
return bde
7272
end

src/Deprecated.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ end
135135
## Deprecated in v0.11 Remove in the v0.12 cycle
136136
##==============================================================================
137137

138-
export AbstractRelativeFactor, AbstractRelativeFactorMinimize
139-
138+
# @warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactor, use AbstractRelativeRoots instead")
139+
# @warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactorMinimize, use AbstractRelativeMinimize instead")
140+
# export AbstractRelativeFactor, AbstractRelativeFactorMinimize
140141
const AbstractRelativeFactor = AbstractRelativeRoots
141142
const AbstractRelativeFactorMinimize = AbstractRelativeMinimize
142143

src/DistributedFactorGraphs.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ using LinearAlgebra
2828
using SparseArrays
2929
using UUIDs
3030
using Pkg
31+
using TensorCast
32+
33+
# used for @defVariable
34+
import ManifoldsBase
35+
import ManifoldsBase: AbstractManifold, manifold_dimension
36+
export AbstractManifold, manifold_dimension
3137

3238
import Base: getindex
3339

@@ -130,7 +136,10 @@ export getSolverData
130136
export getVariableType
131137

132138
# VariableType functions
133-
export getDimension, getManifolds
139+
export getDimension, getManifold, getPointType
140+
export getPointIdentity, getPoint, getCoordinates
141+
142+
export getManifolds # TODO Deprecate?
134143

135144
# Small Data CRUD
136145
export SmallDataTypes, getSmallData, addSmallData!, updateSmallData!, deleteSmallData!, listSmallData, emptySmallData!
@@ -175,7 +184,7 @@ export VariableNodeData, PackedVariableNodeData
175184

176185
export packVariableNodeData, unpackVariableNodeData
177186

178-
export getSolvedCount, isSolved, setSolvedCount!, isInitialized
187+
export getSolvedCount, isSolved, setSolvedCount!, isInitialized, isMarginalized, setMarginalized!
179188

180189
export getNeighborhood, getNeighbors, _getDuplicatedEmptyDFG
181190
export findFactorsBetweenNaive
@@ -315,9 +324,6 @@ if get(ENV, "DFG_USE_CGDFG", "") == "true"
315324
end
316325

317326
function __init__()
318-
@warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactor, use AbstractRelativeRoots instead")
319-
@warn("BREAKING CHANGE coming to DistributedFactorGraphs v0.12: deprecating AbstractRelativeFactorMinimize, use AbstractRelativeMinimize instead")
320-
321327
@require GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231" begin
322328
@info "DistributedFactorGraphs.jl is adding tools using GraphPlot.jl"
323329
include("DFGPlots/DFGPlots.jl")

src/LightDFG/services/LightDFG.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,11 @@ function findShortestPathDijkstra( dfg::LightDFG,
438438
dfg
439439
end
440440

441-
# LightDFG internally uses Integers
442-
if !haskey(dfg_.g.labels, from) || !haskey(dfg_.g.labels, from)
441+
if !exists(dfg_, from) || !exists(dfg_, to)
443442
# assume filters excluded either `to` or `from` and hence no shortest path
444443
return Symbol[]
445444
end
445+
# LightDFG internally uses Integers
446446
frI = dfg_.g.labels[from]
447447
toI = dfg_.g.labels[to]
448448

src/entities/DFGFactor.jl

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
# TODO consider changing this to AbstractFactor
66
abstract type AbstractFactor end
7-
const FunctorInferenceType = AbstractFactor
87
abstract type AbstractPackedFactor end
9-
const PackedInferenceType = AbstractPackedFactor
8+
9+
const FunctorInferenceType = AbstractFactor # will eventually deprecate
10+
const PackedInferenceType = AbstractPackedFactor # will eventually deprecate
1011

1112
abstract type AbstractPrior <: AbstractFactor end
1213
abstract type AbstractRelative <: AbstractFactor end
@@ -15,8 +16,8 @@ abstract type AbstractRelativeMinimize <: AbstractRelative end
1516

1617
# NOTE DF, Convolution is IIF idea, but DFG should know about "FactorOperationalMemory"
1718
# DF, IIF.CommonConvWrapper <: FactorOperationalMemory #
18-
# TODO resolve whether `<: Function` is really needed here
19-
abstract type FactorOperationalMemory <: Function end
19+
# NOTE was `<: Function` as unnecessary
20+
abstract type FactorOperationalMemory end # <: Function
2021
# TODO to be removed from DFG,
2122
# we can add to IIF or have IIF.CommonConvWrapper <: FactorOperationalMemory directly
2223
# abstract type ConvolutionObject <: FactorOperationalMemory end
@@ -46,36 +47,40 @@ mutable struct GenericFunctionNodeData{T<:Union{PackedInferenceType, FunctorInfe
4647
certainhypo::Vector{Int}
4748
nullhypo::Float64
4849
solveInProgress::Int
49-
50+
inflation::Float64
51+
# inner constructor needed for dual use
52+
# GenericFunctionNodeData{T}(x1::Bool,x2::Bool,x3,x4::T,args...) where T = new{T}(x1,x2,x3,x4,args...)
5053
# TODO deprecate all these inner constructors at end of DFG v0.9.x (was added for GFND.nullhypo::Float64 breaking change)
51-
GenericFunctionNodeData{T}(el,po,ed,fn,mu::Vector{<:Real},ce::Vector{Int},so::Int) where T = new{T}(el,po,ed,fn,mu,ce,0.0,so)
52-
GenericFunctionNodeData{T}(el,po,ed,fn,mu::Vector{<:Real},ce::Vector{Int},nu::Real,so::Int) where T = new{T}(el,po,ed,fn,mu,ce,nu,so)
54+
# GenericFunctionNodeData{T}(el,po,ed,fn,mu::Vector{<:Real},ce::Vector{Int},so::Int) where T =
55+
# new{T}(el,po,ed,fn,mu,ce,0.0,so)
56+
# GenericFunctionNodeData{T}(el,po,ed,fn,mu::Vector{<:Real},ce::Vector{Int},nu::Real,so::Int,infl::Real) where T = new{T}(el,po,ed,fn,mu,ce,nu,so,infl)
5357
end
5458

5559
## Constructors
5660

5761
GenericFunctionNodeData{T}() where T =
58-
GenericFunctionNodeData{T}(false, false, Int[], T(), Float64[], Int[], 0, 0)
59-
60-
function GenericFunctionNodeData(eliminated::Bool,
61-
potentialused::Bool,
62-
edgeIDs::Vector{Int},
63-
fnc::T,
64-
multihypo::Vector{<:Real}=Float64[],
65-
certainhypo::Vector{Int}=Int[],
66-
nullhypo::Real=0,
67-
solveInP::Int=0) where T
68-
return GenericFunctionNodeData{T}(eliminated, potentialused, edgeIDs, fnc, multihypo, certainhypo, nullhypo, solveInP)
62+
GenericFunctionNodeData(false, false, Int[], T())
63+
64+
function GenericFunctionNodeData( eliminated::Bool,
65+
potentialused::Bool,
66+
edgeIDs::Vector{Int},
67+
fnc::T,
68+
multihypo::Vector{<:Real}=Float64[],
69+
certainhypo::Vector{Int}=Int[],
70+
nullhypo::Real=0,
71+
solveInP::Int=0,
72+
inflation::Real=0.0 ) where T
73+
return GenericFunctionNodeData{T}(eliminated, potentialused, edgeIDs, fnc, multihypo, certainhypo, nullhypo, solveInP, inflation)
6974
end
7075

7176

7277
##------------------------------------------------------------------------------
7378
## PackedFunctionNodeData and FunctionNodeData
7479

75-
const PackedFunctionNodeData{T} = GenericFunctionNodeData{T} where T <: PackedInferenceType
80+
const PackedFunctionNodeData{T} = GenericFunctionNodeData{T} where T <: AbstractPackedFactor
7681
PackedFunctionNodeData(args...) = PackedFunctionNodeData{typeof(args[4])}(args...)
7782

78-
const FunctionNodeData{T} = GenericFunctionNodeData{T} where T <: Union{FunctorInferenceType, FactorOperationalMemory}
83+
const FunctionNodeData{T} = GenericFunctionNodeData{T} where T <: Union{AbstractFactor, FactorOperationalMemory}
7984
FunctionNodeData(args...) = FunctionNodeData{typeof(args[4])}(args...)
8085

8186

0 commit comments

Comments
 (0)