Skip to content

Commit

Permalink
add option to parse YAML file
Browse files Browse the repository at this point in the history
Co-Authored-By: Alin Marin Elena <[email protected]>
  • Loading branch information
ilyes319 and alinelena committed Mar 28, 2024
1 parent 75b6b98 commit 31f2783
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mace/tools/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@


def build_default_arg_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
try:
import configargparse

parser = configargparse.ArgumentParser(
config_file_parser_class=configargparse.YAMLConfigFileParser,
)
parser.add(
"--config",
type=str,
is_config_file=True,
help="config file to agregate options",
)
except ImportError:

This comment has been minimized.

Copy link
@alinelena

alinelena Mar 28, 2024

Author Contributor

I wonder if makes sense to raise an warning on except for people to know the config file will not work?

parser = argparse.ArgumentParser()

# Name and seed
parser.add_argument("--name", help="experiment name", required=True)
Expand Down

0 comments on commit 31f2783

Please sign in to comment.