Skip to content

Commit 1e07fc8

Browse files
author
jchkoch
committed
small fixes after running pre-commit
1 parent 6254173 commit 1e07fc8

File tree

5 files changed

+31
-71
lines changed

5 files changed

+31
-71
lines changed

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/examples/geometry/section_library.ipynb

Lines changed: 24 additions & 54 deletions
Large diffs are not rendered by default.

src/sectionproperties/pre/library/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,4 @@
6363
tee_section,
6464
zed_section,
6565
)
66-
from sectionproperties.pre.library.timber_sections import (
67-
clt_rectangular_section
68-
)
66+
from sectionproperties.pre.library.timber_sections import clt_rectangular_section

src/sectionproperties/pre/library/timber_sections.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99

1010
def clt_rectangular_section(
11-
d: list[float],
12-
lay_orient: list[pre.Material],
13-
b: float
11+
d: list[float], lay_orient: list[pre.Material], b: float
1412
) -> geometry.CompoundGeometry:
1513
"""Constructs a timber rectangular section.
1614
@@ -32,17 +30,15 @@ def clt_rectangular_section(
3230
Example:
3331
The following example creates a 120mm CLT cross-section.
3432
"""
35-
36-
layer_geom = list()
33+
layer_geom = []
3734
for idx in range(len(d)):
3835
di = float(d[idx])
3936
layer = lay_orient[idx]
4037

4138
timb_mat = layer
4239

4340
# create rectangular timber geometry
44-
layer = primitive_sections.rectangular_section(d=di, b=b,
45-
material=timb_mat)
41+
layer = primitive_sections.rectangular_section(d=di, b=b, material=timb_mat)
4642
offset = -d[idx] * (idx + 1)
4743
layer = layer.shift_section(y_offset=offset)
4844

@@ -54,4 +50,5 @@ def clt_rectangular_section(
5450
if isinstance(geom, geometry.CompoundGeometry):
5551
return geom
5652
else:
57-
raise ValueError("Timber section generation failed.")
53+
msg = "Timber section generation failed."
54+
raise ValueError(msg)

tests/section_library/test_timber_sections.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
from __future__ import annotations
44

5-
import numpy as np
65
import pytest
76
import pytest_check as check
87

98
import sectionproperties.pre.library.timber_sections as ts
10-
import sectionproperties.pre.library.primitive_sections as ps
119
import sectionproperties.pre.pre as pre
1210

13-
1411
r_tol = 1e-6
1512

1613

@@ -22,7 +19,6 @@ def get_materials() -> tuple[pre.Material, pre.Material]:
2219
Returns:
2320
Material objects
2421
"""
25-
2622
timb_mat0 = pre.Material(
2723
name="Timber E0",
2824
elastic_modulus=9.5e3,
@@ -53,7 +49,7 @@ def test_timber_clt_rectangular_section(get_materials):
5349
lay_orient=[0, 90, 0],
5450
b=1000,
5551
timb_mat0=timber0,
56-
timb_mat90=timber90
52+
timb_mat90=timber90,
5753
)
5854

5955
# check geometry is created correctly

0 commit comments

Comments
 (0)