Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » libsbml-development » AST_NAME_TIME from libsbml.parseFormula
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Darren J Wilkinson


Posts: 73
Registered:
September 2003
Re: AST_NAME_TIME from libsbml.parseFormula 05 Mar '10 02:08 Go to previous messageGo to previous message

Just following on from Sarah's email, you might be interested in this code snippet from SBML-shorthand (http://www.staff.ncl.ac.uk/d.j.wilkinson/software/sbml-sh/):


def replaceTime(ast):
if (ast.getType()==libsbml.AST_NAME):
if ((ast.getName()=='t') or (ast.getName()=='time')):
ast.setType(libsbml.AST_NAME_TIME)
for node in range(ast.getNumChildren()):
self.replaceTime(ast.getChild(node))


Cheers,
--
Darren Wilkinson
email: darrenjwilkinson@btinternet.com
www: http://www.staff.ncl.ac.uk/d.j.wilkinson/


--- On Thu, 4/3/10, Jordan Atlas <jca33@cornell.edu> wrote:

> From: Jordan Atlas <jca33@cornell.edu>
> Subject: [libsbml-development] AST_NAME_TIME from libsbml.parseFormula
> To: libsbml-development@caltech.edu
> Date: Thursday, 4 March, 2010, 21:40
>
> Dear Forum,
>
> What is the proper way to enter a formula that references
> "time" (i.e. the model simulation time) into libSBML's
> "parseFormula" function?
>
> When I call libsbml.parseFormula('time') in python the
> resulting AST has type AST_NAME rather than
> AST_NAME_TIME. This is causing an error in the
> resulting SBML validation because the name 'time' is not
> recognized as a species/reaction/parameter/etc.
>
> I am using libSBML-4.0.0-xerces-vc90 from Python on Windows
> XP.
>
> There is a similar problem posted here, but I don't see any
> follow up.
>
> Thanks for your help.
>
> --Jordan Atlas
> ____________________________________________________________
> To manage your libsbml-development list subscription, visit
>
> https://utils.its.caltech.edu/mailman/listinfo/libsbml-development
>
> For a web interface to the libsbml-development mailing
> list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the libsbml-development
> list,
> contact sbml-team@caltech.edu
>
>
____________________________________________________________
To manage your libsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/libsbml-development

For a web interface to the libsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the libsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   AST_NAME_TIME from libsbml.parseFormula Jordan Atlas04 Mar '10 07:46
Read Message   Re: AST_NAME_TIME from libsbml.parseFormula Sarah Keating04 Mar '10 23:41
Read Message   Re: AST_NAME_TIME from libsbml.parseFormula  Darren J Wilkinson05 Mar '10 02:08
Read Message   Re: AST_NAME_TIME from libsbml.parseFormula Jordan Atlas05 Mar '10 06:21
Previous Topic:v.2.3. release 2 Java consistency check crashes
Next Topic:How to enable libsbml matlab binding in 64 bit windows?
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.