def cellmlStrToAntimony (CellMLStr): """Convert a cellml string into the equivalent antimony string: ant = cellMLStrToAntimony('mymodel.cellml') """ if libantimony.loadCellMLFile(CellMLStr) < 0: raise Exception ('Error calling cellMLStrToAntimony' + libantimony.getLastError()) return libantimony.getAntimonyString (None)
def cellmlFileToAntimony (CellMLFileName): """Load a cellml file and return the equivalent antimony string: ant = cellMLToAntimony('mymodel.cellml') """ if libantimony.loadCellMLFile(CellMLFileName) == -1: raise Exception ('Error calling loadCellMLFile') libantimony.loadCellMLFile(CellMLFileName) return libantimony.getAntimonyString (None)
def sbmlToAntimony (str): """Convert a SBML string into Antimony: sbmlStr = sbmlToAntimony (antimonyStr) """ err = libantimony.loadSBMLString (str) if (err < 0): raise Exception('Antimony: ' + libantimony.getLastError()) return libantimony.getAntimonyString(None)