Skip to content

1006 formula request add formulas 6.56 from eurocode 1993 1 1#1007

Open
GerjanDorgelo wants to merge 4 commits into
mainfrom
1006-formula-request-add-formulas-656-from-eurocode-1993-1-1
Open

1006 formula request add formulas 6.56 from eurocode 1993 1 1#1007
GerjanDorgelo wants to merge 4 commits into
mainfrom
1006-formula-request-add-formulas-656-from-eurocode-1993-1-1

Conversation

@GerjanDorgelo
Copy link
Copy Markdown
Contributor

@GerjanDorgelo GerjanDorgelo commented Mar 28, 2026

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Added Eurocode EN 1993-1-1:2005 Formula 6.56 support: non-dimensional slenderness, intermediate factor, and reduction factor calculations for lateral-torsional buckling.
  • Documentation

    • Updated formula tracking to mark Formula 6.56 subcomponents as implemented.
  • Tests

    • Added comprehensive tests covering numeric results, input validation, and LaTeX rendering for Formula 6.56 components.

@GerjanDorgelo GerjanDorgelo self-assigned this Mar 28, 2026
@GerjanDorgelo GerjanDorgelo linked an issue Mar 28, 2026 that may be closed by this pull request
7 tasks
@github-actions
Copy link
Copy Markdown

Thank you so much for contributing to Blueprints!
Your contributions help thousands of engineers work more efficiently and accurately.

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!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa37b3f1-65a9-4016-ab20-69c11ea07591

📥 Commits

Reviewing files that changed from the base of the PR and between 9f9c3c1 and f7b4a02.

📒 Files selected for processing (2)
  • blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.py
  • tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py
  • blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.py

📝 Walkthrough

Walkthrough

Three 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

Cohort / File(s) Summary
Formula Implementation
blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.py
Added three Formula subclasses: Form6Dot56NonDimensionalSlendernessLT, Form6Dot56LateralTorsionalIntermediateFactor, and Form6Dot56ReductionFactorLateralTorsionalBuckling. Each includes input validation, numeric evaluation, clamped/guarded math (discriminant check, max clamp), and latex(n=3) output.
Test Coverage
tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py
Added pytest cases verifying numeric results (with approx), constructor input validation (parametrized invalid inputs raising appropriate errors), and exact LaTeX output strings for all three classes.
Documentation Update
docs/guides/concepts/codes/eurocode/en_1993_1_1_2005/formulas.md
Replaced the single 6.56 entry with three completed sub-entries (6.56 (λ̄_LT), 6.56 (Φ_LT), 6.56 (χ_LT)) mapped to their respective class names.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • egarciamendez

Poem

🐇 I hopped through formulas, nibbling math with glee,
Three little codes for buckling sprouted from me.
Validation neat, LaTeX dressed in song,
Eurocode 6.56 — now steady and strong! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references formula 6.56 from Eurocode 1993-1-1, which is the main change being implemented.
Description check ✅ Passed The description covers all template sections: references issue #1006, specifies new feature with documentation update, and confirms all checklist items completed.
Linked Issues check ✅ Passed All acceptance criteria from issue #1006 are met: formula implementation added [formula_6_56.py], LaTeX expressions included, unit tests provided [test_formula_6_56.py], docstrings implemented, and documentation table updated [formulas.md].
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing formula 6.56 from Eurocode 1993-1-1; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1006-formula-request-add-formulas-656-from-eurocode-1993-1-1

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (41b0b53) to head (f7b4a02).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 cap.

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_lt case 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

📥 Commits

Reviewing files that changed from the base of the PR and between 41b0b53 and 9f9c3c1.

📒 Files selected for processing (3)
  • blueprints/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/formula_6_56.py
  • docs/guides/concepts/codes/eurocode/en_1993_1_1_2005/formulas.md
  • tests/codes/eurocode/en_1993_1_1_2005/chapter_6_ultimate_limit_state/test_formula_6_56.py

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.

[🔧 Formula Request]: Add formulas 6.56 from Eurocode 1993-1-1

1 participant