Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default output folder management #332

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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 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