Skip to content

fix(params): apply -uw_* CLI overrides regardless of platform (#111)#280

Merged
lmoresi merged 1 commit into
developmentfrom
bugfix/params-cli-autoparse-111
Jun 24, 2026
Merged

fix(params): apply -uw_* CLI overrides regardless of platform (#111)#280
lmoresi merged 1 commit into
developmentfrom
bugfix/params-cli-autoparse-111

Conversation

@lmoresi

@lmoresi lmoresi commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #111uw.Params silently ignored -uw_* command-line overrides on Gadi (fell back to defaults).

Root cause

Params reads overrides from the PETSc options database, but petsc4py only auto-populates that DB from sys.argv on some platforms (macOS) and not others (Gadi). So Params(...) saw an empty DB and used its defaults — no warning, environment-dependent, hard to debug.

Fix

Params.__init__ now calls uw.parse_cmd_line_options() (idempotent) before reading the options DB, so the override is applied consistently regardless of platform. The reporter's suggested fix, made automatic.

Verification

  • -uw_cellsize 1/16 (DB not pre-populated, mimicking Gadi) → now returns 1/16 (was 1/8).
  • No-CLI case still returns the default.
  • Regression: tests/test_0821_params_cli_override.py (2 tests, level_1/tier_a).

Closes #111.

Underworld development team with AI support from Claude Code

uw.Params reads overrides from the PETSc options database, but petsc4py only
auto-populates that DB from sys.argv on some platforms (e.g. macOS) and not
others (e.g. Gadi). On Gadi, Params(...) therefore silently fell back to its
defaults even when the CLI argument was present — a hard-to-debug,
environment-dependent failure with no warning.

Params.__init__ now calls uw.parse_cmd_line_options() (idempotent) before
reading the options DB, so a '-uw_<name> <value>' override is applied
consistently. Regression: tests/test_0821_params_cli_override.py.

Closes #111.

Underworld development team with AI support from Claude Code
Copilot AI review requested due to automatic review settings June 24, 2026 01:06
@lmoresi lmoresi merged commit 5b55b47 into development Jun 24, 2026
@lmoresi lmoresi deleted the bugfix/params-cli-autoparse-111 branch June 24, 2026 01:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants