Skip to content

Commit 75c9a9e

Browse files
committed
write_sbml: mkdir
Create output directory in `write_sbml` if necessary.
1 parent 876c781 commit 75c9a9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

petab/v1/sbml.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def write_sbml(sbml_doc: libsbml.SBMLDocument, filename: Path | str) -> None:
169169
sbml_doc: SBML document containing the SBML model
170170
filename: Destination file name
171171
"""
172+
Path(filename).parent.mkdir(parents=True, exist_ok=True)
172173
sbml_writer = libsbml.SBMLWriter()
173174
ret = sbml_writer.writeSBMLToFile(sbml_doc, str(filename))
174175
if not ret:

0 commit comments

Comments
 (0)