Skip to content

Comments

Make the Error Warning and Trapping System a Python Package (NGWPC-9165) #4

Merged
cmaynard-ngwpc merged 4 commits intodevelopmentfrom
cmaynard_NGWPC-9165_ewts_package
Jan 8, 2026
Merged

Make the Error Warning and Trapping System a Python Package (NGWPC-9165) #4
cmaynard-ngwpc merged 4 commits intodevelopmentfrom
cmaynard_NGWPC-9165_ewts_package

Conversation

@cmaynard-ngwpc
Copy link

@cmaynard-ngwpc cmaynard-ngwpc commented Jan 8, 2026

The Error Warning and Trapping System was embedded in a single file in a subdirectory that required path knowledge in order to import the necessary references. This PR refactors this file into a Python package defined at the codebase top level src directory making it a cleaner and easier implementation of the logging system. Created unit tests for the new package.

Additions

  • Created src/lstm_ewts subdirectory containing the pyproject.toml file
  • Created the src/lstm_ewts/src/lstm_ewts containing the __init__.py file defining the public API for the package along with new package module files constants.py, paths.py, formatter.py, and config.py containing the refactored logger.py logging code.
  • EWTS unit tests in test/lstm_ewts

Removals

  • The original logger.py file has been deleted.

Changes

  • Updated import statements in the code base to use the new lstm_ewts package.
  • Updated the GitHub Unit Test runner to properly include the new lstm_ewts package when doing the pip install

Testing

  1. Tested running ngen stand-alone and building the containers to run ngenCERF. LSTM fails in T-Route when running standalone and in ngenCERF due to a realization file error, both of which are being addressed in bug ticket (NGWPC-9080) and unrelated to the Error, Warning and Trapping System. This can be merged while the bug ticket are worked.

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)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

@cmaynard-ngwpc cmaynard-ngwpc force-pushed the cmaynard_NGWPC-9165_ewts_package branch from f9c36f9 to 1902571 Compare January 8, 2026 17:39
@cmaynard-ngwpc cmaynard-ngwpc marked this pull request as ready for review January 8, 2026 18:57
@cmaynard-ngwpc cmaynard-ngwpc merged commit 85a3301 into development Jan 8, 2026
8 checks passed
@cmaynard-ngwpc cmaynard-ngwpc deleted the cmaynard_NGWPC-9165_ewts_package branch January 8, 2026 19:02
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