Skip to content

Commit

Permalink
fix issue with avogadro csymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jun 4, 2024
1 parent 9b1b845 commit 8696891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module-system/to-math-expr.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ function _toMathExpr(element, useParentheses = false) {
} else if (element.name === 'csymbol' && element.attributes?.definitionURL === 'https://www.sbml.org/sbml/symbols/delay') {
// return 'delay';
throw new HetaLevelError('"delay" symbol in expression (SBML module) is not supported');
} else if (element.name === 'csymbol' && element.attributes?.definitionURL === 'https://www.sbml.org/sbml/symbols/avogadro') {
return '6.02214076e23';
} else if (element.name === 'csymbol') {
return element.elements[0]?.text;
throw new HetaLevelError(`csymbol with url ${element.attributes?.definitionURL} in expression (SBML module) is not supported`);
} else if (element.name === 'cn' && element.attributes?.type === 'rational' && element.elements[1]?.name === 'sep') { // rational numbers: 1/1000
let numerator = element.elements[0]?.text;
let denominator = element.elements[2]?.text;
Expand Down

0 comments on commit 8696891

Please sign in to comment.