Merge pull request 'fix: bump export solver pin to 3.8.0.0, narrow PathTimeSeries in examples' (#2) from fix/export-pinned-version-and-ex1b-series into main
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Reviewed-on: #2
This commit is contained in:
commit
9df51ee1a1
8 changed files with 11 additions and 5 deletions
|
|
@ -222,6 +222,7 @@ def main() -> None:
|
||||||
project = build_ex1a_canti2d()
|
project = build_ex1a_canti2d()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 3)
|
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"Built '{project.meta.name}'")
|
||||||
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
||||||
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,7 @@ def main() -> None:
|
||||||
project = build_ex1a_canti2d_eq()
|
project = build_ex1a_canti2d_eq()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 2)
|
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"Built '{project.meta.name}'")
|
||||||
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
||||||
print(f" Reference Tcl: {REFERENCE_TCL.name}")
|
print(f" Reference Tcl: {REFERENCE_TCL.name}")
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,7 @@ def main() -> None:
|
||||||
project = build_ex1b_portal2d()
|
project = build_ex1b_portal2d()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 3)
|
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"Built '{project.meta.name}'")
|
||||||
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
||||||
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
print(f" Ground motion file: {GROUND_MOTION_FILE.name}")
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,7 @@ def main() -> None:
|
||||||
project = build_ex2a_canti2d_elastic_element()
|
project = build_ex2a_canti2d_elastic_element()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 3)
|
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"Built '{project.meta.name}'")
|
||||||
print(f" LCol={L_COL}, Weight={WEIGHT}, ACol={A_COL:.1f}, Ec={E_C:.3f}")
|
print(f" LCol={L_COL}, Weight={WEIGHT}, ACol={A_COL:.1f}, Ec={E_C:.3f}")
|
||||||
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
print(f" Gravity + pushover + earthquake cases: {len(project.analyses)}")
|
||||||
|
|
|
||||||
|
|
@ -253,6 +253,7 @@ def main() -> None:
|
||||||
project = build_ex2b_canti2d_inelastic_section()
|
project = build_ex2b_canti2d_inelastic_section()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 400)
|
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"Built '{project.meta.name}'")
|
||||||
print(
|
print(
|
||||||
f" LCol={L_COL}, EA={EA_COL:.1f}, My={MY_COL:.1f}, "
|
f" LCol={L_COL}, EA={EA_COL:.1f}, My={MY_COL:.1f}, "
|
||||||
|
|
|
||||||
|
|
@ -301,6 +301,7 @@ def main() -> None:
|
||||||
project = build_ex2c_canti2d_inelastic_fiber_section()
|
project = build_ex2c_canti2d_inelastic_fiber_section()
|
||||||
project.validate_references()
|
project.validate_references()
|
||||||
gm = next(ts for ts in project.time_series if ts.id == 400)
|
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"Built '{project.meta.name}'")
|
||||||
print(
|
print(
|
||||||
f" LCol={L_COL}, ACol={A_COL:.1f}, Iz={IZ_COL:.1f}, "
|
f" LCol={L_COL}, ACol={A_COL:.1f}, Iz={IZ_COL:.1f}, "
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ from otko.services.opensees_runner import OpenSeesRunner
|
||||||
__all__ = ["RecordingOps", "export_opspy", "export_tcl"]
|
__all__ = ["RecordingOps", "export_opspy", "export_tcl"]
|
||||||
|
|
||||||
#: Pinned solver version written into every script header.
|
#: 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).
|
#: Recorded call triple: (ops method name, positional args, keyword args).
|
||||||
RecordedCall = tuple[str, tuple[Any, ...], dict[str, Any]]
|
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.
|
are appended after the model.
|
||||||
|
|
||||||
Returns:
|
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.
|
the OTKO version and the display units.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
|
|
|
||||||
|
|
@ -109,14 +109,14 @@ def _path_series_project() -> Project:
|
||||||
class TestHeader:
|
class TestHeader:
|
||||||
def test_opspy_header_pins_solver_version_and_units(self) -> None:
|
def test_opspy_header_pins_solver_version_and_units(self) -> None:
|
||||||
script = export_opspy(_truss_2d())
|
script = export_opspy(_truss_2d())
|
||||||
assert PINNED_OPENSEESPY == "openseespy==3.5.1.12"
|
assert PINNED_OPENSEESPY == "openseespy==3.8.0.0"
|
||||||
assert "openseespy==3.5.1.12" in script
|
assert "openseespy==3.8.0.0" in script
|
||||||
assert __version__ in script
|
assert __version__ in script
|
||||||
assert _truss_2d().meta.units.value in script
|
assert _truss_2d().meta.units.value in script
|
||||||
|
|
||||||
def test_tcl_header_pins_solver_version_and_units(self) -> None:
|
def test_tcl_header_pins_solver_version_and_units(self) -> None:
|
||||||
script = export_tcl(_truss_2d())
|
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
|
assert __version__ in script
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue