Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTX Code Release (PI-4): T-Route Unit Test additions and cleanup #848

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

taddyb
Copy link

@taddyb taddyb commented Dec 17, 2024

Today, Raytheon demo'd the FIM-Services capability to:

Provide a full complement of unit tests for T-Route. Each modular component will have a suite of tests. The purpose of this work is to fill in the test suite for capabilities built by teams outside of this contract and to ensure any changes to T-Route not impact National Water model, or Replace and Route, capabilities

This Pull Request contains features related to all unit tests within the src/ directory. There will be an additional PR created to house all features related to integration tests within the test/ directory.

See #849 for the integration tests related to this deliverable

Additions

  • Validation tests for all configs within the test/ dir using the Pydantic objects withinsrc/troute-config
  • NHD network creation tests within src/troute-network
  • Compute tests for DA functionality within src/troute-routing

Removals

  • src/troute-network/tests/test_HYFeaturesNetwork.py as the hydrofabric reference is outdated. Functionality is replaced in the integration tests
    -src/troute-network/troute/test_qlat.py as the Hydrofabric reference does not exist anymore
  • src/troute-routing/test-framework-parity as the config files to run this no longer exist and the functionality is replaced with the integration tests
  • src/troute-network/troute/network/reservoirs/test/test_compute_kernel.py as the pyximport functionality is broken. Tests are addressed in the integration tests.

Changes

  • Renamed src/troute-network/tests to src/troute-network/test to match patterns
  • Moved src/troute-routing/troute/routing/test_compute.py to src/troute-routing/test

Testing

  1. Run the following commands to run the tests once T-route is installed and compiled:
pip install -e .[test]
pytest src/troute-config
pytest src/troute-network
pytest src/troute-routing

Screenshots

[root@b0352bf6975f t-route]# pytest src/troute-config
======================================================================================================= test session starts ========================================================================================================
platform linux -- Python 3.9.19, pytest-8.3.2, pluggy-1.5.0
rootdir: /t-route/src/troute-config
configfile: pyproject.toml
plugins: anyio-4.7.0
collected 22 items                                                                                                                                                                                                                 

src/troute-config/test/test_config.py ..........                                                                                                                                                                             [ 45%]
src/troute-config/test/test_types.py ............                                                                                                                                                                            [100%]

======================================================================================================== 22 passed in 0.44s ========================================================================================================
[root@b0352bf6975f t-route]# pytest src/troute-network
======================================================================================================= test session starts ========================================================================================================
platform linux -- Python 3.9.19, pytest-8.3.2, pluggy-1.5.0
rootdir: /t-route/src/troute-network
configfile: pyproject.toml
plugins: anyio-4.7.0
collected 4 items                                                                                                                                                                                                                  

src/troute-network/test/test_nhd_network.py ...s                                                                                                                                                                             [100%]

=================================================================================================== 3 passed, 1 skipped in 0.06s ===================================================================================================
[root@b0352bf6975f t-route]# pytest src/troute-routing
======================================================================================================= test session starts ========================================================================================================
platform linux -- Python 3.9.19, pytest-8.3.2, pluggy-1.5.0
rootdir: /t-route/src/troute-routing
configfile: pyproject.toml
plugins: anyio-4.7.0
collected 1 item                                                                                                                                                                                                                   

src/troute-routing/test/test_compute.py .                                                                                                                                                                                    [100%]

======================================================================================================== 1 passed in 0.25s =========================================================================================================
[root@b0352bf6975f t-route]# 

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

  • Windows
  • Linux
  • Browser

Accessibility

  • Keyboard friendly
  • Screen reader friendly

Other

  • Is useable without CSS
  • Is useable without JS
  • Flexible from small to large screens
  • No linting errors or warnings
  • JavaScript tests are passing

@taddyb taddyb changed the title RTX Code Release (PI-4): Additions to T-Route to be run at the Old River Control Center to connect disconnected flowline networks and assimilate using observations #847 RTX Code Release (PI-4): T-Route Unit Test additions and cleanup Dec 17, 2024
@taddyb taddyb marked this pull request as ready for review December 17, 2024 22:18
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