Skip to content

Adding ArgumentDefaultsHelpFormatter to EntryPoint.parser#2546

Open
drewj-tp wants to merge 1 commit into
mainfrom
drewj/argparse-default-formatter
Open

Adding ArgumentDefaultsHelpFormatter to EntryPoint.parser#2546
drewj-tp wants to merge 1 commit into
mainfrom
drewj/argparse-default-formatter

Conversation

@drewj-tp
Copy link
Copy Markdown
Contributor

@drewj-tp drewj-tp commented May 28, 2026

What is the change? Why is it being made?

Helps show more information about the default value for a given argument. For example, from the output of armi vis-file -h

  --format, -f FORMAT   Output format. Supported formats: `vtk` and `xdmf` (default: vtk)
  --nodes NODES         An optional list of time nodes to include. Should look like `(1,0)(1,1)(1,2)`, etc (default: None)
  --max-node MAX_NODE   An optional (cycle,timeNode) tuple to specify the latest time step that should be included (default: None)
  --min-node MIN_NODE   An optional (cycle,timeNode) tuple to specify the earliest time step that should be included (default: None)

Other cases where this may be useful:

armi compare -h
[...]
  --tolerance TOLERANCE
                        If a test database entry differs by more than this percent from the reference database, then it will be marked as a difference between the two databases. (default: 0.01)
  --weights [WEIGHTS ...]
                        Period separated key/value pairs for database table weights (default: None)
  --exclude EXCLUDE [EXCLUDE ...]
                        Patterns for parameters to ignore in comparisons (default: ('^.*/minutesSinceStart$', '^.*/maxProcessMemoryInMB$', '^.*/minProcessMemoryInMB$', '^.*/serialNum$',
                        '^.*/temperatureInC$', '^.*/volume$', '^.*/layout/temperatures$'))

The armi submit-suite has a runtime dependent default for --suiteDir (current working directory) that also nicely populates

SCR Information

Change Type: trivial

One-Sentence Rationale: Plugins can have complicated, run time dependent defaults and this helps automatically display them

One-line Impact on Requirements: NA


Checklist

Helps show more information about the default value for a given
argument. For example, from the output of `armi vis-file -h`
```
  --format, -f FORMAT   Output format. Supported formats: `vtk` and `xdmf` (default: vtk)
  --nodes NODES         An optional list of time nodes to include. Should look like `(1,0)(1,1)(1,2)`, etc (default: None)
  --max-node MAX_NODE   An optional (cycle,timeNode) tuple to specify the latest time step that should be included (default: None)
  --min-node MIN_NODE   An optional (cycle,timeNode) tuple to specify the earliest time step that should be included (default: None)
```
@drewj-tp drewj-tp self-assigned this May 28, 2026
Copy link
Copy Markdown
Member

@opotowsky opotowsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan for more CLI help info!

@opotowsky
Copy link
Copy Markdown
Member

testing this, it's glorious. why is this not the default argparse behavior, grumble grumble.

@john-science john-science changed the title Add ArgumentDefaultsHelpFormatter to EntryPoint.parser Adding ArgumentDefaultsHelpFormatter to EntryPoint.parser May 29, 2026
@john-science john-science added the feature request Adding a new feature or medium-to-large change label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Adding a new feature or medium-to-large change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants