From d6eac669c8edf4bf29a40c56948f487dab9663ee Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 23 May 2023 05:25:24 +0100 Subject: [PATCH] added mkdir to cwd argument in run (#2523) --- openmc/model/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index ede21c64e0..ee7f3647fd 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -16,7 +16,7 @@ import openmc import openmc._xml as xml from openmc.dummy_comm import DummyCommunicator from openmc.executor import _process_CLI_arguments -from openmc.checkvalue import check_type, check_value +from openmc.checkvalue import check_type, check_value, PathLike from openmc.exceptions import InvalidIDError @@ -24,7 +24,7 @@ from openmc.exceptions import InvalidIDError def _change_directory(working_dir): """A context manager for executing in a provided working directory""" start_dir = Path.cwd() - Path.mkdir(working_dir, exist_ok=True) + Path.mkdir(working_dir, parents=True, exist_ok=True) os.chdir(working_dir) try: yield @@ -632,7 +632,7 @@ class Model: Settings.max_tracks is set. Defaults to False. output : bool, optional Capture OpenMC output from standard out - cwd : str, optional + cwd : PathLike, optional Path to working directory to run in. Defaults to the current working directory. openmc_exec : str, optional