GraphsInterfaceChecker.jl

Formalization of the AbstractGraph interface from Graphs.jl, specified using Interfaces.jl.
Author JuliaGraphs
Popularity
3 Stars
Updated Last
6 Months Ago
Started In
November 2023

GraphsInterfaceChecker

Build Status

Formalization of the AbstractGraph interface from Graphs.jl, specified using Interfaces.jl.

Getting started

Install GraphsInterfaceChecker.jl using the GitHub URL, and install Interfaces.jl from the general registry:

using Pkg

Pkg.add(url="https://github.com/JuliaGraphs/GraphsInterfaceChecker.jl")
Pkg.add("Interfaces")

using GraphsInterfaceChecker
using Interfaces

Creating a new graph type

The only name exported by this package is AbstractGraphInterface.

Suppose you define a new graph type MyGraphType <: Graphs.AbstractGraph. To declare that you implement the interface, you need to provide a list of (small) test_graphs, then use the macro Interfaces.@implements like so:

Interfaces.@implements AbstractGraphInterface MyGraphType test_graphs

Then, you can validate your implementation as follows:

Interfaces.test(AbstractGraphInterface, MyGraphType)

Used By Packages

No packages found.