Skip to content

Commit

Permalink
Merge pull request #670 from vue1999/parser-help
Browse files Browse the repository at this point in the history
List default arguments with --help
  • Loading branch information
ilyes319 authored Nov 4, 2024
2 parents 29c99ae + 35c7de6 commit c1184eb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion mace/cli/active_learning_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("--config", help="path to XYZ configurations", required=True)
parser.add_argument(
"--config_index", help="index of configuration", type=int, default=-1
Expand Down
4 changes: 3 additions & 1 deletion mace/cli/create_lammps_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@


def parse_args():
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"model_path",
type=str,
Expand Down
4 changes: 3 additions & 1 deletion mace/cli/eval_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("--configs", help="path to XYZ configurations", required=True)
parser.add_argument("--model", help="path to model", required=True)
parser.add_argument("--output", help="output path", required=True)
Expand Down
4 changes: 3 additions & 1 deletion mace/cli/fine_tuning_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"--configs_pt",
help="path to XYZ configurations for the pretraining",
Expand Down
5 changes: 4 additions & 1 deletion mace/cli/plot_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def parse_training_results(path: str) -> List[dict]:


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Plot mace training statistics")
parser = argparse.ArgumentParser(
description="Plot mace training statistics",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"--path", help="path to results file or directory", required=True
)
Expand Down
9 changes: 7 additions & 2 deletions mace/tools/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def build_default_arg_parser() -> argparse.ArgumentParser:

parser = configargparse.ArgumentParser(
config_file_parser_class=configargparse.YAMLConfigFileParser,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add(
"--config",
Expand All @@ -23,7 +24,9 @@ def build_default_arg_parser() -> argparse.ArgumentParser:
help="config file to agregate options",
)
except ImportError:
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

# Name and seed
parser.add_argument("--name", help="experiment name", required=True)
Expand Down Expand Up @@ -704,7 +707,9 @@ def build_default_arg_parser() -> argparse.ArgumentParser:


def build_preprocess_arg_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"--train_file",
help="Training set h5 file",
Expand Down

0 comments on commit c1184eb

Please sign in to comment.