Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SimpleSEDML/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ def roadrunner(self):
return self._roadrunner

def _makeModelSource(self, source:Optional[str]=None)->str:
"""Saves the model to a file. The file name is the model ID.
"""Saves the model to a file. The file name is the model ID with .xml extension for SBML models.
"""
if self.ref_type == cn.MODEL_ID:
# model_ref is the ID of a previously defined model
return self.model_ref
if source is None:
# Use the current directory
source = os.getcwd()
source = os.path.join(source, self.id)
source = os.path.join(source, f"{self.id}.xml") if self.ref_type in [cn.SBML_FILE, cn.SBML_STR, cn.SBML_URL] else os.path.join(source, self.id)
source = str(source)
if self.is_overwrite or not os.path.exists(source):
with open(source, "wb") as f:
Expand Down