Skip to content

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

License

Notifications You must be signed in to change notification settings

JuliaGraphs/GraphsInterfaceChecker.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages