Skip to content

Commit

Permalink
Update version number; add another memory fix for Antimony.
Browse files Browse the repository at this point in the history
Antimony also saves returned strings in memory; free them.
  • Loading branch information
luciansmith committed Dec 1, 2021
1 parent 07f29e7 commit aa241da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tellurium/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.2.1
6 changes: 6 additions & 0 deletions tellurium/tellurium.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ def antimonyToSBML(ant):
:rtype: str
"""
antimony.clearPreviousLoads()
antimony.freeAll()
try:
isfile = os.path.isfile(ant)
except ValueError:
Expand All @@ -613,6 +614,7 @@ def antimonyToCellML(ant):
:rtype: str
"""
antimony.clearPreviousLoads()
antimony.freeAll()
if os.path.isfile(ant):
code = antimony.loadAntimonyFile(ant)
else:
Expand All @@ -631,6 +633,7 @@ def sbmlToAntimony(sbml):
:rtype: str
"""
antimony.clearPreviousLoads()
antimony.freeAll()
isfile = False
try:
isfile = os.path.isfile(sbml)
Expand All @@ -655,6 +658,7 @@ def sbmlToCellML(sbml):
if not hasattr(antimony, "loadCellMLString"):
raise NotImplementedError("CellML support was not compiled into Antimony, so conversion is not available.")
antimony.clearPreviousLoads()
antimony.freeAll()
if os.path.isfile(sbml):
code = antimony.loadSBMLFile(sbml)
else:
Expand All @@ -673,6 +677,7 @@ def cellmlToAntimony(cellml):
if not hasattr(antimony, "loadCellMLString"):
raise NotImplementedError("CellML support was not compiled into Antimony, so conversion is not available.")
antimony.clearPreviousLoads()
antimony.freeAll()
if os.path.isfile(cellml):
code = antimony.loadCellMLFile(cellml)
else:
Expand All @@ -692,6 +697,7 @@ def cellmlToSBML(cellml):
if not hasattr(antimony, "loadCellMLString"):
raise NotImplementedError("CellML support was not compiled into Antimony, so conversion is not available.")
antimony.clearPreviousLoads()
antimony.freeAll()
if os.path.isfile(cellml):
code = antimony.loadCellMLFile(cellml)
else:
Expand Down

0 comments on commit aa241da

Please sign in to comment.