Skip to content

Commit 73dafd0

Browse files
authored
Merge pull request #1012 from JuliaRobotics/23Q2/feat/weak_deps
Use weakdeps; drop Requires and jl < v1.9
2 parents caf0c80 + e489d24 commit 73dafd0

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
version:
21-
- '1.8'
2221
- '1.9'
2322
- 'nightly'
2423
os:

Project.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1818
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
1919
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2020
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
21-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2221
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
2322
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2423
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
@@ -27,6 +26,12 @@ TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
2726
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
2827
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
2928

29+
[weakdeps]
30+
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
31+
32+
[extensions]
33+
DFGPlots = "GraphPlot"
34+
3035
[compat]
3136
CSV = "0.10"
3237
Colors = "0.10, 0.11, 0.12"
@@ -41,12 +46,11 @@ Pkg = "1.4, 1.5"
4146
ProgressMeter = "1"
4247
RecursiveArrayTools = "2"
4348
Reexport = "1"
44-
Requires = "1"
4549
StaticArrays = "1"
4650
StructTypes = "1"
4751
TensorCast = "0.3.3, 0.4"
4852
TimeZones = "1.3.1"
49-
julia = "1.8"
53+
julia = "1.9"
5054

5155
[extras]
5256
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

src/DFGPlots/DFGPlots.jl renamed to ext/DFGPlots.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ module DFGPlots
22

33
using Colors
44
using Graphs
5-
using ..GraphPlot
5+
using GraphPlot
66
using DocStringExtensions
7-
import ..GraphPlot: gplot
7+
import GraphPlot: gplot
8+
9+
using DistributedFactorGraphs
810

9-
using ...DistributedFactorGraphs
11+
import DistributedFactorGraphs.plotDFG
1012

1113
export
1214
plotDFG,

src/Common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ global _invalidIds = [
7272
"VARIABLE", "FACTOR", "ENVIRONMENT",
7373
"PPE", "DATA_ENTRY", "FACTORGRAPH"]
7474

75-
global _validLabelRegex = r"^[a-zA-Z][\w\.\@]*$"
75+
global _validLabelRegex = r"^[a-zA-Z][-\w\.\@]*$"
7676

7777
"""
7878
$(SIGNATURES)

src/DistributedFactorGraphs.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module DistributedFactorGraphs
1717
using Base
1818
using Base64
1919
using DocStringExtensions
20-
using Requires
2120
using Dates
2221
using TimeZones
2322
using Distributions
@@ -299,6 +298,8 @@ export getId, getHash, getTimestamp
299298
# convenience wrappers
300299
export getData, addData!, updateData!, deleteData!
301300

301+
export plotDFG
302+
302303
##==============================================================================
303304
## Files Includes
304305
##==============================================================================
@@ -348,13 +349,8 @@ include("services/CustomPrinting.jl")
348349
# To be moved as necessary.
349350
include("Common.jl")
350351

351-
function __init__()
352-
@require GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231" begin
353-
@info "DistributedFactorGraphs.jl is adding tools using GraphPlot.jl"
354-
include("DFGPlots/DFGPlots.jl")
355-
@reexport using .DFGPlots
356-
end
357-
end
352+
function plotDFG end
353+
358354

359355

360356
end

src/services/AbstractDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ function findVariableNearTimestamp(dfg::AbstractDFG,
905905
end
906906

907907
findVariableNearTimestamp(dfg::AbstractDFG, timest::DateTime, regexFilter::Union{Nothing, Regex}=nothing;
908-
timezone=localzone(), kwargs...) =
908+
timezone=tz"UTC", kwargs...) =
909909
findVariableNearTimestamp(dfg, ZonedDateTime(timest, timezone), regexFilter; kwargs...)
910910

911911
##==============================================================================

src/services/Serialization.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ function unpackFactor(
322322

323323
fullFactorData = nothing
324324
try
325-
packedFnc = fncStringToData(factor.fnctype, factor.data)
325+
if factor.data[1] == '{'
326+
packedFnc = fncStringToData(factor.fnctype, factor.data)
327+
else
328+
packedFnc = fncStringToData(factor.fnctype, String(base64decode(factor.data)))
329+
end
326330
decodeType = getFactorOperationalMemoryType(dfg)
327331
fullFactorData = decodePackedType(dfg, factor._variableOrderSymbols, decodeType, packedFnc)
328332
catch ex

0 commit comments

Comments
 (0)