Skip to content

Commit

Permalink
Workaround for bug in libsbml
Browse files Browse the repository at this point in the history
  • Loading branch information
leonplanken committed Feb 6, 2025
1 parent 0e17178 commit 596ced4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jaxkineticmodel/load_sbml/sympy_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class LibSBMLConverter(Converter):
}

def libsbml2sympy(self, node: libsbml.ASTNode) -> sympy.Basic:
node = libsbml.ASTNode(node) # Work around a bug in libsbml
if not node.isWellFormedASTNode():
raise ValueError('Got invalid libSBML AST node')

Expand Down Expand Up @@ -265,4 +266,4 @@ def convert_libsbml_FUNCTION(self, node, children) -> sympy.Basic:
raise ValueError("FUNCTION node has no associated name")

sympy_function = sympy.Function(function_name) # Define function
return sympy_function(*children) # Apply function to arguments
return sympy_function(*children) # Apply function to arguments

0 comments on commit 596ced4

Please sign in to comment.