Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods missing for drawing schemas #934

Open
jpfairbanks opened this issue Aug 24, 2024 · 0 comments
Open

Methods missing for drawing schemas #934

jpfairbanks opened this issue Aug 24, 2024 · 0 comments

Comments

@jpfairbanks
Copy link
Member

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants