Skip to content

Commit

Permalink
Merge pull request #332 from OpenGATE/path
Browse files Browse the repository at this point in the history
Change default output folder management
  • Loading branch information
tbaudier authored Jan 11, 2024
2 parents 3cbb303 + a497cf4 commit c23ea32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opengate/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ class Simulation(GateObject):
},
),
"output_dir": (
"./output",
".",
{
"doc": "Directory to which any output is written, "
"unless an absolute path is provided for a specific output."
Expand Down Expand Up @@ -1196,7 +1196,7 @@ def get_output_path(self, path=None, is_file_or_directory="file"):
n = len(p_out.parts) - 1 # last item is the filename
elif is_file_or_directory in ["dir", "Dir", "directory", "d"]:
n = len(p_out.parts) # all items are part of the directory
if len(p_out.parts) > 0:
if len(p_out.parts) > 0 and n > 0:
directory = Path(p_out.parts[0])
for i in range(n - 1):
directory /= p_out.parts[i + 1]
Expand Down

0 comments on commit c23ea32

Please sign in to comment.