From 515bc61a2312fbbd8db65252ff900ec7b47a747e Mon Sep 17 00:00:00 2001 From: James C Koch Date: Thu, 4 Dec 2025 17:37:36 +0100 Subject: [PATCH 1/2] Add phi check for section properties validation To avoid a RuntimeError that a argument of type "float | None" cannot be assigned to parameter "phi" of type "float" in function fea.principal_coordinate" (line 318) --- src/sectionproperties/analysis/section.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sectionproperties/analysis/section.py b/src/sectionproperties/analysis/section.py index 1ce58e53..5cfeb5fb 100644 --- a/src/sectionproperties/analysis/section.py +++ b/src/sectionproperties/analysis/section.py @@ -299,7 +299,7 @@ def calculate_geom(progress: Progress | None = None) -> None: i11 = self.section_props.i11_c i22 = self.section_props.i22_c - if ixx is None or iyy is None or ixy is None or i11 is None or i22 is None: + if ixx is None or iyy is None or ixy is None or i11 is None or i22 is None or phi is None: msg = "Section properties failed to save." raise RuntimeError(msg) From dd2478d453df6d68411d540bec251173ae3e95b9 Mon Sep 17 00:00:00 2001 From: James C Koch Date: Thu, 4 Dec 2025 17:44:20 +0100 Subject: [PATCH 2/2] Refactor condition for section properties validation --- src/sectionproperties/analysis/section.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sectionproperties/analysis/section.py b/src/sectionproperties/analysis/section.py index 5cfeb5fb..67340d99 100644 --- a/src/sectionproperties/analysis/section.py +++ b/src/sectionproperties/analysis/section.py @@ -299,7 +299,14 @@ def calculate_geom(progress: Progress | None = None) -> None: i11 = self.section_props.i11_c i22 = self.section_props.i22_c - if ixx is None or iyy is None or ixy is None or i11 is None or i22 is None or phi is None: + if ( + ixx is None + or iyy is None + or ixy is None + or i11 is None + or i22 is None + or phi is None + ): msg = "Section properties failed to save." raise RuntimeError(msg)