Skip to content

Commit c585c0a

Browse files
committed
Address review feedback on PETSc CLI docs
Soften claim about argparse incompatibility (it can be configured), and use parse_known_args + remaining_argv in the tip example. Underworld development team with AI support from Claude Code
1 parent eb4773f commit c585c0a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/beginner/parameters.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ by a descriptive name with **underscores**. This is by design:
6767
- Underworld user parameters share the same options database
6868
- The `uw_` prefix prevents collisions with PETSc's own options
6969

70-
This means standard Python option parsers (argparse, click) will **not** work with
71-
Underworld's CLI parameters. Use `uw.Params` instead — it reads from PETSc's
72-
options database automatically.
70+
This means standard Python option parsers (argparse, click) do **not** support this
71+
style of options by default and may require custom handling if you try to parse
72+
`-uw_*` flags yourself. Use `uw.Params` instead — it reads from PETSc's options
73+
database automatically.
7374

7475
```{tip}
7576
If you're writing a wrapper script that also needs argparse-style options,
76-
parse those with argparse first, then pass the remaining arguments to PETSc
77-
via `petsc4py.init(sys.argv)` before importing underworld.
77+
parse those with argparse first (for example using `parse_known_args`),
78+
then pass only the remaining/unparsed arguments to PETSc via
79+
`petsc4py.init(remaining_argv)` before importing underworld.
7880
```
7981

8082
### Notebook Override

0 commit comments

Comments
 (0)