Skip to content

Add helper to add commonly used cli arguments #407

@tmadlener

Description

@tmadlener

Writing this because I just got annoyed by it, and I will otherwise forget to at least write it down.

We have quite a few arguments that are commonly added. We could consider adding a few of them already pre-configured to the parser we can import from parseArgs. The most commonly used one is probably --compactFile. I have done

from k4FWCore.parseArgs import parser

parser.add_argument("--compactFile", type=str, description="...")

countless times. I am fairly certain there are more of them. The simplest solution would be to either add a function parser_with_default_args that sets up these arguments already before users add theirs (possibly even configurable for "sets of arguments").

Alternatively for compactFile specifically we might consider adding it to k4run and in case it is present also inject the GeoSvc properly configured with it into the ExtSvcs of our ApplicationMgr (as we already do with some other services, I think).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions