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

Error if pygraphviz is not installed #569

Closed
FridjofAmundsen opened this issue Apr 1, 2022 · 2 comments
Closed

Error if pygraphviz is not installed #569

FridjofAmundsen opened this issue Apr 1, 2022 · 2 comments
Assignees
Labels

Comments

@FridjofAmundsen
Copy link

graphviz is not used as fallback
if pygraphviz is not available, an error is thrown.
In Version 8.1 'graphviz' was used as a fallback.

Minimal working example

from transitions.extensions import GraphMachine
class Model:
    pass
machine = GraphMachine(model=Model())

Expected behavior
I expect that in this case graphviz is used as a fallback.

workaround

import pkgutil
from transitions.extensions import GraphMachine

class Model:
    pass
has_pygraphviz = pkgutil.find_loader('pygraphviz')
machine = GraphMachine(model=Model(),  use_pygraphviz=has_pygraphviz )

Additional context
the following patch would solve this issue.
fallback_to_graphviz_patch.zip

@aleneum
Copy link
Member

aleneum commented Apr 1, 2022

Hello @FridjofAmundsen,

thanks for the report and sorry for the regression. I will have a look whether we can easily integrate this as a test case.

@FridjofAmundsen
Copy link
Author

@aleneum thanks. You don't have to apologize. I’m really happy that you put so much effort into this project.

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

No branches or pull requests

2 participants