1006 formula request add formulas 6.56 from eurocode 1993 1 1#1007
1006 formula request add formulas 6.56 from eurocode 1993 1 1#1007GerjanDorgelo wants to merge 4 commits into
Conversation
…n and error handling
…calculations from EN 1993-1-1:2005
|
Thank you so much for contributing to Blueprints! Now that you've created your pull request, please don't go away; take a look at the bottom of this page for the automated checks that should already be running. If they pass, great! If not, please click on 'Details' and see if you can fix the problem they've identified. A maintainer should be along shortly to review your pull request and help get it added! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThree new Formula subclasses implementing Eurocode EN 1993-1-1:2005 formula 6.56 components for lateral-torsional buckling were added, plus corresponding unit tests and a documentation update tracking the three sub-formulas. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1007 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 453 454 +1
Lines 14028 14089 +61
=========================================
+ Hits 14028 14089 +61 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py (1)
148-160: Add a positive-path test for the\chi_{LT} <= 1.0cap.Lines 148-160 only verify an uncapped result, so the
min(1.0, chi_lt)branch can regress unnoticed. A valid low-phi_lt/ zero-lambda_bar_ltcase would lock in the Eurocode upper bound.🧪 Proposed test
class TestForm6Dot56ReductionFactorLateralTorsionalBuckling: """Validation for formula 6.56 from EN 1993-1-1:2005.""" @@ def test_evaluation(self) -> None: """Tests the evaluation of the result.""" # Example values phi_lt = 0.922 lambda_bar_lt = 0.8 @@ assert formula == pytest.approx(expected=manually_calculated_result, rel=1e-4) + + def test_evaluation_is_capped_at_one(self) -> None: + """Tests that the reduction factor is capped at 1.0.""" + formula = Form6Dot56ReductionFactorLateralTorsionalBuckling(phi_lt=0.424, lambda_bar_lt=0.0) + + assert formula == pytest.approx(expected=1.0)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py` around lines 148 - 160, Add a positive-path unit test that verifies the cap min(1.0, chi_lt) is applied: create a new test (e.g. test_chi_lt_capped_to_one) that instantiates Form6Dot56ReductionFactorLateralTorsionalBuckling with parameters that force chi_lt > 1 (for example a low phi_lt and lambda_bar_lt = 0) and assert the returned value equals pytest.approx(1.0, rel=1e-6); reference the Form6Dot56ReductionFactorLateralTorsionalBuckling class and the existing test pattern in test_formula_6_56.py to match style and assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.py`:
- Around line 177-181: Add an explicit relational guard that rejects inputs
where phi_lt < lambda_bar_lt before computing chi_lt: in the function that
currently calls raise_if_negative(lambda_bar_lt=lambda_bar_lt) and
raise_if_less_or_equal_to_zero(phi_lt=phi_lt), add a check comparing phi_lt and
lambda_bar_lt and raise a ValueError (or domain-specific exception) with a clear
message if phi_lt < lambda_bar_lt; this prevents taking sqrt(phi_lt**2 -
lambda_bar_lt**2) of a negative number. Update tests by adding a regression test
that calls the same function (formula_6_56) with phi_lt < lambda_bar_lt and
asserts that the error is raised.
---
Nitpick comments:
In
`@tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py`:
- Around line 148-160: Add a positive-path unit test that verifies the cap
min(1.0, chi_lt) is applied: create a new test (e.g. test_chi_lt_capped_to_one)
that instantiates Form6Dot56ReductionFactorLateralTorsionalBuckling with
parameters that force chi_lt > 1 (for example a low phi_lt and lambda_bar_lt =
0) and assert the returned value equals pytest.approx(1.0, rel=1e-6); reference
the Form6Dot56ReductionFactorLateralTorsionalBuckling class and the existing
test pattern in test_formula_6_56.py to match style and assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2781faef-1ab4-49e0-b907-00e22faece4d
📒 Files selected for processing (3)
blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.pydocs/guides/concepts/codes/eurocode/en_1993_1_1_2005/formulas.mdtests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py
…ionalBuckling to handle negative values
Description
add formulas 6.56 from eurocode 1993-1-1 and its subformula
Fixes #1006
Type of change
Please delete options that are not relevant.
Checklist:
Summary by CodeRabbit
New Features
Documentation
Tests