Skip to content

Commit

Permalink
dcaspt2_input: refactor --scratchdir option, define default values as…
Browse files Browse the repository at this point in the history
… an add_argument argument.
  • Loading branch information
kohei-noda-qcrg committed Oct 31, 2024
1 parent f2e6730 commit 6ee839e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/dcaspt2_input
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Wildcard is available.\n\
)
parser.add_argument(
"--scratch",
default="~/dcaspt2_scratch",
dest="scratchdir",
type=str,
help="Set the scratch directory. Add the subdirectory to the specified directory.\n(e.g.) --scratch /home/username/scratch \n=> Create /home/username/scratch/active_2020-01-01_12-34-56 directory.\n[default: ~/dcaspt2_scratch]",
Expand Down Expand Up @@ -151,11 +152,7 @@ Please specify the valid path and try again."
return scratch_dir

# --scratch option, Create the root scratch directory path
if args.scratchdir:
root_scr_dir = Path(args.scratchdir).expanduser().resolve()
else:
# Use the default scratch directory if --scratch option is not specified
root_scr_dir = Path("~/dcaspt2_scratch").expanduser().resolve()
root_scr_dir = Path(args.scratchdir).expanduser().resolve()

try:
os.makedirs(root_scr_dir, exist_ok=True)
Expand Down

0 comments on commit 6ee839e

Please sign in to comment.