mlrl.testbed.command module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for dealing with commands and their arguments.

class mlrl.testbed.command.ArgumentDict

Bases: Dict[str, str | None]

A dictionary that stores the names of command line arguments, as well as their associated values, if available.

to_list() ArgumentList

Creates and returns an ArgumentList from this dictionary.

Returns:

The ArgumentList that has been created

class mlrl.testbed.command.ArgumentList(iterable=(), /)

Bases: List[str]

A list that stores command line arguments.

filter(*arguments_to_be_ignored: str) ArgumentList

Creates and returns an ArgumentList by filtering the arguments in this list.

Parameters:

arguments_to_be_ignored – The names of the arguments to be ignored

Returns:

The ArgumentList that has been created

to_dict() ArgumentDict

Creates and returns an ArgumentDict from this list.

Returns:

The ArgumentDict that has been created

class mlrl.testbed.command.Command(module_name: str, argument_list: ArgumentList)

Bases: Iterable[str]

A command for running MLRL-Testbed, consisting of a module name and several arguments.

Attributes:

module_name: The name of the Python module argument_list: An ArgumentList that stores the arguments

apply_to_namespace(namespace: Namespace) Namespace

Adds the command’s arguments to a given namespace.

Parameters:

namespace – The namespace, the arguments should be added to

Returns:

The modified namespace

argument_list: ArgumentList
module_name: str