Skip to content

Commit 9dcf55f

Browse files
committed
Modularize BipartiteGraphs and SystemStructures
1 parent 3c4ea7d commit 9dcf55f

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2121
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
2222
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
2323
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
24+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2425
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2526
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
2627
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
@@ -49,6 +50,7 @@ LightGraphs = "1.3"
4950
MacroTools = "0.5"
5051
NaNMath = "0.3"
5152
RecursiveArrayTools = "2.3"
53+
Reexport = "1"
5254
Requires = "1.0"
5355
RuntimeGeneratedFunctions = "0.4, 0.5"
5456
SafeTestsets = "0.0.1"

src/ModelingToolkit.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ using StaticArrays, LinearAlgebra, SparseArrays, LabelledArrays
55
using Latexify, Unitful, ArrayInterface
66
using MacroTools
77
using UnPack: @unpack
8+
using Setfield
89
using DiffEqJump
910
using DataStructures
1011
using SpecialFunctions, NaNMath
@@ -202,6 +203,7 @@ Get the set of parameters variables for the given system.
202203
function parameters end
203204

204205
include("bipartite_graph.jl")
206+
using .BipartiteGraphs
205207

206208
include("variables.jl")
207209
include("context_dsl.jl")
@@ -216,7 +218,6 @@ include("domains.jl")
216218
include("register_function.jl")
217219

218220
include("systems/abstractsystem.jl")
219-
include("systems/systemstructure.jl")
220221

221222
include("systems/diffeqs/odesystem.jl")
222223
include("systems/diffeqs/sdesystem.jl")
@@ -239,6 +240,9 @@ include("systems/pde/pdesystem.jl")
239240
include("systems/reaction/reactionsystem.jl")
240241
include("systems/dependency_graphs.jl")
241242

243+
include("systems/systemstructure.jl")
244+
using .SystemStructures
245+
242246
include("systems/reduction.jl")
243247

244248
include("latexify_recipes.jl")

src/bipartite_graph.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
module BipartiteGraphs
2+
3+
export BipartiteEdge, BipartiteGraph
4+
5+
export 𝑠vertices, 𝑑vertices, has_𝑠vertex, has_𝑑vertex, 𝑠neighbors, 𝑑neighbors,
6+
𝑠edges, 𝑑edges, nsrcs, ndsts, SRC, DST
7+
8+
using DocStringExtensions
9+
using Reexport
110
using UnPack
211
using SparseArrays
3-
using LightGraphs
12+
@reexport using LightGraphs
413
using Setfield
514

615
###
@@ -229,3 +238,5 @@ function LightGraphs.incidence_matrix(g::BipartiteGraph, val=true)
229238
end
230239
S = sparse(I, J, val, nsrcs(g), ndsts(g))
231240
end
241+
242+
end # module

0 commit comments

Comments
 (0)