HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
2 stars 0 forks source link

Allow config files for excerciser command-line args #252

Closed EvanKirshenbaum closed 5 months ago

EvanKirshenbaum commented 5 months ago

Exerciser.parse_args() is currently defined as

    def parse_args(self,
                   args: Optional[Sequence[str]]=None,
                   namespace: Optional[Namespace]=None) -> tuple[Task, Namespace]:
        ns = self.parser.parse_args(args=args, namespace=namespace)
        Exerciser.setup_logging(levels=ns.log_level, file=ns.log_config)

        task: Task = ns.task
        return task, ns

The command-line arguments are getting quite large, and it would be nice to be able to collect some of them in files. argparse allows you to specify a fromfile_prefix_chars argument to the parser.parse_args() call to allow the user to specify @args.txt to point to a file containing arguments, one per line.

This parameter should probably be an optional argument to parse_args() and parse_args_and_run() to allow it to be overridden or omitted.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 16, 2023 at 4:19 PM PST. Closed on Feb 17, 2023 at 3:23 PM PST.
EvanKirshenbaum commented 5 months ago

This issue was referenced by the following commit before migration:

EvanKirshenbaum commented 5 months ago

Can now specify when creating an Exerciser or PlatformChoiceExerciser. Defaults to "@". If you specify None, then not allowed.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 17, 2023 at 3:23 PM PST.