sys-bio / tellurium

Python Environment for Modeling and Simulating Biological Systems
http://tellurium.analogmachine.org/
Apache License 2.0
107 stars 36 forks source link

Issue warning rather than error for assignment rules with no event assignment #453

Open jonrkarr opened 4 years ago

jonrkarr commented 4 years ago
<eventAssignment variable="V"></eventAssignment>

generates this error

Error: Invalid SBML: 
line 1618: (21213 [Error]) An EventAssignment object must contain exactly one MathML <math> element.  The <math> element is optional in L3V2 and beyond.
Reference: L3V1 Section 4.12
 The <eventAssignment> with variable 'V' of the <event> with id 'vaccine_administration' does not contain a <math> element. 


Traceback (most recent call last):
  File "/usr/local/bin/tellurium", line 11, in <module>
    load_entry_point('Biosimulations-tellurium==2.4.1', 'console_scripts', 'tellurium')()
  File "/usr/local/lib/python3.6/dist-packages/Biosimulations_tellurium/__main__.py", line 51, in main
    app.run()
  File "/usr/local/lib/python3.6/dist-packages/cement/core/foundation.py", line 916, in run
    return_val = self.controller._dispatch()
  File "/usr/local/lib/python3.6/dist-packages/cement/ext/ext_argparse.py", line 808, in _dispatch
    return func()
  File "/usr/local/lib/python3.6/dist-packages/Biosimulations_tellurium/__main__.py", line 36, in _default
    exec_combine_archive(args.archive, args.out_dir)
  File "/usr/local/lib/python3.6/dist-packages/Biosimulations_tellurium/core.py", line 72, in exec_combine_archive
    factory.executePython()
  File "/usr/local/lib/python3.6/dist-packages/tellurium/sedml/tesedml.py", line 505, in executePython
    exec(compile(code, filename, 'exec'), symbols)
  File "/tmp/te-generated-sedml.py", line 48, in <module>
    BIOMD0000000791 = te.loadSBMLModel(os.path.join(workingDir, 'Wilson2012.xml'))
  File "/usr/local/lib/python3.6/dist-packages/tellurium/tellurium.py", line 558, in loadSBMLModel
    return roadrunner.RoadRunner(sbml)
  File "/usr/local/lib/python3.6/dist-packages/tellurium/roadrunner/extended_roadrunner.py", line 16, in __init__
    super(ExtendedRoadRunner, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/roadrunner/roadrunner.py", line 3615, in _new_init
    RoadRunner._swig_init(self, *args)
  File "/usr/local/lib/python3.6/dist-packages/roadrunner/roadrunner.py", line 2484, in __init__
    this = _roadrunner.new_RoadRunner(*args)
RuntimeError: ASTNode is NULL, at llvm::Value* rrllvm::ASTNodeCodeGen::codeGen(const libsbml::ASTNode*)

In contrast, COPASI generates this warning:

>WARNING 2020-04-18T20:16:40<
  SBML (58): Eventassignment for object with id "V" does not set a mathematical expression. Ignoring assignment.
>WARNING 2020-04-18T20:16:40<
  SBML (58): Eventassignment for object with id "V" does not set a mathematical expression. Ignoring assignment.
SBML (40): LIBSBML ERROR 21213 at line 1013 column 10: An EventAssignment object must contain exactly one MathML <math> element.  The <math> element is optional in L3V2 and beyond.
Reference: L3V1 Section 4.12
 The <eventAssignment> with variable 'V' of the <event> with id 'virus_treatment_2' does not contain a <math> element. 
.
SBML (40): LIBSBML ERROR 21213 at line 973 column 10: An EventAssignment object must contain exactly one MathML <math> element.  The <math> element is optional in L3V2 and beyond.
Reference: L3V1 Section 4.12
 The <eventAssignment> with variable 'V' of the <event> with id 'virus_treatment_1' does not contain a <math> element. 
.
jonrkarr commented 4 years ago

The above example comes from BIOMD0000000791