Skip to content

Fix EN14960 wall height calculation and update related tests in SafetyStandardsController#213

Merged
stefan-burke merged 4 commits intomainfrom
terragon/fix-en14960-calc-wall-height
Aug 18, 2025
Merged

Fix EN14960 wall height calculation and update related tests in SafetyStandardsController#213
stefan-burke merged 4 commits intomainfrom
terragon/fix-en14960-calc-wall-height

Conversation

@stefan-burke
Copy link
Copy Markdown
Member

@stefan-burke stefan-burke commented Aug 17, 2025

Summary

  • Removes workaround for EN14960 v0.4.0 bug in build_wall_height_result method
  • Simplifies wall height calculation by directly calling EN14960.calculate_wall_height
  • Updates en14960 gem version from 0.4.0 to 0.4.2
  • Adjusts test helper to expect updated text "No containing walls required" instead of previous messages

Changes

SafetyStandardsController

  • Deleted error handling for TypeError caused by EN14960 returning Integer 0 instead of Float 0.0
  • Cleaned up build_wall_height_result method to directly return the result of EN14960.calculate_wall_height

Test Helpers

  • Modified expectation text for no walls required scenario to "No containing walls required"

Dependencies

  • Updated en14960 gem from version 0.4.0 to 0.4.2

Test plan

  • Verify that wall height calculations behave correctly without the previous workaround
  • Ensure no regressions occur in safety standard calculations related to wall height
  • Confirm updated test helper expectations match new output text
  • Run existing automated tests for safety standards to confirm stability

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/5aad34d6-9e74-4436-9cd6-2f05ca0f59e0

stefan-burke and others added 4 commits August 17, 2025 13:32
…ving workaround code

Removed the workaround for EN14960 v0.4.0 bug in build_wall_height_result method. The method now directly calls EN14960.calculate_wall_height without rescue block, simplifying the code and improving maintainability.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
… of Float 0.0

Workaround for EN14960 v0.4.0 bug where it returns Integer 0 instead of Float 0.0 when platform_height < 0.6. Added rescue for TypeError to return expected CalculatorResponse for no walls required scenario.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
…pdate tests

The workaround for the EN14960 v0.4.0 bug in build_wall_height_result was removed as the library was updated to v0.4.2 which fixes the issue. Corresponding test expectations were updated to reflect the new message text for no walls required.

Also updated Gemfile.lock to use en14960 v0.4.2.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@stefan-burke stefan-burke changed the title Fix EN14960 wall height calculation workaround in SafetyStandardsController Fix EN14960 wall height calculation and update related tests in SafetyStandardsController Aug 18, 2025
@stefan-burke stefan-burke marked this pull request as ready for review August 18, 2025 00:18
@stefan-burke stefan-burke merged commit 0096efe into main Aug 18, 2025
16 of 17 checks passed
@stefan-burke stefan-burke deleted the terragon/fix-en14960-calc-wall-height branch October 12, 2025 22:51
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.

1 participant