Skip to content

Refactor model.py#149

Open
mxkpp wants to merge 36 commits into
maxkipp-pre-devfrom
maxkipp-refactor-model-py
Open

Refactor model.py#149
mxkpp wants to merge 36 commits into
maxkipp-pre-devfrom
maxkipp-refactor-model-py

Conversation

@mxkpp
Copy link
Copy Markdown

@mxkpp mxkpp commented May 2, 2026

This refactors model.py:

  1. NWMv3ForcingEngineModel now contains its own references to other class instances, reducing passing of multiple class instances into each function. Note this affects bmi_model.py mildly.
  2. General DRYifying via partials and internal check_program_status method.
  3. Some hardening (raise new errors for parts of code that are unused, and for unexpected values).
  4. Logging consistently through MPI-aware logging methods.
  5. Some new private methods to reduce size of methods.
  6. Type hints and docstrings adjusted and made consistently reST format.
  7. Some methods renamed.
  8. Some formatting.

Additions

Removals

Changes

  • See above

Testing

  1. pytests (except InputForcings -n 2) passed, including the new AnA test from maxkipp-add-tests: Add Test for CONUS Standard AnA and Refactor Test Configuration #148. InputForcings -n 2 is not passing on the base branch currently.

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Linux

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.

1 participant