Skip to content

Commit

Permalink
Better handle default --outdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Sep 18, 2024
1 parent 7ad5fd0 commit f72d842
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions python/ctsm/mesh_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ def get_parser():
required=False,
)

default_outdir = os.path.join(os.getcwd(), "meshes")
parser.add_argument(
"--outdir",
help="Output directory for plots",
help=f"Output directory for plots. Default: {default_outdir}",
action="store",
dest="out_dir",
type=str,
Expand Down Expand Up @@ -94,10 +95,6 @@ def process_and_check_args(args):
)
abort(err_msg)

# -- no file name and output path:
if not args.output and not args.out_dir:
args.out_dir = os.path.join(os.getcwd(), "meshes")

if not args.output:
# -- make output path if does not exist.
if not os.path.isdir(args.out_dir):
Expand Down

0 comments on commit f72d842

Please sign in to comment.