Skip to content

Conversation

@GerjanDorgelo
Copy link
Contributor

@GerjanDorgelo GerjanDorgelo commented Jan 29, 2026

Description

adds bending moment class 1 2 3 check to feature branch. moved documents to "steel" folder as discussed with Enrique

i have some struggles with the i profile subcheck method. advise is requested.

Fixes #955

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 bending moment strength verification for steel cross-sections per Eurocode 3, supporting both compact and slender cross-section classes.
    • Enables analysis of bending moments about principal axes with automatic resistance calculation and unity checks.
  • Improvements

    • Enhanced type safety for steel profile strength calculations and improved internal type consistency.
  • Tests

    • Added comprehensive test coverage for bending moment strength checks, including edge cases and error scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@GerjanDorgelo GerjanDorgelo self-assigned this Jan 29, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Introduces bending moment strength checks for steel cross-sections per Eurocode 3, supporting both Class 1/2 and Class 3 sections with validation, calculation formulas, and detailed reporting. Integrates these checks into the existing I-profile strength evaluation module and includes comprehensive test coverage.

Changes

Cohort / File(s) Summary
Bending Moment Strength Module
blueprints/checks/eurocode/steel/bending_moment_strength.py
New module implementing two dataclasses: BendingMomentStrengthClass1And2Check and BendingMomentStrengthClass3Check. Each class performs axis-specific bending moment validation, computes resistance via Eurocode formulas (Form 6.13 for Class 1/2, Form 6.14 for Class 3), and generates detailed structural reports.
I-Profile Strength Integration
blueprints/checks/eurocode/steel/i_profile_strength_class_3.py
Updated to import and integrate bending moment strength checks. Enhanced type annotations (profile: Anyprofile: IProfile, source_docs type specification). Expanded all_checks population with concrete bending moment check instances for both axes. Inverted compression/tension strength selection logic and added explicit type casting for improved type safety.
Compression Strength Documentation
blueprints/checks/eurocode/steel/compression_strength.py
Formatting adjustment: indented "Coordinate System:" within class docstring for improved documentation structure. No behavioral changes.
Test Coverage
tests/checks/eurocode/en_1993_1_1_2005/ultimate_limit_states/test_bending_moment_strength.py
New comprehensive test module covering both BendingMomentStrengthClass1And2Check and BendingMomentStrengthClass3Check. Tests verify zero-moment handling, pass/fail scenarios across My/Mz axes, negative moment treatment, invalid axis error handling, and report generation.

Sequence Diagram

sequenceDiagram
    actor User
    participant Check as BendingMomentStrengthCheck<br/>(Class 1/2 or 3)
    participant Props as SectionProperties
    participant Formula as Formulas<br/>(Form 6.13/6.14/6.12)
    participant Result as CheckResult

    User->>Check: create(steel_cross_section, m, axis, gamma_m0)
    Check->>Props: compute or validate section_properties
    Props-->>Check: section_properties (Sxx/Syy, etc.)
    
    User->>Check: calculation_formula()
    Check->>Check: validate axis (My/Mz)
    Check->>Props: extract w (flexural modulus)
    Check->>Formula: Form6Dot13MCRdClass1And2 or<br/>Form6Dot14MCRdClass3<br/>(compute M_c,Rd resistance)
    Formula-->>Check: M_c,Rd
    Check->>Formula: Form6Dot12CheckBendingMoment<br/>(create check object)
    Formula-->>Check: check object
    Check-->>User: formula dict
    
    User->>Check: result()
    Check->>Check: compare |m| vs M_c,Rd
    Check->>Result: create CheckResult<br/>(is_ok, unity_check)
    Result-->>Check: CheckResult
    Check-->>User: CheckResult
    
    User->>Check: report(n=2)
    Check-->>User: Report (profile, moment,<br/>resistance, pass/fail status)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A moment of strength, precisely measured
In steel and formula, our checks treasured
Class one, two, three—no bending shall break,
With Eurocode guidance, safe structures we make!

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Most changes align with the bending moment check feature, but modifications to IProfileStrengthClass3 and compression_strength.py formatting may extend beyond the strict scope of issue #955. Clarify whether integration of bending checks into IProfileStrengthClass3 and formatting changes in compression_strength.py are intended enhancements or should be separated into distinct PRs.
Title check ❓ Inconclusive The title refers to adding a bending moment check feature, which aligns with the PR's main objectives, but uses vague phrasing ('PART 1', 'feature branch') that obscures the specific implementation details. Consider a more descriptive title like 'Add Eurocode 3 bending moment strength checks for Classes 1/2/3' to clearly communicate the primary change without vague terms.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements bending moment strength checks (Class 1/2 and Class 3) with comprehensive tests, directly satisfying issue #955's acceptance criteria for code and tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The PR description follows the template structure and provides most required sections, though it lacks clarity on specific implementation details and mentions unresolved concerns about the I-profile subcheck method.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 955-feature-request-add-bending-moment-class-3-check-to-feature-branch

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

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (630615e) to head (18476b2).
⚠️ Report is 20 commits behind head on 840-feature-request-add-first-steel-check-to-blueprints.

Additional details and impacted files
@@                                     Coverage Diff                                     @@
##           840-feature-request-add-first-steel-check-to-blueprints     #956      +/-   ##
===========================================================================================
- Coverage                                                   100.00%   99.97%   -0.03%     
===========================================================================================
  Files                                                          422      423       +1     
  Lines                                                        13145    13267     +122     
===========================================================================================
+ Hits                                                         13145    13264     +119     
- Misses                                                           0        3       +3     

☔ 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.

@GerjanDorgelo GerjanDorgelo changed the title 955 feature request add bending moment class 3 check to feature branch 955 feature request add bending moment check to feature branch Jan 29, 2026
@GerjanDorgelo GerjanDorgelo marked this pull request as ready for review January 29, 2026 20:09
…And2Check and BendingMomentStrengthClass3Check classes
@egarciamendez
Copy link
Member

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@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: 6

🤖 Fix all issues with AI agents
In `@blueprints/checks/eurocode/steel/bending_moment_strength.py`:
- Around line 181-193: The example references a non-existent class name
BendingMomentStrengthClass123Check; update the import and usage to the correct
class BendingMomentStrengthClass3Check (replace any import statement and
instantiation that mentions BendingMomentStrengthClass123Check with
BendingMomentStrengthClass3Check) so the example imports
BendingMomentStrengthClass3Check and creates calc =
BendingMomentStrengthClass3Check(heb_300_s355, m, axis='My', gamma_m0=1.0)
before calling calc.report().
- Around line 53-61: The example uses a non-existent class and wrong profile
namespace: replace the import of BendingMomentStrengthClass123Check with the
correct check class BendingMomentStrengthClass12Check (or the actual class name
defined in this module if different) and change the HEM profile reference to the
HEB profile (e.g., use HEB.HEB300.with_corrosion(0) instead of
HEM.HEM300.with_corrosion(0)); update the example variable names accordingly
(e.g., heb_300_profile) and ensure imports reference HEB from
blueprints.structural_sections.steel.standard_profiles.heb and the check class
from blueprints.checks.eurocode.steel.bending_moment_strength.
- Line 1: The module docstring incorrectly states "Class 3 only"; update the
top-of-file docstring to accurately describe that the module implements bending
moment resistance checks per Eurocode 3 for Class 1/2 and Class 3 cross-sections
(both classification and strength checks), and mention any relevant functions or
classes (e.g., check_bending_moment_strength, classify_section) so the docstring
reflects the actual capabilities.

In
`@tests/checks/eurocode/en_1993_1_1_2005/ultimate_limit_states/test_bending_moment_strength.py`:
- Around line 24-25: The test is using direct dataclass equality between calc
and calc_without_section_props which is brittle if SectionProperties lacks value
equality; change the assertion to verify that auto-computed section properties
are present and correct instead: after creating calc_without_section_props via
BendingMomentStrengthClass1And2Check(cross_section, 0, axis="My", gamma_m0=1.0)
assert that calc_without_section_props.section_properties is not None (or that a
key numeric property like section_properties.Iyy or section_properties.area
equals the corresponding value on calc within a small tolerance), and update the
analogous assertions around lines 111-112 the same way.
- Around line 10-12: The class TestBendingMomentStrengthClass1And2Check has a
docstring that incorrectly references "BendingMomentStrengthClass3Check"; update
the docstring to accurately describe TestBendingMomentStrengthClass1And2Check
(e.g., "Tests for BendingMomentStrengthClass1And2Check") so the class name and
its docstring match; locate the class definition
TestBendingMomentStrengthClass1And2Check and replace the incorrect string in its
triple-quoted docstring accordingly.
- Line 1: The module docstring is incomplete; replace the placeholder string in
test_bending_moment_strength.py with a clear, complete module-level docstring
stating what the tests cover (e.g., "Tests for bending moment strength according
to Eurocode 3 (EN 1993-1-1:2005)."), and optionally include a short note on the
scope (ultimate limit state checks) and any relevant test assumptions so the
file header clearly documents the purpose of the tests.

Copilot AI review requested due to automatic review settings February 1, 2026 18:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds bending moment strength checking functionality for steel cross-sections according to Eurocode 3, supporting both compact (Class 1/2) and slender (Class 3) cross-section classifications.

Changes:

  • Implements bending moment resistance checks for Class 1/2 and Class 3 steel cross-sections with support for bending about both principal axes (My and Mz)
  • Integrates bending moment checks into the I-profile strength verification workflow with improved type safety
  • Updates test assertions to use pytest.approx for floating-point comparisons instead of direct equality checks

Reviewed changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
blueprints/checks/eurocode/steel/bending_moment_strength.py New module implementing bending moment strength checks for Class 1/2 and Class 3 cross-sections
blueprints/checks/eurocode/steel/i_profile_strength_class_3.py Integrates bending moment checks into subchecks method and improves type annotations
tests/checks/eurocode/steel/test_bending_moment_strength.py Comprehensive test suite for bending moment strength checks covering various scenarios
tests/checks/eurocode/steel/test_tensile_strength.py Updates test assertion to compare unity check values using pytest.approx
tests/checks/eurocode/steel/test_compressive_strength.py Updates test assertion to compare unity check values using pytest.approx
tests/checks/eurocode/en_1992_1_1_2004/nominal_concrete_cover/init.py Removes docstring from empty init file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 2, 2026 18:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@egarciamendez
Copy link
Member

@SZeltaat last 2 weeks I haven't found the time to do a proper review. Will you please lend us an extra couple of 👀 and 🤚⌨️

Copilot AI review requested due to automatic review settings February 7, 2026 08:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 13 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…' into 955-feature-request-add-bending-moment-class-3-check-to-feature-branch
…' into 955-feature-request-add-bending-moment-class-3-check-to-feature-branch
Copilot AI review requested due to automatic review settings February 8, 2026 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 13 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 8, 2026 10:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 14 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SZeltaat
Copy link
Contributor

SZeltaat commented Feb 9, 2026

@SZeltaat last 2 weeks I haven't found the time to do a proper review. Will you please lend us an extra couple of 👀 and 🤚⌨️

@egarciamendez, it's also quite busy here at the moment. I will do a review on wednesday in Bunnik!

…r and utilize internal property calculations for improved consistency and performance.
…sion and tension checks; add unimplemented checks to report and improve report generation logic.
Copilot AI review requested due to automatic review settings February 9, 2026 17:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 16 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

blueprints/utils/report_helpers.py:144

  • The function now supports CheckResult entries in calculations, but the type annotation/docstring still indicate only Optional[CheckProtocol]. Update the annotation (and docstring parameter description) to reflect the accepted value types (e.g., CheckProtocol | CheckResult | None) so callers and type checkers agree with actual behavior.
def add_unity_check_summary(report: Report, calculations: dict[str, Optional["CheckProtocol"]], n: int = 2) -> None:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…s; modify test to reflect behavior for large normal forces.
Copilot AI review requested due to automatic review settings February 9, 2026 19:14
…' into 955-feature-request-add-bending-moment-class-3-check-to-feature-branch
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…-feature-branch' of https://github.com/Blueprints-org/blueprints into 955-feature-request-add-bending-moment-class-3-check-to-feature-branch
… type handling in CheckStrengthIProfileClass3
Copilot AI review requested due to automatic review settings February 9, 2026 19:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…StrengthBendingClass12 to avoid redundant calculations; update ignore_checks options in CheckStrengthIProfileClass3.
…ubchecks and improve output clarity; add main execution block for testing.
Copilot AI review requested due to automatic review settings February 9, 2026 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants