CellML Discussion List

Text archives Help


[cellml-discussion] Python CellML's code doesn't work - python 2.6.6


Chronological Thread 
  • From: r.britten at auckland.ac.nz (Randall Britten)
  • Subject: [cellml-discussion] Python CellML's code doesn't work - python 2.6.6
  • Date: Mon, 7 Mar 2011 23:41:59 +1300

Hi



The file will run if you fix it as follows, but the plotted results are not
convincing at first glance, nevertheless, this is what is needed to make it
run:



Change all occurrences of lowercase "voi" (variable of integration) to
uppercase "VOI".



Change the calls to from log(x,10) to log10(x). This needs to be done 4
times, twice each for each of the two algebraic: algebraic[46] and
algebraic[47].



I've attached a fixed file.



I've also logged a bug for the code generator for Python.
https://tracker.physiomeproject.org/show_bug.cgi?id=2850. We'd appreciate
it if you would create a login for yourself on our tracker and add yourself
as a CC to this tracker item.



Regards,

Randall

From: cellml-discussion-bounces at cellml.org
[mailto:cellml-discussion-bounces at cellml.org] On Behalf Of Kamran
Sent: Saturday, 5 March 2011 12:33 p.m.
To: cellml-discussion at cellml.org
Subject: [cellml-discussion] Python CellML's code doesn't work - python
2.6.6



Hi there

I've downloaded several python codes from CellML. None of them works when I
run them by python 2.6.6. I have installed numpy and scipy and they work
properly. I guess the problem is related to the generic ode solver. Here is
the errors:




darwin at darwinComputer:~/Projects/simple CICR/temp$ python rawshan.py
capi_return is NULL
Call-back cb_f_in_dvode__user__routines failed.
Traceback (most recent call last):
File "rawshan.py", line 838, in <module>
(voi, states, algebraic) = solve_model()
File "rawshan.py", line 818, in solve_model
r.integrate(t)
File "/usr/lib/python2.6/dist-packages/scipy/integrate/ode.py", line 260,
in integrate
self.f_params,self.jac_params)
File "/usr/lib/python2.6/dist-packages/scipy/integrate/ode.py", line 435,
in run
y1,t,istate = self.runner(*(args[:5]+tuple(self.call_args)+args[5:]))
File "rawshan.py", line 605, in computeRates
algebraic[46] = -(log((states[5]/1.00000), 10))+3.00000
TypeError: return arrays must be of ArrayType


rawshan.py is the python code downloaded from here
<http://models.cellml.org/exposure/d72a36fe0b7e121068c96bcb1ff6044a/shannon_
wang_puglisi_weber_bers_2004_a.cellml/@@cellml_codegen/Python/raw> .

Thank you
Kamran Bigdely-Shamloo
University of Calgary, AB, Canada

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.cellml.org/pipermail/cellml-discussion/attachments/20110307/8096c76f/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: r.py
URL:
<http://lists.cellml.org/pipermail/cellml-discussion/attachments/20110307/8096c76f/attachment-0001.diff>




Archive powered by MHonArc 2.6.18.

Top of page