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

example for ParameterScan from docs broken #592

Open
SchwarzMarek opened this issue Aug 9, 2024 · 0 comments
Open

example for ParameterScan from docs broken #592

SchwarzMarek opened this issue Aug 9, 2024 · 0 comments

Comments

@SchwarzMarek
Copy link

SchwarzMarek commented Aug 9, 2024

Hello,
I've encountered few issues when trying to use ParameterScan interface.

  1. plotSurface example
    based on online docs (https://tellurium.readthedocs.io/en/latest/paramscan.html) the plotSurface() example fails with:
File ~/miniconda3/envs/tell/lib/python3.11/site-packages/tellurium/analysis/parameterscan.py:411, in ParameterScan.plotSurface(self)
    408 Z = result[2]
    410 fig = plt.figure()
--> 411 ax = fig.gca(projection='3d')
    412 if self.antialias is False:
    413     surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=self.colormap,
    414                            antialiased=False, linewidth=0)

TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

te.__version__
'2.2.8'
matplotlib.__version__
'3.8.3'
sys.version
'3.11.7 | packaged by conda-forge | (main, Dec 15 2023, 08:38:37) [GCC 12.3.0]'

(I know, that my te version is behind, but the problematic line (https://github.com/sys-bio/tellurium/blob/8652c7f79505889f947d63d444967972f4e4dd38/tellurium/analysis/parameterscan.py#L273C22-L273C38) is still present in github code; this might have some related info: https://stackoverflow.com/questions/76047803/typeerror-figurebase-gca-got-an-unexpected-keyword-argument-projection)

  1. plot2DParameterScan example
    This part of the docs is probably old and does not reflect current code in classes (not functions as in the docs).

I was able to obtain some results with following modification to docs code:

# model definitions
r = te.loada("""
model test
   J0: S1 -> S2; Vmax * (S1/(Km+S1))
    S1 = 10; S2 = 0;
    Vmax = 1; Km = 0.5;
end
""")
s = r.simulate(0, 20, 41)
r.plot(s)

a = te.analysis.parameterscan.ParameterScan2D(r,
                    p1='Vmax', p1Range=np.linspace(1, 10, num=5),
                    p2='Vmax', p2Range=np.linspace(0.1, 1.0, num=5),
                    start=0, end=50, points=101)
a.plotMultiArray()

Best
M.

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

No branches or pull requests

1 participant