Skip to content

Commit 8135e2f

Browse files
authored
Merge pull request #1746 from JuliaRobotics/23Q3/ext/interactiveutils
weakdeps InteractiveUtils
2 parents ee0a5ac + d3ac97e commit 8135e2f

File tree

6 files changed

+38
-7
lines changed

6 files changed

+38
-7
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
5050
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
5151

5252
[weakdeps]
53+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
5354
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
5455

5556
[extensions]
57+
InteractiveUtilsExt = "InteractiveUtils"
5658
InterpolationsExt = "Interpolations"
5759

5860
[compat]
@@ -95,7 +97,6 @@ julia = "1.8"
9597
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
9698
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
9799
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
98-
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
99100
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
100101
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
101102
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

src/services/RequireInteractiveUtils.jl renamed to ext/InteractiveUtilsExt.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
module InteractiveUtilsExt
12

2-
@info "IncrementalInference.jl is loading tools related to InteractiveUtils.jl."
3+
@info "IncrementalInference.jl is loading extension related to InteractiveUtils.jl."
34

4-
# this requires InteractiveUtils
5+
using InteractiveUtils
6+
using DocStringExtensions
7+
using IncrementalInference: InferenceVariable, AbstractPrior, AbstractRelativeMinimize, AbstractManifoldMinimize
8+
# using IncrementalInference: getCurrentWorkspaceFactors, getCurrentWorkspaceVariables, listTypeTree
9+
import IncrementalInference: getCurrentWorkspaceFactors, getCurrentWorkspaceVariables, listTypeTree
510

611
export getCurrentWorkspaceFactors, getCurrentWorkspaceVariables
712
export listTypeTree
@@ -25,7 +30,7 @@ end
2530
Return all variables currently registered in the workspace.
2631
"""
2732
function getCurrentWorkspaceVariables()
28-
return InteractiveUtils.subtypes(IIF.InferenceVariable)
33+
return InteractiveUtils.subtypes(InferenceVariable)
2934
end
3035

3136
function _listTypeTree(mytype, printlevel::Int)
@@ -50,3 +55,5 @@ function listTypeTree(T)
5055
println(T)
5156
return _listTypeTree(T, 0)
5257
end
58+
59+
end #module

ext/WeakDepsPrototypes.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11

2+
# InteractiveUtils.jl
3+
function getCurrentWorkspaceFactors end
4+
function getCurrentWorkspaceVariables end
5+
function listTypeTree end

src/ExportAPI.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,4 +358,8 @@ export makeSolverData!
358358

359359
export MetaPrior
360360

361+
# weakdeps on InteractiveUtils.jl
362+
export getCurrentWorkspaceFactors, getCurrentWorkspaceVariables
363+
export listTypeTree
364+
361365
#

src/IncrementalInference.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,16 @@ include("services/SolverAPI.jl")
234234
# Symbolic tree analysis files.
235235
include("services/AnalysisTools.jl")
236236

237+
include("../ext/WeakDepsPrototypes.jl")
237238

238239
# deprecation legacy support
239240
include("Deprecated.jl")
240241

241242
exportimg(pl) = error("Please do `using Gadfly` to allow image export.")
242243
function __init__()
243-
@require InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" include(
244-
"services/RequireInteractiveUtils.jl",
245-
)
244+
# @require InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" include(
245+
# "services/RequireInteractiveUtils.jl",
246+
# )
246247
@require Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004" include(
247248
"services/EmbeddedPlottingUtils.jl",
248249
)

test/basicGraphsOperations.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using IncrementalInference
2+
using InteractiveUtils
23
using Test
34

45
##
@@ -42,6 +43,19 @@ varT = _TestManiKde
4243
manikde!(varT, pts)
4344

4445

46+
##
47+
end
48+
49+
50+
@testset "test InteractiveUtilsExt" begin
51+
##
52+
53+
IIF.listTypeTree(AbstractManifoldMinimize)
54+
55+
IIF.getCurrentWorkspaceFactors()
56+
IIF.getCurrentWorkspaceVariables()
57+
58+
4559
##
4660
end
4761

0 commit comments

Comments
 (0)