Closed weibullguy closed 1 month ago
This pull request refactors the stress ratio calculations to improve error handling and input validation. The changes focus on enhancing the robustness of the calculate_stress_ratio
function by introducing proper input validation, improving error handling, and expanding the test coverage to include edge cases.
No diagrams generated as the changes look simple and do not need a visual representation.
Change | Details | Files |
---|---|---|
Refactored calculate_stress_ratio function for improved input validation and error handling |
|
src/ramstk/analyses/stress.py |
Extended unit tests for stress ratio calculations |
|
tests/analyses/test_stress.py |
Updated copyright information and file headers |
|
src/ramstk/analyses/stress.py tests/analyses/test_stress.py |
Improved pull request template |
|
.github/PULL_REQUEST_TEMPLATE.md |
Does this PR introduce a breaking change?
Purpose of this pull request
This pull request refactors the calculate_stress_ratio function to improve error handling and input validation. Specifically, it introduces validation to ensure that neither the operating nor the rated stress values are negative. Additionally, a new set of unit tests has been added to cover edge cases, including handling of zero and negative input values, as well as testing invalid data types.
Benefits of the pull request
Any particular area(s) reviewers should focus on
Any other pertinent information.
Pull Request Checklist
Code Style
Static Checks
Tests
Chores
Summary by Sourcery
Refactor the calculate_stress_ratio function to enhance error handling and input validation, ensuring robustness against negative and zero values. Introduce comprehensive unit tests to cover edge cases and validate the new logic.
Enhancements:
Tests:
Chores: