mbrs.args module#

class mbrs.args.ArgumentParser(*args, parents: ~typing.Sequence[~simple_parsing.parsing.ArgumentParser] = (), add_help: bool = True, conflict_resolution: ~simple_parsing.conflicts.ConflictResolution = ConflictResolution.AUTO, add_option_string_dash_variants: ~simple_parsing.wrappers.field_wrapper.DashVariant = DashVariant.AUTO, argument_generation_mode=ArgumentGenerationMode.FLAT, nested_mode: ~simple_parsing.wrappers.field_wrapper.NestedMode = NestedMode.DEFAULT, formatter_class: type[~argparse.HelpFormatter] = <class 'simple_parsing.help_formatter.SimpleHelpFormatter'>, add_config_path_arg: bool | str | None = None, config_path: ~pathlib.Path | str | ~typing.Sequence[~pathlib.Path | str] | None = None, add_dest_to_option_strings: bool | None = None, **kwargs)[source]#

Bases: ArgumentParser

IMPORTED_MODULES: set[Path] = {}#
add_plugin_argumnets(parser: ArgumentParser) None[source]#

Add arguments for plugins.

Parameters:

parser (ArgumentParser) – Argument parser.

import_plugin(plugin_dir: Path) None[source]#

Import plugin modules.

Parameters:

plugin_dir (pathlib.Path) – A directory containing user defined plugins.

parse_known_args(args: Sequence[str] | None = None, namespace: Namespace | None = None, attempt_to_reorder: bool = False)[source]#
parse_known_args_preprocess(args: Sequence[str] | None = None, namespace: Namespace | None = None, attempt_to_reorder: bool = False) None[source]#
preprocess_parser() None[source]#

Preprocess ArgumentParser.

class mbrs.args.DataclassWrapper(dataclass: type[~simple_parsing.utils.DataclassT], name: str, default: ~simple_parsing.utils.DataclassT | dict | None = None, prefix: str = '', parent: ~simple_parsing.wrappers.dataclass_wrapper.DataclassWrapper | None = None, _field: ~dataclasses.Field | None = None, field_wrapper_class: type[~simple_parsing.wrappers.field_wrapper.FieldWrapper] = <class 'simple_parsing.wrappers.field_wrapper.FieldWrapper'>, dataclass_fn: ~typing.Callable[[...], ~simple_parsing.utils.DataclassT] | None = None)[source]#

Bases: DataclassWrapper

add_arguments(parser: ArgumentParser) None[source]#