Skip to content

Commit 691526b

Browse files
committed
Update test_translate.py
1 parent 4fa437d commit 691526b

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

tests/test_translate.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
import numpy as np
33
from tests.shapes import create_section
4+
from xsection._benchmarks import load_shape
45
from xsection.library import from_aisc, Rectangle, HollowRectangle, Channel, WideFlange
56

67
def shift_inertia(r, centroid, A):
@@ -12,14 +13,14 @@ def shift_inertia(r, centroid, A):
1213
def _check_translate(shape, r):
1314
shape_t = shape.translate(r)
1415

15-
A = shape.elastic.A
16-
Iy0 = shape.elastic.Iy
17-
Iz0 = shape.elastic.Iz
18-
Iyz0 = shape.elastic.Iyz
16+
A = shape.geometric.A
17+
Iy0 = shape.geometric.Iy
18+
Iz0 = shape.geometric.Iz
19+
Iyz0 = shape.geometric.Iyz
1920

20-
Iy1 = shape_t.elastic.Iy
21-
Iz1 = shape_t.elastic.Iz
22-
Iyz1 = shape_t.elastic.Iyz
21+
Iy1 = shape_t.geometric.Iy
22+
Iz1 = shape_t.geometric.Iz
23+
Iyz1 = shape_t.geometric.Iyz
2324

2425
dI = shift_inertia(r, shape.centroid, A)
2526
dIy = dI[0,0]
@@ -30,13 +31,20 @@ def _check_translate(shape, r):
3031

3132

3233
def test_translate_rect():
33-
_check_translate(create_section(1), (3.0, 4.0))
34+
_check_translate(load_shape("R01"), (3.0, 4.0))
3435

3536
def test_translate_hrect():
36-
_check_translate(create_section(2), (3.0, 4.0))
37-
_check_translate(create_section(3), (3.0, 4.0))
37+
_check_translate(load_shape("H07"), (3.0, 4.0))
38+
_check_translate(load_shape("H08"), (3.0, 4.0))
39+
3840

3941
def test_translate_channel():
40-
_check_translate(create_section(4), (3.0, 4.0))
41-
_check_translate(create_section("c01"), (3.0, 4.0))
42+
_check_translate(load_shape("C10"), (3.0, 4.0))
43+
44+
45+
def test_girder():
46+
_check_translate(load_shape("G03"), (3.0, 4.0))
4247

48+
def _test_composite():
49+
shape = load_shape("M01")
50+
_check_translate(shape, (3.0, 4.0))

0 commit comments

Comments
 (0)