927 copying steel equations from 2005 to 2025, for those that are the same, batch 1#928
927 copying steel equations from 2005 to 2025, for those that are the same, batch 1#928GerjanDorgelo wants to merge 84 commits intomainfrom
Conversation
…r holes in EN 1993-1-1:2025
…n in EN 1993-1-1:2025
…n in EN 1993-1-1:2025
… EN 1993-1-1:2025
…7, 8.19, 8.22, and 8.23 to follow naming convention
… EN 1993-1-1:2025
…calculation in EN 1993-1-1:2025
…n in EN 1993-1-1:2025
… sections according to EN 1993-1-1:2025
…ance in structural hollow sections according to EN 1993-1-1:2025
…rding to NEN-EN 1993-1-1+A1:2016
…ccording to EN 1993-1-1:2025
…ithout torsion according to EN 1993-1-1:2025
…rectangular solid sections according to EN 1993-1-1:2025
…cording to EN 1993-1-1:2025
…cording to EN 1993-1-1:2025
…cording to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…according to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…g to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…g to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
…to EN 1993-1-1:2025
… and 8.37 validation
…parameter naming conventions
|
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! |
📝 WalkthroughWalkthroughAdds three new Eurocode EN 1993-1-1:2025 Chapter 8 formula implementations (Formulas 8.3, 8.5, 8.7) with input validation, calculation logic, and LaTeX formatting support, accompanied by comprehensive test suites covering evaluation, error handling, and output formatting. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 #928 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 414 418 +4
Lines 12715 12792 +77
=========================================
+ Hits 12715 12792 +77 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In
@blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.py:
- Around line 73-79: The latex() implementation assumes self.s[0] and
self.p_2[0] exist and will IndexError if s or p_2 are empty; add a guard in
_evaluate() to validate that self.s and self.p_2 are non-empty sequences (raise
a clear ValueError with context) and/or update latex() to handle the empty case
explicitly (e.g., produce a fallback numeric expression or omit the sum) so
accessing self.s[0] and self.p_2[0] is safe; reference the latex() method and
the _evaluate() validator when making the change.
In
@blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.py:
- Around line 30-38: The docstring in formula_8_7.py for parameters n_ed and e_n
contains a LaTeX typo: replace the incorrect `[$A_{eff$]` with the correctly
closed `[$A_{eff}$]` in the descriptive text for e_n so the LaTeX bracket is
closed properly in the docstring near the Parameters block.
In
@tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.py:
- Line 1: The module docstring incorrectly references "Chapter 6" — update the
docstring in the module (the top-level string in __init__.py for the
chapter_8_ultimate_limit_state package) to say "Chapter 8 - Ultimate limit
state" (or otherwise replace "Chapter 6" with "Chapter 8") so it accurately
reflects EN_1993_1_1_2025: Chapter 8 content.
In
@tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.py:
- Around line 44-45: The comment on the second test tuple is wrong — it says "p2
has a zero value" but the tuple (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0,
10.0]) actually demonstrates mismatched list lengths between s and p_2; update
the comment to reflect "mismatched list lengths (s has 2 elements, p_2 has 3
elements)" and ensure any nearby comment for the first tuple correctly describes
that p2 contains a zero value if intended.
🧹 Nitpick comments (3)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.py (1)
1-1: Consider aligning the document reference format.The docstring uses
1993-1-1+C2+A1:2025while the parent package constant usesEN 1993-1-1:2025. For consistency, consider using the same format (either add the full corrigenda/amendment notation to the constant, or simplify this docstring to match).Suggested fix for consistency
-"""Module containing all formulas from 1993-1-1+C2+A1:2025: Chapter 8 - Ultimate limit state.""" +"""Module containing all formulas from EN 1993-1-1:2025: Chapter 8 - Ultimate limit state."""tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_3.py (1)
36-39: Minor docstring inconsistency.The docstring mentions only
n_edbut the test actually covers negative values forn_ed,m_y_ed, andm_z_ed.Suggested fix
def test_raise_error_if_negative(self, n_ed: float, n_rd: float, m_y_ed: float, m_y_rd: float, m_z_ed: float, m_z_rd: float) -> None: - """Test that a NegativeValueError is raised when a negative value is passed for n_ed.""" + """Test that a NegativeValueError is raised when a negative value is passed for n_ed, m_y_ed, or m_z_ed.""" with pytest.raises(NegativeValueError): Form8Dot3UtilizationRatio(n_ed=n_ed, n_rd=n_rd, m_y_ed=m_y_ed, m_y_rd=m_y_rd, m_z_ed=m_z_ed, m_z_rd=m_z_rd)blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.py (1)
61-66: Redundant validation calls.
raise_if_less_or_equal_to_zeroalready covers negative values (since negative < 0), makingraise_if_negativeredundant.Suggested simplification
@staticmethod def _evaluate( t: MM, n_1: MM, d_0: MM, s: Sequence[MM], p_2: Sequence[MM], ) -> MM: """Evaluates the formula, for more information see the __init__ method.""" - raise_if_negative(t=t, n_1=n_1, d_0=d_0) raise_if_less_or_equal_to_zero(t=t, n_1=n_1, d_0=d_0) raise_if_lists_differ_in_length(s=s, p_2=p_2) for s_i, p_2_i in zip(s, p_2): - raise_if_negative(s=s_i, p_2=p_2_i) raise_if_less_or_equal_to_zero(s=s_i, p_2=p_2_i) return t * (n_1 * d_0 - sum((s_i**2) / (4 * p_2_i) for s_i, p_2_i in zip(s, p_2)))
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
blueprints/codes/eurocode/en_1993_1_1_2025/__init__.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_3.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.pytests/codes/eurocode/en_1993_1_1_2025/__init__.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_3.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_7.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-07T10:56:37.917Z
Learnt from: SZeltaat
Repo: Blueprints-org/blueprints PR: 909
File: blueprints/structural_sections/_polygon_builder.py:164-164
Timestamp: 2026-01-07T10:56:37.917Z
Learning: When reviewing Python files that use the Ty type checker, treat comments like '# ty:ignore[unsupported-operator]' as valid Ty directives, not typos or mistakes of '# type: ignore'. Do not flag them as errors. Ensure reviewers differentiate Ty's ignore syntax from MyPy's and that the directive suppresses only the intended error.
Applied to files:
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.pyblueprints/codes/eurocode/en_1993_1_1_2025/__init__.pytests/codes/eurocode/en_1993_1_1_2025/__init__.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.pyblueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_3.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_3.pytests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_7.py
🧬 Code graph analysis (6)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.py (3)
blueprints/codes/formula.py (2)
Formula(11-108)label(42-52)blueprints/codes/latex_formula.py (2)
LatexFormula(7-85)latex_replace_symbols(162-218)blueprints/validations.py (1)
raise_if_negative(76-92)
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.py (3)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.py (1)
Form8Dot5MinDeductionAreaStaggeredFastenerHoles(12-87)blueprints/validations.py (3)
LessOrEqualToZeroError(6-11)ListsNotSameLengthError(46-54)NegativeValueError(22-27)blueprints/codes/latex_formula.py (2)
complete(40-51)short(71-81)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.py (3)
blueprints/codes/formula.py (2)
Formula(11-108)label(42-52)blueprints/codes/latex_formula.py (1)
LatexFormula(7-85)blueprints/validations.py (3)
raise_if_less_or_equal_to_zero(57-73)raise_if_lists_differ_in_length(131-153)raise_if_negative(76-92)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_3.py (3)
blueprints/codes/formula.py (2)
Formula(11-108)label(42-52)blueprints/codes/latex_formula.py (1)
LatexFormula(7-85)blueprints/validations.py (2)
raise_if_less_or_equal_to_zero(57-73)raise_if_negative(76-92)
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_3.py (3)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_3.py (1)
Form8Dot3UtilizationRatio(11-78)blueprints/validations.py (2)
LessOrEqualToZeroError(6-11)NegativeValueError(22-27)blueprints/codes/latex_formula.py (2)
complete(40-51)short(71-81)
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_7.py (2)
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.py (1)
Form8Dot7AdditionalMoment(10-71)blueprints/validations.py (1)
NegativeValueError(22-27)
🔇 Additional comments (10)
tests/codes/eurocode/en_1993_1_1_2025/__init__.py (1)
1-1: LGTM!Simple and accurate docstring for the test package.
blueprints/codes/eurocode/en_1993_1_1_2025/__init__.py (1)
1-3: LGTM!Clean package initializer with the standard constant for referencing the source document.
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.py (4)
1-7: LGTM!Imports are appropriate and well-organized for the formula implementation.
10-14: LGTM!Class metadata follows project conventions with appropriate label and source document reference.
43-51: LGTM!Input validation and formula evaluation are correctly implemented. The non-negativity check is appropriate for axial compression force and centroid shift.
53-71: LGTM!The LaTeX representation is well-implemented with correct symbols, numeric substitution, and units.
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_7.py (1)
1-62: LGTM!The test module is well-structured with comprehensive coverage:
- Evaluation test correctly validates the formula result (N_Ed × e_N = 1000 × 50 = 50000 Nmm)
- Negative value tests cover both parameters appropriately
- LaTeX representation tests verify both complete and short forms
blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_3.py (1)
1-78: LGTM!The implementation is correct and well-documented:
- Utilization ratio formula UC = N_Ed/N_Rd + M_y,Ed/M_y,Rd + M_z,Ed/M_z,Rd is correctly implemented
- Validation appropriately requires denominators > 0 and numerators ≥ 0
- LaTeX representation correctly omits unit (dimensionless ratio)
- Follows project conventions for Formula subclasses
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_3.py (1)
57-88: LGTM!The LaTeX representation tests are well-structured, using consistent input values and verifying both complete and short forms correctly.
tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.py (1)
53-82: LGTM!The LaTeX representation tests are comprehensive, verifying both complete (with full equation expansion) and short forms with correct unit (
mm^2).
| _numeric_equation: str = ( | ||
| rf"{self.t:.{n}f} \left( {self.n_1:.{n}f} \cdot {self.d_0:.{n}f} - \left( \frac{{{self.s[0]:.{n}f}^2}}" | ||
| rf"{{4 \cdot {self.p_2[0]:.{n}f}}}" | ||
| ) | ||
| for s_i, p_2_i in zip(self.s[1:], self.p_2[1:]): | ||
| _numeric_equation += rf" + \frac{{{s_i:.{n}f}^2}}{{4 \cdot {p_2_i:.{n}f}}}" | ||
| _numeric_equation += r" \right) \right)" |
There was a problem hiding this comment.
Potential IndexError with empty sequences.
latex() assumes s and p_2 have at least one element by accessing self.s[0] and self.p_2[0]. If empty sequences are passed (which _evaluate currently allows), this will raise an IndexError.
Consider either:
- Adding validation in
_evaluateto require non-empty sequences, or - Handling the empty case in
latex()
Option 1: Add validation in _evaluate
raise_if_lists_differ_in_length(s=s, p_2=p_2)
+ if len(s) == 0:
+ raise ValueError("s and p_2 must contain at least one element")
for s_i, p_2_i in zip(s, p_2):🤖 Prompt for AI Agents
In
@blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_5.py
around lines 73 - 79, The latex() implementation assumes self.s[0] and
self.p_2[0] exist and will IndexError if s or p_2 are empty; add a guard in
_evaluate() to validate that self.s and self.p_2 are non-empty sequences (raise
a clear ValueError with context) and/or update latex() to handle the empty case
explicitly (e.g., produce a fallback numeric expression or omit the sum) so
accessing self.s[0] and self.p_2[0] is safe; reference the latex() method and
the _evaluate() validator when making the change.
| Parameters | ||
| ---------- | ||
| n_ed : N | ||
| [$N_{Ed}$] Axial compression force [$N$]. | ||
| e_n : MM | ||
| [$e_{N}$] Shift of the centroid of the effective area relative to the centre of gravity of the gross cross section [$mm$]. | ||
| The method given in EN 1993-1-5 should be used to determine the possible shift [$e_{N}$] of the centroid of the effective | ||
| area [$A_{eff$] relative to the centre of gravity of the gross cross section. | ||
| """ |
There was a problem hiding this comment.
Fix LaTeX typo in docstring.
Line 37 has an unclosed LaTeX bracket: [$A_{eff$] should be [$A_{eff}$].
Suggested fix
- area [$A_{eff$] relative to the centre of gravity of the gross cross section.
+ area [$A_{eff}$] relative to the centre of gravity of the gross cross section.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Parameters | |
| ---------- | |
| n_ed : N | |
| [$N_{Ed}$] Axial compression force [$N$]. | |
| e_n : MM | |
| [$e_{N}$] Shift of the centroid of the effective area relative to the centre of gravity of the gross cross section [$mm$]. | |
| The method given in EN 1993-1-5 should be used to determine the possible shift [$e_{N}$] of the centroid of the effective | |
| area [$A_{eff$] relative to the centre of gravity of the gross cross section. | |
| """ | |
| Parameters | |
| ---------- | |
| n_ed : N | |
| [$N_{Ed}$] Axial compression force [$N$]. | |
| e_n : MM | |
| [$e_{N}$] Shift of the centroid of the effective area relative to the centre of gravity of the gross cross section [$mm$]. | |
| The method given in EN 1993-1-5 should be used to determine the possible shift [$e_{N}$] of the centroid of the effective | |
| area [$A_{eff}$] relative to the centre of gravity of the gross cross section. | |
| """ |
🤖 Prompt for AI Agents
In
@blueprints/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/formula_8_7.py
around lines 30 - 38, The docstring in formula_8_7.py for parameters n_ed and
e_n contains a LaTeX typo: replace the incorrect `[$A_{eff$]` with the correctly
closed `[$A_{eff}$]` in the descriptive text for e_n so the LaTeX bracket is
closed properly in the docstring near the Parameters block.
| @@ -0,0 +1 @@ | |||
| """Module containing all formulas from EN_1993_1_1_2025: Chapter 6 - Ultimate limit state.""" | |||
There was a problem hiding this comment.
Fix incorrect chapter reference in docstring.
The docstring says "Chapter 6" but this package is for Chapter 8 (as indicated by the directory name chapter_8_ultimate_limit_state). In EN 1993-1-1:2025, the Ultimate Limit State content is in Chapter 8.
Suggested fix
-"""Module containing all formulas from EN_1993_1_1_2025: Chapter 6 - Ultimate limit state."""
+"""Module containing all formulas from EN_1993_1_1_2025: Chapter 8 - Ultimate limit state."""📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| """Module containing all formulas from EN_1993_1_1_2025: Chapter 6 - Ultimate limit state.""" | |
| """Module containing all formulas from EN_1993_1_1_2025: Chapter 8 - Ultimate limit state.""" |
🤖 Prompt for AI Agents
In
@tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/__init__.py
at line 1, The module docstring incorrectly references "Chapter 6" — update the
docstring in the module (the top-level string in __init__.py for the
chapter_8_ultimate_limit_state package) to say "Chapter 8 - Ultimate limit
state" (or otherwise replace "Chapter 6" with "Chapter 8") so it accurately
reflects EN_1993_1_1_2025: Chapter 8 content.
| (10.0, 5.0, 20.0, [50.0, 60.0], [0.0, 120.0]), # p2 has a zero value | ||
| (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0, 10.0]), # p2 has a zero value |
There was a problem hiding this comment.
Incorrect comment.
Line 45's comment says "p2 has a zero value" but the test case actually validates mismatched list lengths (s has 2 elements, p_2 has 3 elements).
Suggested fix
(10.0, 5.0, 20.0, [50.0, 60.0], [0.0, 120.0]), # p2 has a zero value
- (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0, 10.0]), # p2 has a zero value
+ (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0, 10.0]), # s and p2 have different lengths📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| (10.0, 5.0, 20.0, [50.0, 60.0], [0.0, 120.0]), # p2 has a zero value | |
| (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0, 10.0]), # p2 has a zero value | |
| (10.0, 5.0, 20.0, [50.0, 60.0], [0.0, 120.0]), # p2 has a zero value | |
| (10.0, 5.0, 20.0, [50.0, 60.0], [100.0, 120.0, 10.0]), # s and p2 have different lengths |
🤖 Prompt for AI Agents
In
@tests/codes/eurocode/en_1993_1_1_2025/chapter_8_ultimate_limit_state/test_formula_8_5.py
around lines 44 - 45, The comment on the second test tuple is wrong — it says
"p2 has a zero value" but the tuple (10.0, 5.0, 20.0, [50.0, 60.0], [100.0,
120.0, 10.0]) actually demonstrates mismatched list lengths between s and p_2;
update the comment to reflect "mismatched list lengths (s has 2 elements, p_2
has 3 elements)" and ensure any nearby comment for the first tuple correctly
describes that p2 contains a zero value if intended.
Description
Type of change
Please delete options that are not relevant.
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.