You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The create SBML when setting model units is overly complicated. If the substanceUnits, timeUnits, ... are one of the base units or defined units these should just be used in the model element instead of creating a new unitDefinition.
These unit definitions
import tellurium as te
r = te.loada('''
// Units
m2 = meter^2;
m3 = meter^3;
// base units
substance = mole;
volume = m2;
area = m3;
length = metre;
extent = mole;
time_unit = second;
''')
print(r.getSBML())
should create the following SBML
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by libAntimony version v2.8.1 on 2016-02-17 12:19 with libSBML version 5.12.1. -->
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
<model id="__main" name="__main" substanceUnits="mole" timeUnits="second" volumeUnits="m3" areaUnits="m2" lengthUnits="metre" extentUnits="mole">
<listOfUnitDefinitions>
<unitDefinition id="m2">
<listOfUnits>
<unit kind="metre" exponent="2" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="m3">
<listOfUnits>
<unit kind="metre" exponent="3" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
</model>
But currently result in the much more complicated and unreadable
Hi Lucian,
The create SBML when setting model units is overly complicated. If the substanceUnits, timeUnits, ... are one of the base units or defined units these should just be used in the model element instead of creating a new unitDefinition.
These unit definitions
should create the following SBML
But currently result in the much more complicated and unreadable
Only define the substance, volume, ... units if they are not defined in the model or are no base units.
The best
Matthias
Reported by: matthiaskoenig
The text was updated successfully, but these errors were encountered: