-
Notifications
You must be signed in to change notification settings - Fork 70
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 at tutorial visualization step #568
Comments
Could you provide the entire stack trace from your terminal? It would be helpful to see the exact line that's failing as well as everything leading up to it. |
Thank you for your reply, here is the entire error message: `'C:/Users/.../anaconda3/pkgs/pysb-1.14.0-py_0/site-packages/pysb/tools/render_reactions.py' 'C:/Users/.../anaconda3/Scripts/PySB/mymodel.py' > mymodel.dot Input In [14] in <cell line: 1> NameError: name 'mymodel' is not defined` I ran this line interactively after running the following: import the pysb module and all its methods and functionsfrom pysb import * instantiate a modelModel() declare monomersMonomer('C8', ['b']) input the parameter valuesParameter('kf', 1.0e-07) now input the rulesRule('C8_Bid_bind', C8(b=None) + Bid(b=None, S='u') | C8(b=1) % Bid(b=1, S='u'), *[kf, kr]) initial conditionsParameter('C8_0', 1000) ObservablesObservable('obsC8', C8(b=None)) import mymodel as m (I'm sorry, I cannot figure out how to format the above code properly) |
It looks like you are entering the command as a cell in a Jupyter notebook. That command as written must be run from the shell instead. If you want to run the visualization from a notebook you'll need Python code: First, delete the line from IPython.display import SVG
import pygraphviz
import pysb.tools.render_reactions Then we call the pysb render_reactions tool and store the result as a GraphViz graph object in g = pygraphviz.AGraph(string=pysb.tools.render_reactions.run(model)) Finally we call graphviz to perform layout and SVG rendering, displaying the SVG inline in the notebook: SVG(g.draw(prog="dot", format="svg")) |
When I enter the command:
[path-to-pysb]/pysb/tools/render_reactions.py [path-to-pysb-model-file]/mymodel.py > mymodel.dot
Replacing with appropriate path names as instructed, I get the following error:
NameError: name 'mymodel' is not defined
What may cause this? Thank you
The text was updated successfully, but these errors were encountered: