From d4ccedfd825aac4b3c20393fdbd88cfd349b0f89 Mon Sep 17 00:00:00 2001 From: Maximilian HUEBL Date: Thu, 26 Feb 2026 09:40:56 +0100 Subject: [PATCH 1/3] fix nautyalg_methods for multiple type parameters --- src/graphs_api_extensions.jl | 9 ++++++--- test/graphs_api_extensions.jl | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/graphs_api_extensions.jl b/src/graphs_api_extensions.jl index db2214f..14a0101 100644 --- a/src/graphs_api_extensions.jl +++ b/src/graphs_api_extensions.jl @@ -6,14 +6,17 @@ struct NautyAlg{S} NautyAlg(; sparse=false) = new{sparse}() end -"""Lists all functions for which an NautyAlg method is defined""" +"""Lists all functions for which a `NautyAlg` method is defined""" function nautyalg_methods() filter(names(@__MODULE__)) do s f = getproperty(@__MODULE__, s) f isa Function || return false any(methods(f)) do m - sig = m.sig isa UnionAll ? m.sig.body : m.sig - any(t -> t isa Type && t <: NautyAlg, sig.parameters) + sig = m.sig + while sig isa UnionAll; sig = sig.body; end + any(sig.parameters) do t + t isa Type && t <: NautyAlg + end end end end diff --git a/test/graphs_api_extensions.jl b/test/graphs_api_extensions.jl index 0354e52..22d9142 100644 --- a/test/graphs_api_extensions.jl +++ b/test/graphs_api_extensions.jl @@ -1,4 +1,6 @@ @testset "Graphs API extensions" begin + @test NautyGraphs.nautyalg_methods() isa Vector{Symbol} + g = path_graph(5) h = path_graph(5) k = star_graph(5) From e54c6a4b56d9233521b1b91c16a2d5e93316304d Mon Sep 17 00:00:00 2001 From: Maximilian HUEBL Date: Thu, 26 Feb 2026 09:49:28 +0100 Subject: [PATCH 2/3] remove @__MODULE__ in nautyalg_methods --- src/graphs_api_extensions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphs_api_extensions.jl b/src/graphs_api_extensions.jl index 14a0101..a57b520 100644 --- a/src/graphs_api_extensions.jl +++ b/src/graphs_api_extensions.jl @@ -8,8 +8,8 @@ end """Lists all functions for which a `NautyAlg` method is defined""" function nautyalg_methods() - filter(names(@__MODULE__)) do s - f = getproperty(@__MODULE__, s) + filter(names(NautyGraphs)) do s + f = getproperty(NautyGraphs, s) f isa Function || return false any(methods(f)) do m sig = m.sig From 2d430fdfacbddb9bebff76a6fc055a361c744e0d Mon Sep 17 00:00:00 2001 From: Maximilian HUEBL Date: Thu, 26 Feb 2026 10:26:13 +0100 Subject: [PATCH 3/3] restore @__MODULE --- src/graphs_api_extensions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphs_api_extensions.jl b/src/graphs_api_extensions.jl index a57b520..14a0101 100644 --- a/src/graphs_api_extensions.jl +++ b/src/graphs_api_extensions.jl @@ -8,8 +8,8 @@ end """Lists all functions for which a `NautyAlg` method is defined""" function nautyalg_methods() - filter(names(NautyGraphs)) do s - f = getproperty(NautyGraphs, s) + filter(names(@__MODULE__)) do s + f = getproperty(@__MODULE__, s) f isa Function || return false any(methods(f)) do m sig = m.sig