From a243092f037a4cdd07335153b3195fe4eb635887 Mon Sep 17 00:00:00 2001 From: smillmorel Date: Tue, 8 Sep 2026 02:43:23 -0400 Subject: [PATCH] fix: bump export solver pin to 3.8.0.0, narrow PathTimeSeries in examples --- examples/ex1a_canti2d.py | 1 + examples/ex1a_canti2d_eq.py | 1 + examples/ex1b_portal2d.py | 1 + examples/ex2a_canti2d_elastic_element.py | 1 + examples/ex2b_canti2d_inelastic_section.py | 1 + examples/ex2c_canti2d_inelastic_fiber_section.py | 1 + src/otko/services/export.py | 4 ++-- tests/unit/test_export.py | 6 +++--- 8 files changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/ex1a_canti2d.py b/examples/ex1a_canti2d.py index 667af78..645fefc 100644 --- a/examples/ex1a_canti2d.py +++ b/examples/ex1a_canti2d.py @@ -222,6 +222,7 @@ def main() -> None: project = build_ex1a_canti2d() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 3) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}") print(f" Ground motion file: {GROUND_MOTION_FILE.name}") diff --git a/examples/ex1a_canti2d_eq.py b/examples/ex1a_canti2d_eq.py index f809437..4e616d5 100644 --- a/examples/ex1a_canti2d_eq.py +++ b/examples/ex1a_canti2d_eq.py @@ -190,6 +190,7 @@ def main() -> None: project = build_ex1a_canti2d_eq() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 2) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print(f" Ground motion file: {GROUND_MOTION_FILE.name}") print(f" Reference Tcl: {REFERENCE_TCL.name}") diff --git a/examples/ex1b_portal2d.py b/examples/ex1b_portal2d.py index 12d6589..c8e80e3 100644 --- a/examples/ex1b_portal2d.py +++ b/examples/ex1b_portal2d.py @@ -209,6 +209,7 @@ def main() -> None: project = build_ex1b_portal2d() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 3) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}") print(f" Ground motion file: {GROUND_MOTION_FILE.name}") diff --git a/examples/ex2a_canti2d_elastic_element.py b/examples/ex2a_canti2d_elastic_element.py index 24a1708..f39f791 100644 --- a/examples/ex2a_canti2d_elastic_element.py +++ b/examples/ex2a_canti2d_elastic_element.py @@ -231,6 +231,7 @@ def main() -> None: project = build_ex2a_canti2d_elastic_element() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 3) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print(f" LCol={L_COL}, Weight={WEIGHT}, ACol={A_COL:.1f}, Ec={E_C:.3f}") print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}") diff --git a/examples/ex2b_canti2d_inelastic_section.py b/examples/ex2b_canti2d_inelastic_section.py index 0a00eaa..d8444b1 100644 --- a/examples/ex2b_canti2d_inelastic_section.py +++ b/examples/ex2b_canti2d_inelastic_section.py @@ -253,6 +253,7 @@ def main() -> None: project = build_ex2b_canti2d_inelastic_section() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 400) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print( f" LCol={L_COL}, EA={EA_COL:.1f}, My={MY_COL:.1f}, " diff --git a/examples/ex2c_canti2d_inelastic_fiber_section.py b/examples/ex2c_canti2d_inelastic_fiber_section.py index 3a3ec53..0f64fec 100644 --- a/examples/ex2c_canti2d_inelastic_fiber_section.py +++ b/examples/ex2c_canti2d_inelastic_fiber_section.py @@ -301,6 +301,7 @@ def main() -> None: project = build_ex2c_canti2d_inelastic_fiber_section() project.validate_references() gm = next(ts for ts in project.time_series if ts.id == 400) + assert isinstance(gm, PathTimeSeries) print(f"Built '{project.meta.name}'") print( f" LCol={L_COL}, ACol={A_COL:.1f}, Iz={IZ_COL:.1f}, " diff --git a/src/otko/services/export.py b/src/otko/services/export.py index f3ca54d..1ae5710 100644 --- a/src/otko/services/export.py +++ b/src/otko/services/export.py @@ -49,7 +49,7 @@ from otko.services.opensees_runner import OpenSeesRunner __all__ = ["RecordingOps", "export_opspy", "export_tcl"] #: Pinned solver version written into every script header. -PINNED_OPENSEESPY = "openseespy==3.5.1.12" +PINNED_OPENSEESPY = "openseespy==3.8.0.0" #: Recorded call triple: (ops method name, positional args, keyword args). RecordedCall = tuple[str, tuple[Any, ...], dict[str, Any]] @@ -362,7 +362,7 @@ def export_opspy(project: Project, case_id: int | None = None) -> str: are appended after the model. Returns: - The script source. The header pins ``openseespy==3.5.1.12``, + The script source. The header pins ``openseespy==3.8.0.0``, the OTKO version and the display units. Raises: diff --git a/tests/unit/test_export.py b/tests/unit/test_export.py index ae64063..98c23ec 100644 --- a/tests/unit/test_export.py +++ b/tests/unit/test_export.py @@ -109,14 +109,14 @@ def _path_series_project() -> Project: class TestHeader: def test_opspy_header_pins_solver_version_and_units(self) -> None: script = export_opspy(_truss_2d()) - assert PINNED_OPENSEESPY == "openseespy==3.5.1.12" - assert "openseespy==3.5.1.12" in script + assert PINNED_OPENSEESPY == "openseespy==3.8.0.0" + assert "openseespy==3.8.0.0" in script assert __version__ in script assert _truss_2d().meta.units.value in script def test_tcl_header_pins_solver_version_and_units(self) -> None: script = export_tcl(_truss_2d()) - assert "openseespy==3.5.1.12" in script + assert "openseespy==3.8.0.0" in script assert __version__ in script