Skip to content

Commit 668fdf1

Browse files
authored
write_sbml: mkdir (#429)
Create output directory in `write_sbml` if necessary.
1 parent ee0bce4 commit 668fdf1

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)