Skip to content

Commit

Permalink
Bring SimpleTraits.Not into namespace (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman authored Apr 17, 2024
1 parent 32442b8 commit 10b9ce6
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NamedGraphs"
uuid = "678767b0-92e7-4007-89e4-4527a8725b19"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.4.1"
version = "0.4.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
2 changes: 1 addition & 1 deletion src/abstractnamedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using .GraphsExtensions:
partitioned_vertices,
rename_vertices,
subgraph
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn

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

Expand Down
2 changes: 1 addition & 1 deletion src/dfs.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Graphs: Graphs, dfs_parents, dfs_tree, topological_sort_by_dfs
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn

@traitfn function Graphs.topological_sort_by_dfs(g::AbstractNamedGraph::IsDirected)
return parent_vertices_to_vertices(g, topological_sort_by_dfs(parent_graph(g)))
Expand Down
2 changes: 1 addition & 1 deletion src/distances_and_capacities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Dictionaries: AbstractDictionary
using Graphs: Graphs, IsDirected, dst, edges, nv, src
using .GraphsExtensions: directed_graph
using LinearAlgebra: Symmetric
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn
using SparseArrays: sparse, spzeros

# TODO: Move to `GraphsExtensions`.
Expand Down
8 changes: 4 additions & 4 deletions src/lib/GraphsExtensions/src/abstractgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using Graphs:
rem_vertex!,
weights
using Graphs.SimpleGraphs: AbstractSimpleGraph
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn
using SplitApplyCombine: groupfind

not_implemented() = error("Not implemented")
Expand Down Expand Up @@ -131,12 +131,12 @@ end
end

# Alternative syntax to `getindex` for getting a subgraph
function subgraph(graph::AbstractGraph, subvertices::Vector)
return induced_subgraph(graph, subvertices)[1]
function subgraph(graph::AbstractGraph, vertices)
return induced_subgraph(graph, vertices)[1]
end

function subgraph(f::Function, graph::AbstractGraph)
return induced_subgraph(graph, filter(f, vertices(graph)))[1]
return subgraph(graph, filter(f, vertices(graph)))
end

function degrees(graph::AbstractGraph, vertices=vertices(graph))
Expand Down
2 changes: 1 addition & 1 deletion src/lib/GraphsExtensions/src/trees_and_forests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Graphs: IsDirected, bfs_tree, connected_components, edges, edgetype
using .GraphsExtensions: random_bfs_tree, rem_edges, undirected_graph
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn

abstract type SpanningTreeAlgorithm end

Expand Down
2 changes: 1 addition & 1 deletion src/lib/NamedGraphGenerators/src/NamedGraphGenerators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using Graphs.SimpleGraphs: AbstractSimpleGraph
using ..GraphGenerators: comb_tree
using ..GraphsExtensions: add_edges!, rem_vertices!
using ..NamedGraphs: NamedGraph
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn

## TODO: Bring this back in some form?
## TODO: Move to `GraphsExtensions`?
Expand Down
2 changes: 1 addition & 1 deletion src/steiner_tree.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Graphs: Graphs, IsDirected, nv, steiner_tree
using SimpleTraits: SimpleTraits, @traitfn
using SimpleTraits: SimpleTraits, Not, @traitfn

@traitfn function Graphs.steiner_tree(
g::AbstractNamedGraph::(!IsDirected), term_vert, distmx=weights(g)
Expand Down

2 comments on commit 10b9ce6

@mtfishman
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105125

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.2 -m "<description of version>" 10b9ce6d69f42fcc5b3c25094b15d765ce4bff14
git push origin v0.4.2

Please sign in to comment.