Skip to content

Commit

Permalink
Remove imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Apr 16, 2024
1 parent e337f95 commit d453931
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 96 deletions.
100 changes: 6 additions & 94 deletions src/NamedGraphs.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
module NamedGraphs
# TODO: Delete this!
using AbstractTrees
using Dictionaries
using Graphs
using GraphsFlows
using LinearAlgebra
using SimpleTraits
using SparseArrays
using SplitApplyCombine
using SymRCM
using Suppressor

using Graphs.SimpleGraphs

# General utility functions
not_implemented() = error("Not implemented")

import Base:
convert,
copy,
Expand Down Expand Up @@ -102,6 +85,7 @@ import Graphs: AbstractEdge, src, dst, reverse, reverse!

include("lib/Keys/src/Keys.jl")
include("lib/GraphsExtensions/src/GraphsExtensions.jl")
include("utils.jl")
include("abstractnamededge.jl")
include("namededge.jl")
include("abstractnamedgraph.jl")
Expand All @@ -115,83 +99,11 @@ include("namedgraph.jl")
include("generators/named_staticgraphs.jl")
include("lib/PartitionedGraphs/src/PartitionedGraphs.jl")

# TODO: reexport Graphs.jl (except for `Graphs.contract`)
export NamedGraph,
NamedDiGraph,
NamedEdge,
PartitionedGraph,
PartitionEdge,
PartitionVertex,
Key,
,
named_binary_tree,
named_grid,
named_path_graph,
named_path_digraph,
# AbstractGraph
boundary_edges,
boundary_vertices,
child_vertices,
dijkstra_mst,
dijkstra_parents,
directed_graph,
edge_path,
inner_boundary_vertices,
is_leaf,
is_path_graph,
is_self_loop,
leaf_vertices,
outer_boundary_vertices,
permute_vertices,
parent_vertex,
subgraph,
symrcm,
symrcm_permute,
undirected_graph,
vertex_path,
vertextype,
# Graphs.jl
a_star,
adjacency_matrix,
center,
diameter,
dijkstra_shortest_paths,
dijkstra_tree,
disjoint_union,
eccentricity,
eccentricities,
incident_edges,
comb_tree,
named_comb_tree,
neighborhood,
neighborhood_dists,
neighbors,
nv,
partitioned_graph,
partitionedge,
partitionedges,
partitionvertex,
partitionvertices,
partitioned_vertices,
path_digraph,
path_graph,
periphery,
pre_order_dfs_vertices,
post_order_dfs_vertices,
post_order_dfs_edges,
radius,
rename_vertices,
degree,
degrees,
indegree,
indegrees,
is_tree,
outdegree,
outdegrees,
mincut_partitions,
steiner_tree,
unpartitioned_graph,
weights
export NamedGraph, NamedDiGraph, NamedEdge

# TODO: Move to `NamedGraphs.NamedGraphGenerators`.
# TODO: Add `named_hex`, `named_triangular`, etc.
export named_binary_tree, named_grid, named_path_graph, named_path_digraph

using PackageExtensionCompat: @require_extensions
function __init__()
Expand Down
3 changes: 3 additions & 0 deletions src/abstractnamedgraph.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Dictionaries: set!
using Graphs:
Graphs,
AbstractGraph,
IsDirected,
SimpleDiGraph,
SimpleEdge,
add_edge!,
adjacency_matrix,
edges,
Expand All @@ -18,6 +20,7 @@ using .GraphsExtensions:
rename_vertices,
subgraph
using GraphsFlows: GraphsFlows
using SimpleTraits: SimpleTraits, @traitfn

abstract type AbstractNamedGraph{V} <: AbstractGraph{V} end

Expand Down
5 changes: 4 additions & 1 deletion src/distances_and_capacities.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Dictionaries: AbstractDictionary
using Graphs: IsDirected, dst, edges, nv, src
using .GraphsExtensions: directed_graph
using GraphsFlows: GraphsFlows
using LinearAlgebra: Symmetric
using SparseArrays: sparse, spzeros

# TODO: Move GraphsFlows to package extension.
using GraphsFlows: GraphsFlows

# TODO: Move to `GraphsExtensions`.
function _symmetrize(dist::AbstractMatrix)
return sparse(Symmetric(dist))
Expand Down
10 changes: 9 additions & 1 deletion src/generators/named_staticgraphs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
using Graphs: SimpleDiGraph, inneighbors, merge_vertices, outneighbors, rem_vertex!
using Graphs:
SimpleDiGraph,
binary_tree,
grid,
inneighbors,
merge_vertices,
outneighbors,
path_graph,
rem_vertex!
using .GraphsExtensions: add_edges!, rem_vertices!
# TODO: Move to `GraphGenerators`?
using .GraphsExtensions: comb_tree
Expand Down
3 changes: 3 additions & 0 deletions src/shortestpaths.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Dictionaries: Dictionary
using Graphs: Graphs, weights

"""
struct NamedDijkstraState{V,T}
Expand Down
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
not_implemented() = error("Not implemented")

0 comments on commit d453931

Please sign in to comment.