Skip to content

Commit 6748c38

Browse files
Merge branch 'master' into bump-dependencies
2 parents 575f2ef + b451449 commit 6748c38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2420
-516
lines changed

.darglint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[darglint]
22
strictness = full
3+
ignore_regex=^test_(.*)

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[flake8]
2-
select = B,B9,C,D,DAR,E,F,N,RST,S,W
2+
select = B,B9,C,D,DAR,E,F,N,PT,RST,S,W
33
ignore = B028,B905,E203,E501,E741,RST201,RST203,RST301,RST303,W503
44
max-line-length = 80
55
docstring-convention = google
66
per-file-ignores = tests/*:S101,__init__.py:F401,post.py:C901
77
rst-roles = class,const,func,meth,mod,ref
88
rst-directives = deprecated
9+
pytest-fixture-no-parentheses = True

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,14 @@ repos:
6868
rev: 0.6.1
6969
hooks:
7070
- id: nbstripout
71+
- repo: https://github.com/nbQA-dev/nbQA
72+
rev: 1.7.0
73+
hooks:
74+
- id: nbqa-black
75+
additional_dependencies: [black==23.9.1]
76+
- id: nbqa-pyupgrade
77+
additional_dependencies: [pyupgrade==3.14.0]
78+
args: ["--py39-plus"]
79+
- id: nbqa-isort
80+
additional_dependencies: [isort==5.12.0]
81+
args: [--profile=black]

docs/examples/advanced/advanced_plot.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"source": [
4242
"from sectionproperties.pre.library import rectangular_hollow_section\n",
4343
"\n",
44+
"\n",
4445
"geom = rectangular_hollow_section(d=100, b=100, t=6, r_out=15, n_r=8)"
4546
]
4647
},
@@ -61,6 +62,7 @@
6162
"source": [
6263
"from sectionproperties.analysis import Section\n",
6364
"\n",
65+
"\n",
6466
"geom.create_mesh(mesh_sizes=[5])\n",
6567
"sec = Section(geometry=geom)"
6668
]
@@ -104,6 +106,7 @@
104106
"source": [
105107
"import matplotlib.pyplot as plt\n",
106108
"\n",
109+
"\n",
107110
"# plot the geometry\n",
108111
"ax = geom.plot_geometry(\n",
109112
" labels=[],\n",

docs/examples/advanced/peery.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
42-
"from sectionproperties.pre.library import nastran_sections\n",
43-
"from sectionproperties.analysis import Section"
42+
"from sectionproperties.analysis import Section\n",
43+
"from sectionproperties.pre.library import nastran_sections"
4444
]
4545
},
4646
{

docs/examples/advanced/rectangle_torsion.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"source": [
3434
"import numpy as np\n",
3535
"\n",
36+
"\n",
3637
"# list of aspect ratios to analyse (10^0 = 1 to 10^1.301 = 20)\n",
3738
"# logspace used to concentrate data near aspect ratio = 1\n",
3839
"aspect_ratios = np.logspace(0, 1.301, 50)\n",
@@ -56,8 +57,9 @@
5657
"metadata": {},
5758
"outputs": [],
5859
"source": [
59-
"from sectionproperties.pre.library import rectangular_section\n",
6060
"from sectionproperties.analysis import Section\n",
61+
"from sectionproperties.pre.library import rectangular_section\n",
62+
"\n",
6163
"\n",
6264
"for ar in aspect_ratios:\n",
6365
" # calculate rectangle dimensions\n",
@@ -94,6 +96,7 @@
9496
"source": [
9597
"import matplotlib.pyplot as plt\n",
9698
"\n",
99+
"\n",
97100
"_, ax = plt.subplots()\n",
98101
"ax.plot(aspect_ratios, torsion_constants, \"k-\")\n",
99102
"ax.set_xlim(0, 21)\n",

docs/examples/advanced/trapezoidal_torsion.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"import numpy as np\n",
3434
"from shapely import Polygon\n",
3535
"\n",
36+
"from sectionproperties.analysis import Section\n",
3637
"from sectionproperties.pre import Geometry\n",
37-
"from sectionproperties.pre.library import rectangular_section, triangular_section\n",
38-
"from sectionproperties.analysis import Section"
38+
"from sectionproperties.pre.library import rectangular_section, triangular_section"
3939
]
4040
},
4141
{

docs/examples/analysis/export_fibre_section.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"from sectionproperties.post.fibre import to_fibre_section\n",
3737
"from sectionproperties.pre.library import i_section\n",
3838
"\n",
39+
"\n",
3940
"geom = i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)\n",
4041
"geom.create_mesh(mesh_sizes=10)\n",
4142
"\n",
@@ -61,6 +62,7 @@
6162
"source": [
6263
"from shutil import which\n",
6364
"\n",
65+
"\n",
6466
"# write the fibre section to a file\n",
6567
"# uncomment below to write file\n",
6668
"# with open('200UB25.4.sp', 'w') as f:\n",
@@ -134,6 +136,7 @@
134136
"source": [
135137
"from sectionproperties.analysis import Section\n",
136138
"\n",
139+
"\n",
137140
"sec = Section(geom)\n",
138141
"sec.calculate_geometric_properties()\n",
139142
"x, y = sec.get_c()\n",
@@ -185,6 +188,7 @@
185188
"source": [
186189
"from os.path import exists\n",
187190
"\n",
191+
"\n",
188192
"# write the fibre section to a file with material tag replaced\n",
189193
"# uncomment below to write file\n",
190194
"# with open('200UB25.4.sp', 'w') as f:\n",
@@ -221,8 +225,8 @@
221225
"outputs": [],
222226
"source": [
223227
"if result_available:\n",
224-
" from matplotlib import pyplot as plt\n",
225228
" import numpy as np\n",
229+
" from matplotlib import pyplot as plt\n",
226230
"\n",
227231
" data = np.loadtxt(\"R1-RF42.txt\")\n",
228232
" twist = data[:, 0] * 0.1\n",

docs/examples/analysis/frame_analysis.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
"metadata": {},
4949
"outputs": [],
5050
"source": [
51-
"from sectionproperties.pre.library import polygon_hollow_section\n",
5251
"from sectionproperties.analysis import Section\n",
52+
"from sectionproperties.pre.library import polygon_hollow_section\n",
53+
"\n",
5354
"\n",
5455
"geom = polygon_hollow_section(d=600, t=12, n_sides=12, r_in=20, n_r=8)\n",
5556
"geom.create_mesh(mesh_sizes=20)\n",
@@ -76,6 +77,7 @@
7677
"source": [
7778
"import time\n",
7879
"\n",
80+
"\n",
7981
"start = time.time()\n",
8082
"sec.calculate_geometric_properties()\n",
8183
"sec.calculate_warping_properties()\n",

docs/examples/analysis/geometric_analysis.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"source": [
4444
"from sectionproperties.pre.library import i_section\n",
4545
"\n",
46+
"\n",
4647
"geom = i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)"
4748
]
4849
},
@@ -63,6 +64,7 @@
6364
"source": [
6465
"from sectionproperties.analysis import Section\n",
6566
"\n",
67+
"\n",
6668
"geom.create_mesh(mesh_sizes=5)\n",
6769
"sec = Section(geometry=geom)"
6870
]
@@ -175,6 +177,7 @@
175177
"source": [
176178
"from sectionproperties.pre.library import channel_section\n",
177179
"\n",
180+
"\n",
178181
"# create 150 pfc geometry\n",
179182
"pfc = channel_section(d=150, b=75, t_f=9.5, t_w=6, r=10, n_r=8)\n",
180183
"pfc.plot_geometry(legend=False)"
@@ -265,6 +268,7 @@
265268
"from rich.console import Console\n",
266269
"from rich.table import Table\n",
267270
"\n",
271+
"\n",
268272
"# setup table\n",
269273
"table = Table(title=\"Section Properties Comparison\")\n",
270274
"table.add_column(\"Property\", justify=\"left\", style=\"cyan\", no_wrap=True)\n",

0 commit comments

Comments
 (0)