AlgebraicJulia / AlgebraicJulia/Catlab.jl

Methods missing for drawing schemas

Ouverte
#934 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
good first issue graphics
Langage dominant
Julia
Étoiles
724
Forks
73
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

If you try to draw a TypedSchema with `to_graphviz`, you get a MethodError.

```julia
julia> Presentation(SchNamedDecapode)
ERROR: MethodError: no method matching Presentation(::TypedSchema{Symbol, InterType})

Closest candidates are:
Presentation(::BasicSchema{Symbol})
@ Catlab ~/.julia/packages/Catlab/5M12F/src/categorical_algebra/ACSetsGATsInterop.jl:69
Presentation(::Module)
@ GATlab ~/.julia/packages/GATlab/UL4sq/src/models/Presentations.jl:47
Presentation(::Type{S}) where S<:(TypeLevelBasicSchema{Symbol})
@ Catlab ~/.julia/packages/Catlab/5M12F/src/categorical_algebra/ACSetsGATsInterop.jl:52
...

Stacktrace:
[1] top-level scope
@ REPL[8]:1
```

This can be fixed with the following method `Catlab.to_graphviz(s::TypedSchema) = to_graphviz(Presentation(s.schema))`. It would be nice to also extend Presentation to accept a typed schema so that you could draw it with concrete types `Presentation(s::TypedSchema)`. But this 1 liner is a quick fix that would get you 90% of the way there.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.