11import pytest
22import numpy as np
33from tests .shapes import create_section
4+ from xsection ._benchmarks import load_shape
45from xsection .library import from_aisc , Rectangle , HollowRectangle , Channel , WideFlange
56
67def shift_inertia (r , centroid , A ):
@@ -12,14 +13,14 @@ def shift_inertia(r, centroid, A):
1213def _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
3233def test_translate_rect ():
33- _check_translate (create_section ( 1 ), (3.0 , 4.0 ))
34+ _check_translate (load_shape ( "R01" ), (3.0 , 4.0 ))
3435
3536def 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
3941def 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