-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import odatse | ||
|
||
def initialize(): | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser( | ||
description=( | ||
"Data-analysis software of quantum beam " | ||
"diffraction experiments for 2D material structure" | ||
) | ||
) | ||
parser.add_argument("inputfile", help="input file with TOML format") | ||
parser.add_argument("--version", action="version", version=odatse.__version__) | ||
|
||
mode_group = parser.add_mutually_exclusive_group() | ||
mode_group.add_argument("--init", action="store_true", help="initial start (default)") | ||
mode_group.add_argument("--resume", action="store_true", help="resume intterupted run") | ||
mode_group.add_argument("--cont", action="store_true", help="continue from previous run") | ||
|
||
parser.add_argument("--reset_rand", action="store_true", default=False, help="new random number series in resume or continue mode") | ||
|
||
args = parser.parse_args() | ||
|
||
|
||
if args.init is True: | ||
run_mode = "initial" | ||
elif args.resume is True: | ||
run_mode = "resume" | ||
if args.reset_rand is True: | ||
run_mode = "resume-resetrand" | ||
elif args.cont is True: | ||
run_mode = "continue" | ||
if args.reset_rand is True: | ||
run_mode = "continue-resetrand" | ||
else: | ||
run_mode = "initial" # default | ||
|
||
info = odatse.Info.from_file(args.inputfile) | ||
# info.algorithm.update({"run_mode": run_mode}) | ||
|
||
return info, run_mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters