Validator (PlateGirderBridge) File Test#143
Open
ManavSharma23 wants to merge 13 commits into
Open
Conversation
…d cases - Port create_seismic_load_cases() (EQ_X/EQ_Z/EQ_Y + 1.5 EQ (a/b/c) per Cl.218.3) with tributary-area nodal distribution, replacing the old UI-pressure patch load create_seismic_load() - Derive total DL by integrating the registered DL + DW load cases (_load_case_resultant_kN) instead of a per-method accumulator - Governing-LL weight from IRC vehicle geometry (unit-fixed N -> kN) - Sa/g fallback from the Cl.218.5.1 spectral curve (soil type + T) - add_seismic_loads() reads KEY_SL_* seismic tab keys and weather_data z_value; runs after create_governing_ll_load_case() in design()
b48cfb4 to
f2f2f98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
## Summary
This PR adds a detailed pytest suite for the plate girder bridge input workflow and a custom pytest reporting helper.
The main test file,
tools/test_plategirderbridge.py, focuses on validating howBridgeInputValidatorandPlateGirderBridgehandle user-provided bridge design inputs. It checks both simple field-level validation and more complex relationships between inputs, so that invalid bridge configurations are caught early and valid boundary cases continue to pass.The supporting file,
tools/conftest.py, adds a custom terminal summary for these tests. Since many of the tests are heavily parameterized, the summary formats each case into readable input/expected-output lines and shows failure reasons in a clearer way.## What
tools/test_plategirderbridge.pyDoesThis file adds automated tests for the plate girder bridge validation layer. It creates reusable valid input fixtures, modifies one field at a time, and checks whether the validator accepts or rejects the input correctly.
It tests the basic input fields used to define the bridge setup, including:
It also tests the additional plate girder design fields used after the basic bridge configuration is selected, including:
## Validation Behavior Covered
The tests are written to cover a wide range of real validation situations, not just a single happy path.
They check that the validator behaves correctly for:
NoneThis gives the validation layer regression coverage across both expected user input and incorrect input shapes.
## Cross-Field Rules Covered
A major part of this test file is focused on rules where one field cannot be validated correctly without looking at another field.
The tests cover cases such as:
These tests help protect the engineering assumptions in the input workflow, where many values are only meaningful when evaluated together.
##
PlateGirderBridgeInput HandlingThe suite also tests behavior on the
PlateGirderBridgeobject itself.It checks that:
set_input()can accept valid basic and additional input dictionariesset_input()repeatedly remains stableThis confirms that the bridge object organizes and exposes input data in a predictable way before later design or analysis stages use it.
## What
tools/conftest.pyDoestools/conftest.pyadds custom pytest reporting specifically for this large parameterized validation suite.It uses pytest hooks to:
The summary includes readable labels for many parameterized tests, such as the tested value, dependent values, and whether the case was expected to be valid or invalid. This makes failures much easier to interpret than raw pytest parameter IDs.
## Why This Is Useful
The plate girder bridge workflow depends on a large number of engineering inputs. Many of these inputs have strict numeric limits, while others depend on related fields like span, overall width, flange width, stud diameter, median selection, or footpath configuration.
This PR makes that behavior explicit and testable.
It helps ensure that:
## Testing
This PR adds:
tools/test_plategirderbridge.pytools/conftest.pytools/test_plategirderbridge.pycontains 104 test functions, many of which are parameterized to cover a much larger number of individual validation cases.****