Skip to content

Commit 1002956

Browse files
authored
Merge pull request #895 from JuliaRobotics/master
v0.18.5-rc1
2 parents a266ca4 + 71c0693 commit 1002956

File tree

19 files changed

+237
-221
lines changed

19 files changed

+237
-221
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
name: CompatHelper
2-
32
on:
43
schedule:
5-
- cron: '00 00 * * *'
6-
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
79
jobs:
810
CompatHelper:
9-
runs-on: ${{ matrix.os }}
10-
strategy:
11-
matrix:
12-
julia-version: [1.2.0]
13-
julia-arch: [x86]
14-
os: [ubuntu-latest]
11+
runs-on: ubuntu-latest
1512
steps:
16-
- uses: julia-actions/setup-julia@latest
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
1719
with:
18-
version: ${{ matrix.julia-version }}
19-
- name: Pkg.add("CompatHelper")
20-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
21-
- name: CompatHelper.main()
20+
version: '1'
21+
# arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
2242
env:
2343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
run: julia -e 'using CompatHelper; CompatHelper.main()'
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- release/*
88
tags:
99
- v**
10-
10+
workflow_dispatch:
1111
jobs:
1212
test:
1313
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
version:
2121
- '1.6'
22-
- '1.7'
22+
- '1.8'
2323
- 'nightly'
2424
os:
2525
- ubuntu-latest
@@ -82,7 +82,7 @@ jobs:
8282
matrix:
8383
version:
8484
- '1.6'
85-
- '1.7'
85+
- '1.8'
8686
os:
8787
- ubuntu-latest
8888
arch:
@@ -125,6 +125,8 @@ jobs:
125125
${{ runner.os }}-
126126
127127
- name: Julia Build Pkg
128+
env:
129+
DFG_USE_CGDFG: true
128130
uses: julia-actions/julia-buildpkg@latest
129131

130132
- name: Git Test Credentials
@@ -159,7 +161,7 @@ jobs:
159161
- name: Setup julia
160162
uses: julia-actions/setup-julia@v1
161163
with:
162-
version: 1.7
164+
version: 1.8
163165
arch: x64
164166

165167
- name: Build Docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.jl.cov
22
*.jl.*.cov
33
*.jl.mem
4+
*.mem
45
deps/deps.jl
56
docs/build
67
Manifest.toml

.travis.yml

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

LICENSE

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
Copyright (c) 2017-2021 NavAbility
2-
3-
NOTICE: this license will be relaxed to be much more permissive soon.
1+
Copyright (c) 2017-2022 NavAbility
42

53
The source code in this repository is separated into two parts
64
that are licensed separately. The Neo4jDFG library/driver
75
is licensed separately. For more details see:
86
https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/blob/develop/src/Neo4jDFG/LICENSE
97

10-
DistributedFactorGraphs.jl, is not licensed for hosted, webservice or cloud
8+
DistributedFactorGraphs' Neo4jDFG Driver is not licensed for hosted, webservice or cloud
119
solutions (public or private). Please contact NavAbility via email at
1210
<[email protected]> for clarification or additional licensing options.
1311
NavAbility reserves all rights regarding, and to deny use of the software
@@ -18,9 +16,9 @@ Other general use or modification of the software beyond that of
1816
webservices or clouds (private or public) is permitted
1917
according to terms defined by Apache 2.0 or other library specifc licenses.
2018

21-
Copyright 2017-2021 NavAbility
19+
Copyright 2017-2022 NavAbility
2220

23-
Licensed under a Market Limited version of the Apache License, Version 2.0 (the "License");
21+
Licensed under the Apache License, Version 2.0 (the "License");
2422
you may not use this file except in compliance with the License.
2523

2624
Unless required by applicable law or agreed to in writing, software

Project.toml

Lines changed: 5 additions & 2 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.4"
3+
version = "0.18.5"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -15,7 +15,9 @@ LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1515
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1616
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
1717
Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
18+
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
1819
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
20+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
1921
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2022
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2123
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
@@ -29,13 +31,14 @@ Unmarshal = "cbff2730-442d-58d7-89d1-8e530c41eb02"
2931
Colors = "0.10, 0.11, 0.12"
3032
Distributions = "0.23, 0.24, 0.25"
3133
DocStringExtensions = "0.8, 0.9"
32-
Graphs = "1.4"
3334
GraphPlot = "0.5.0"
35+
Graphs = "1.4"
3436
JSON = "0.21"
3537
JSON2 = "0.3.1"
3638
LightGraphs = "1.2, 1.3"
3739
ManifoldsBase = "0.11, 0.12, 0.13"
3840
Neo4j = "2"
41+
OrderedCollections = "1.4"
3942
Pkg = "1.4, 1.5"
4043
Reexport = "1"
4144
Requires = "1"

src/Deprecated.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ function Base.convert(::Type{DateTime}, ts::ZonedDateTime)
99
return DateTime(ts, Local)
1010
end
1111

12+
## ================================================================================
13+
## Deprecate before v0.20 - Kept longer with error
14+
##=================================================================================
15+
16+
function getTypeFromSerializationModule(dfg::G, moduleType::Symbol) where G <: AbstractDFG
17+
error("Deprecating getTypeFromSerializationModule(dfg,symbol), use getTypeFromSerializationModule(string) instead.")
18+
st = nothing
19+
try
20+
st = getfield(Main, Symbol(moduleType))
21+
catch ex
22+
@error "Unable to deserialize packed variableType $(moduleType)"
23+
io = IOBuffer()
24+
showerror(io, ex, catch_backtrace())
25+
err = String(take!(io))
26+
@error(err)
27+
end
28+
return st
29+
end
30+
1231
## ================================================================================
1332
## Deprecate before v0.19 - Kept longer with error
1433
##=================================================================================

src/DistributedFactorGraphs.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import ManifoldsBase
3636
import ManifoldsBase: AbstractManifold, manifold_dimension
3737
export AbstractManifold, manifold_dimension
3838

39+
import RecursiveArrayTools: ArrayPartition
40+
export ArrayPartition
41+
3942
import Base: getindex
4043

4144

src/GraphsDFG/FactorGraphs/FactorGraphs.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module FactorGraphs
22
using Graphs
33

4+
using OrderedCollections
5+
46
import Base:
57
eltype, show, ==, Pair,
68
Tuple, copy, length, size,
@@ -42,18 +44,18 @@ include("BiMaps.jl")
4244
struct FactorGraph{T <: Integer,V <: AbstractVariableType, F <: AbstractFactorType} <: AbstractGraph{T}
4345
graph::SimpleGraph{T}
4446
labels::BiDictMap{T}
45-
variables::Dict{Symbol,V}
46-
factors::Dict{Symbol,F}
47+
variables::OrderedDict{Symbol,V}
48+
factors::OrderedDict{Symbol,F}
4749
end
4850

4951
function FactorGraph{T, V, F}(nv::Int=100, nf::Int=100) where {T <: Integer, V <: AbstractVariableType, F <: AbstractFactorType}
5052
fadjlist = Vector{Vector{T}}()
5153
sizehint!(fadjlist, nv + nf)
5254
g = SimpleGraph{T}(0, fadjlist)
5355
labels = BiDictMap{T}(sizehint=nv+nf)
54-
variables = Dict{Symbol,V}()
56+
variables = OrderedDict{Symbol,V}()
5557
sizehint!(variables, nv)
56-
factors = Dict{Symbol,F}()
58+
factors = OrderedDict{Symbol,F}()
5759
sizehint!(factors, nf)
5860
return FactorGraph{T, V, F}(g, labels, variables, factors)
5961
end

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,28 @@ function findShortestPathDijkstra( dfg::GraphsDFG,
455455
return dijkpath
456456
end
457457

458+
export bfs_tree
459+
export dfs_tree
460+
export traverseGraphTopologicalSort
461+
462+
function Graphs.bfs_tree(fg::GraphsDFG, s::Symbol)
463+
return bfs_tree(fg.g, fg.g.labels[s])
464+
end
465+
466+
function Graphs.dfs_tree(fg::GraphsDFG, s::Symbol)
467+
return dfs_tree(fg.g, fg.g.labels[s])
468+
end
469+
470+
"""
471+
$SIGNATURES
472+
473+
Return a topological sort of a factor graph as a vector of vertex labels in topological order.
474+
Starting from s::Symbol
475+
"""
476+
function traverseGraphTopologicalSort(fg::GraphsDFG, s::Symbol, fs_tree=bfs_tree)
477+
tree = fs_tree(fg, s)
478+
list = topological_sort_by_dfs(tree)
479+
symlist = map(s->fg.g.labels[s], list)
480+
return symlist
481+
end
482+

0 commit comments

Comments
 (0)