timoshenko-engine 2.0.2__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/PKG-INFO +56 -22
  2. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/README.md +48 -20
  3. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/pyproject.toml +34 -3
  4. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/__init__.py +121 -30
  5. timoshenko_engine-2.1.0/src/timoshenko/_spectral.py +34 -0
  6. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/adapters.py +22 -7
  7. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/assets.py +10 -2
  8. timoshenko_engine-2.1.0/src/timoshenko/beams.py +142 -0
  9. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/csv_source.py +33 -9
  10. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/health.py +16 -10
  11. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/mechanics.py +2 -1
  12. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/modal.py +58 -16
  13. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/monitor.py +23 -4
  14. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/mqtt.py +52 -14
  15. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/multichannel.py +24 -9
  16. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/observations.py +6 -2
  17. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/oma.py +47 -21
  18. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/plugins.py +19 -7
  19. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/polygon.py +111 -14
  20. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/pressure.py +6 -3
  21. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/project.py +10 -2
  22. timoshenko_engine-2.1.0/src/timoshenko/py.typed +0 -0
  23. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/report.py +43 -25
  24. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/sections.py +27 -7
  25. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/sensors.py +4 -3
  26. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/sensorthings.py +67 -16
  27. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/session.py +60 -19
  28. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/shafts.py +10 -3
  29. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/stability.py +15 -6
  30. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/storage.py +66 -18
  31. timoshenko_engine-2.1.0/src/timoshenko/structural.py +1640 -0
  32. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/structure.py +12 -4
  33. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/uncertainty.py +44 -15
  34. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/update.py +6 -2
  35. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/vibration.py +23 -7
  36. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/PKG-INFO +56 -22
  37. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/SOURCES.txt +6 -0
  38. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/requires.txt +5 -0
  39. timoshenko_engine-2.1.0/tests/test_adapters.py +791 -0
  40. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_formulas.py +38 -11
  41. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_modal.py +145 -17
  42. timoshenko_engine-2.1.0/tests/test_multichannel_csv.py +21 -0
  43. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_package.py +24 -10
  44. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_polygon.py +70 -11
  45. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_project_report.py +59 -11
  46. timoshenko_engine-2.1.0/tests/test_sensor_inputs.py +193 -0
  47. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/tests/test_storage_session.py +129 -8
  48. timoshenko_engine-2.1.0/tests/test_structural.py +1406 -0
  49. timoshenko_engine-2.1.0/tests/test_uncertainty.py +293 -0
  50. timoshenko_engine-2.0.2/src/timoshenko/beams.py +0 -75
  51. timoshenko_engine-2.0.2/tests/test_adapters.py +0 -425
  52. timoshenko_engine-2.0.2/tests/test_uncertainty.py +0 -79
  53. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/LICENSE +0 -0
  54. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/setup.cfg +0 -0
  55. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/_validation.py +0 -0
  56. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko/strength.py +0 -0
  57. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/dependency_links.txt +0 -0
  58. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/entry_points.txt +0 -0
  59. {timoshenko_engine-2.0.2 → timoshenko_engine-2.1.0}/src/timoshenko_engine.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: timoshenko-engine
3
- Version: 2.0.2
3
+ Version: 2.1.0
4
4
  Summary: Composable structural engineering calculations and analysis primitives for Python applications.
5
5
  Author: Ayberk Korkmaz
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/Ayberkrk/timoshenko
8
8
  Project-URL: Repository, https://github.com/Ayberkrk/timoshenko
9
9
  Project-URL: Issues, https://github.com/Ayberkrk/timoshenko/issues
10
- Project-URL: Documentation, https://github.com/Ayberkrk/timoshenko/tree/main/docs
10
+ Project-URL: Documentation, https://timoshenko.readthedocs.io/
11
11
  Project-URL: Changelog, https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md
12
12
  Keywords: civil engineering,structural engineering,structural health monitoring,modal analysis,digital twin
13
13
  Classifier: Development Status :: 3 - Alpha
@@ -18,7 +18,9 @@ Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
21
22
  Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Typing :: Typed
22
24
  Requires-Python: >=3.10
23
25
  Description-Content-Type: text/markdown
24
26
  License-File: LICENSE
@@ -27,6 +29,10 @@ Provides-Extra: mqtt
27
29
  Requires-Dist: paho-mqtt<3,>=2.1; extra == "mqtt"
28
30
  Provides-Extra: test
29
31
  Requires-Dist: pytest>=7; extra == "test"
32
+ Requires-Dist: pytest-cov>=5; extra == "test"
33
+ Provides-Extra: lint
34
+ Requires-Dist: ruff>=0.6; extra == "lint"
35
+ Requires-Dist: mypy>=1.10; extra == "lint"
30
36
  Provides-Extra: docs
31
37
  Requires-Dist: mkdocs-material<10,>=9.5; extra == "docs"
32
38
  Dynamic: license-file
@@ -46,7 +52,10 @@ Dynamic: license-file
46
52
  <img alt="Python versions" src="https://img.shields.io/pypi/pyversions/timoshenko-engine?style=for-the-badge">
47
53
  <img alt="Alpha" src="https://img.shields.io/badge/stage-alpha-orange?style=for-the-badge">
48
54
  <img alt="Apache 2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-green?style=for-the-badge">
55
+ <a href="https://doi.org/10.5281/zenodo.22968739"><img alt="DOI" src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.22968739-blue?style=for-the-badge"></a>
49
56
  <a href="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml/badge.svg"></a>
57
+ <a href="https://github.com/Ayberkrk/timoshenko/tree/python-coverage-comment-action-data"><img alt="Coverage" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FAyberkrk%2Ftimoshenko%2Fpython-coverage-comment-action-data%2Fendpoint.json&style=for-the-badge"></a>
58
+ <a href="https://timoshenko.readthedocs.io/en/latest/"><img alt="Documentation" src="https://img.shields.io/readthedocs/timoshenko?style=for-the-badge"></a>
50
59
  </p>
51
60
 
52
61
  Timoshenko packages common structural calculations, modal analysis, sensor
@@ -56,7 +65,7 @@ Python library, not a hosted monitoring service or a general finite-element
56
65
  solver.
57
66
 
58
67
  > **Alpha:** the API may still change between releases. Every behavior change
59
- > is listed in the [changelog](https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md).
68
+ > is listed in the [changelog](https://timoshenko.readthedocs.io/en/latest/changelog/).
60
69
 
61
70
  ## Install
62
71
 
@@ -85,7 +94,7 @@ structure = tm.Structure(
85
94
  story_masses_kg=[120_000.0, 110_000.0],
86
95
  story_stiffness_n_m=[85_000_000.0, 70_000_000.0],
87
96
  )
88
- print(structure.natural_frequencies_hz) # (2.626, 6.476)
97
+ print(structure.natural_frequencies_hz) # (2.626, 6.476)
89
98
 
90
99
  fs = 100.0
91
100
  t = np.arange(60_000) / fs
@@ -94,12 +103,16 @@ signal = np.sin(2 * np.pi * f1 * t) + 0.4 * np.sin(2 * np.pi * f2 * t)
94
103
  sensors = tm.SensorData(signal, sampling_hz=fs, unit="m/s^2")
95
104
 
96
105
  result = tm.monitor(structure, sensors, review_threshold_pct=3.0)
97
- print(result.structure.update_scale_factor) # 0.903, since stiffness scales with frequency squared
106
+ print(result.structure.update_scale_factor) # 0.903, since stiffness scales with frequency squared
98
107
  for change in result.health.mode_changes:
99
108
  print(change.mode_number, change.change_pct) # 1 -5.0, then 2 -5.0
100
- print(result.health.review_recommended) # True
109
+ print(result.health.review_recommended) # True
101
110
  ```
102
111
 
112
+ <p align="center">
113
+ <img src="https://raw.githubusercontent.com/Ayberkrk/timoshenko/main/assets/modal-comparison.svg" alt="Both identified modes plot 5% below the reference model, past the 3% review threshold" width="800">
114
+ </p>
115
+
103
116
  Real records load from CSV or JSON with
104
117
  `tm.load_sensors("acceleration.csv", sampling_hz=100.0, column="acc")`. The
105
118
  steps inside `tm.monitor` are also available separately as `tm.modal.identify`,
@@ -116,8 +129,12 @@ import timoshenko as tm
116
129
 
117
130
  section = tm.rectangle_section(width_m=0.3, height_m=0.6)
118
131
  beam = tm.simply_supported_uniform_load(
119
- 20_000.0, 6.0, 30e9, section.second_moment_y_m4,
120
- shear_modulus_pa=12.5e9, area_m2=section.area_m2,
132
+ 20_000.0,
133
+ 6.0,
134
+ 30e9,
135
+ section.second_moment_y_m4,
136
+ shear_modulus_pa=12.5e9,
137
+ area_m2=section.area_m2,
121
138
  )
122
139
  print(beam.bending_m, beam.shear_m) # 2.083 mm bending, 0.048 mm shear
123
140
 
@@ -129,12 +146,17 @@ frequency = tm.propagate_uncertainty(
129
146
  print(frequency.estimate, frequency.standard_uncertainty) # 6.366 Hz ± 0.090 Hz
130
147
  ```
131
148
 
149
+ Planar members can also be assembled into a small-displacement linear frame
150
+ model. Supports, nodal loads, local uniform loads and member masses are
151
+ explicit model inputs. See [2D frame analysis](https://timoshenko.readthedocs.io/en/latest/structural-analysis/)
152
+ for the stiffness, mass and scope assumptions.
153
+
132
154
  ## What it provides
133
155
 
134
156
  | Area | Components |
135
157
  |---|---|
136
158
  | Engineering calculations | Section properties (including polygons with holes), beam deflection with shear, torsion, Euler buckling, plane stress, thin-wall pressure, SDOF vibration, Rayleigh damping, and GUM / Monte Carlo uncertainty |
137
- | Structural models | Lumped-mass shear-building models and their natural frequencies |
159
+ | Structural models | Lumped-mass shear buildings and linear elastic planar trusses and frames with static, modal, P-delta and buckling analysis |
138
160
  | Modal analysis | Single-channel peak picking with resolution-checked damping, and multi-channel FDD with complex mode shapes |
139
161
  | Model comparison | Nearest-frequency mode pairing, global stiffness updating, and evidence-oriented health assessment |
140
162
  | Monitoring | Bounded rolling-window sessions, restart from local history, and source adapters for CSV, MQTT, and OGC SensorThings |
@@ -188,13 +210,15 @@ The session does not open network connections or run in the background. Use
188
210
 
189
211
  ## Documentation
190
212
 
191
- - [Documentation home](https://github.com/Ayberkrk/timoshenko/blob/main/docs/index.md)
192
- - [API reference](https://github.com/Ayberkrk/timoshenko/blob/main/docs/api.md)
193
- - [Numerical methods and limits](https://github.com/Ayberkrk/timoshenko/blob/main/docs/numerical-methods.md)
194
- - [Architecture](https://github.com/Ayberkrk/timoshenko/blob/main/docs/architecture.md)
195
- - [Monitoring sessions](https://github.com/Ayberkrk/timoshenko/blob/main/docs/live-sessions.md) and [source adapters](https://github.com/Ayberkrk/timoshenko/blob/main/docs/adapters.md)
196
- - [Runnable examples](https://github.com/Ayberkrk/timoshenko/tree/main/examples), including a [cross-check of PyNite shear-deformable beams](https://github.com/Ayberkrk/timoshenko/blob/main/docs/pynite-verification.md)
197
- - [Changelog](https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md)
213
+ The full documentation is at
214
+ [timoshenko.readthedocs.io](https://timoshenko.readthedocs.io/en/latest/). Good places to start:
215
+
216
+ - [API reference](https://timoshenko.readthedocs.io/en/latest/api/)
217
+ - [Numerical methods and limits](https://timoshenko.readthedocs.io/en/latest/numerical-methods/)
218
+ - [Architecture](https://timoshenko.readthedocs.io/en/latest/architecture/)
219
+ - [Monitoring sessions](https://timoshenko.readthedocs.io/en/latest/live-sessions/) and [source adapters](https://timoshenko.readthedocs.io/en/latest/adapters/)
220
+ - [Runnable examples](https://github.com/Ayberkrk/timoshenko/tree/main/examples), including a [cross-check of PyNite shear-deformable beams](https://timoshenko.readthedocs.io/en/latest/pynite-verification/)
221
+ - [Changelog](https://timoshenko.readthedocs.io/en/latest/changelog/)
198
222
 
199
223
  ## Limits and engineering posture
200
224
 
@@ -209,8 +233,11 @@ The session does not open network connections or run in the background. Use
209
233
  ## Development
210
234
 
211
235
  ```bash
212
- python -m pip install -e ".[test]"
213
- python -m pytest
236
+ python -m pip install -e ".[test,lint]"
237
+ python -m pytest --cov
238
+ python -m ruff check .
239
+ python -m ruff format --check .
240
+ python -m mypy
214
241
  ```
215
242
 
216
243
  To preview the documentation site:
@@ -221,13 +248,20 @@ python -m mkdocs serve
221
248
  ```
222
249
 
223
250
  Bug reports and pull requests are welcome in the
224
- [issue tracker](https://github.com/Ayberkrk/timoshenko/issues).
251
+ [issue tracker](https://github.com/Ayberkrk/timoshenko/issues). See
252
+ [`CONTRIBUTING.md`](https://github.com/Ayberkrk/timoshenko/blob/main/CONTRIBUTING.md)
253
+ for the checks a pull request needs to pass; issues labelled
254
+ [good first issue](https://github.com/Ayberkrk/timoshenko/labels/good%20first%20issue)
255
+ are small, self-contained starting points.
225
256
 
226
257
  ## Citation
227
258
 
228
- If you use Timoshenko in research, please cite it using the metadata in
229
- [`CITATION.cff`](https://github.com/Ayberkrk/timoshenko/blob/main/CITATION.cff)
230
- (GitHub's "Cite this repository" button reads the same file).
259
+ If you use Timoshenko in research, please cite it with its DOI,
260
+ [10.5281/zenodo.22968739](https://doi.org/10.5281/zenodo.22968739), which
261
+ always resolves to the latest release; each release also has its own DOI on
262
+ [Zenodo](https://zenodo.org/records/22968740). The metadata is in
263
+ [`CITATION.cff`](https://github.com/Ayberkrk/timoshenko/blob/main/CITATION.cff),
264
+ which GitHub's "Cite this repository" button reads.
231
265
 
232
266
  ## License
233
267
 
@@ -13,7 +13,10 @@
13
13
  <img alt="Python versions" src="https://img.shields.io/pypi/pyversions/timoshenko-engine?style=for-the-badge">
14
14
  <img alt="Alpha" src="https://img.shields.io/badge/stage-alpha-orange?style=for-the-badge">
15
15
  <img alt="Apache 2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-green?style=for-the-badge">
16
+ <a href="https://doi.org/10.5281/zenodo.22968739"><img alt="DOI" src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.22968739-blue?style=for-the-badge"></a>
16
17
  <a href="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml/badge.svg"></a>
18
+ <a href="https://github.com/Ayberkrk/timoshenko/tree/python-coverage-comment-action-data"><img alt="Coverage" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FAyberkrk%2Ftimoshenko%2Fpython-coverage-comment-action-data%2Fendpoint.json&style=for-the-badge"></a>
19
+ <a href="https://timoshenko.readthedocs.io/en/latest/"><img alt="Documentation" src="https://img.shields.io/readthedocs/timoshenko?style=for-the-badge"></a>
17
20
  </p>
18
21
 
19
22
  Timoshenko packages common structural calculations, modal analysis, sensor
@@ -23,7 +26,7 @@ Python library, not a hosted monitoring service or a general finite-element
23
26
  solver.
24
27
 
25
28
  > **Alpha:** the API may still change between releases. Every behavior change
26
- > is listed in the [changelog](https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md).
29
+ > is listed in the [changelog](https://timoshenko.readthedocs.io/en/latest/changelog/).
27
30
 
28
31
  ## Install
29
32
 
@@ -52,7 +55,7 @@ structure = tm.Structure(
52
55
  story_masses_kg=[120_000.0, 110_000.0],
53
56
  story_stiffness_n_m=[85_000_000.0, 70_000_000.0],
54
57
  )
55
- print(structure.natural_frequencies_hz) # (2.626, 6.476)
58
+ print(structure.natural_frequencies_hz) # (2.626, 6.476)
56
59
 
57
60
  fs = 100.0
58
61
  t = np.arange(60_000) / fs
@@ -61,12 +64,16 @@ signal = np.sin(2 * np.pi * f1 * t) + 0.4 * np.sin(2 * np.pi * f2 * t)
61
64
  sensors = tm.SensorData(signal, sampling_hz=fs, unit="m/s^2")
62
65
 
63
66
  result = tm.monitor(structure, sensors, review_threshold_pct=3.0)
64
- print(result.structure.update_scale_factor) # 0.903, since stiffness scales with frequency squared
67
+ print(result.structure.update_scale_factor) # 0.903, since stiffness scales with frequency squared
65
68
  for change in result.health.mode_changes:
66
69
  print(change.mode_number, change.change_pct) # 1 -5.0, then 2 -5.0
67
- print(result.health.review_recommended) # True
70
+ print(result.health.review_recommended) # True
68
71
  ```
69
72
 
73
+ <p align="center">
74
+ <img src="https://raw.githubusercontent.com/Ayberkrk/timoshenko/main/assets/modal-comparison.svg" alt="Both identified modes plot 5% below the reference model, past the 3% review threshold" width="800">
75
+ </p>
76
+
70
77
  Real records load from CSV or JSON with
71
78
  `tm.load_sensors("acceleration.csv", sampling_hz=100.0, column="acc")`. The
72
79
  steps inside `tm.monitor` are also available separately as `tm.modal.identify`,
@@ -83,8 +90,12 @@ import timoshenko as tm
83
90
 
84
91
  section = tm.rectangle_section(width_m=0.3, height_m=0.6)
85
92
  beam = tm.simply_supported_uniform_load(
86
- 20_000.0, 6.0, 30e9, section.second_moment_y_m4,
87
- shear_modulus_pa=12.5e9, area_m2=section.area_m2,
93
+ 20_000.0,
94
+ 6.0,
95
+ 30e9,
96
+ section.second_moment_y_m4,
97
+ shear_modulus_pa=12.5e9,
98
+ area_m2=section.area_m2,
88
99
  )
89
100
  print(beam.bending_m, beam.shear_m) # 2.083 mm bending, 0.048 mm shear
90
101
 
@@ -96,12 +107,17 @@ frequency = tm.propagate_uncertainty(
96
107
  print(frequency.estimate, frequency.standard_uncertainty) # 6.366 Hz ± 0.090 Hz
97
108
  ```
98
109
 
110
+ Planar members can also be assembled into a small-displacement linear frame
111
+ model. Supports, nodal loads, local uniform loads and member masses are
112
+ explicit model inputs. See [2D frame analysis](https://timoshenko.readthedocs.io/en/latest/structural-analysis/)
113
+ for the stiffness, mass and scope assumptions.
114
+
99
115
  ## What it provides
100
116
 
101
117
  | Area | Components |
102
118
  |---|---|
103
119
  | Engineering calculations | Section properties (including polygons with holes), beam deflection with shear, torsion, Euler buckling, plane stress, thin-wall pressure, SDOF vibration, Rayleigh damping, and GUM / Monte Carlo uncertainty |
104
- | Structural models | Lumped-mass shear-building models and their natural frequencies |
120
+ | Structural models | Lumped-mass shear buildings and linear elastic planar trusses and frames with static, modal, P-delta and buckling analysis |
105
121
  | Modal analysis | Single-channel peak picking with resolution-checked damping, and multi-channel FDD with complex mode shapes |
106
122
  | Model comparison | Nearest-frequency mode pairing, global stiffness updating, and evidence-oriented health assessment |
107
123
  | Monitoring | Bounded rolling-window sessions, restart from local history, and source adapters for CSV, MQTT, and OGC SensorThings |
@@ -155,13 +171,15 @@ The session does not open network connections or run in the background. Use
155
171
 
156
172
  ## Documentation
157
173
 
158
- - [Documentation home](https://github.com/Ayberkrk/timoshenko/blob/main/docs/index.md)
159
- - [API reference](https://github.com/Ayberkrk/timoshenko/blob/main/docs/api.md)
160
- - [Numerical methods and limits](https://github.com/Ayberkrk/timoshenko/blob/main/docs/numerical-methods.md)
161
- - [Architecture](https://github.com/Ayberkrk/timoshenko/blob/main/docs/architecture.md)
162
- - [Monitoring sessions](https://github.com/Ayberkrk/timoshenko/blob/main/docs/live-sessions.md) and [source adapters](https://github.com/Ayberkrk/timoshenko/blob/main/docs/adapters.md)
163
- - [Runnable examples](https://github.com/Ayberkrk/timoshenko/tree/main/examples), including a [cross-check of PyNite shear-deformable beams](https://github.com/Ayberkrk/timoshenko/blob/main/docs/pynite-verification.md)
164
- - [Changelog](https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md)
174
+ The full documentation is at
175
+ [timoshenko.readthedocs.io](https://timoshenko.readthedocs.io/en/latest/). Good places to start:
176
+
177
+ - [API reference](https://timoshenko.readthedocs.io/en/latest/api/)
178
+ - [Numerical methods and limits](https://timoshenko.readthedocs.io/en/latest/numerical-methods/)
179
+ - [Architecture](https://timoshenko.readthedocs.io/en/latest/architecture/)
180
+ - [Monitoring sessions](https://timoshenko.readthedocs.io/en/latest/live-sessions/) and [source adapters](https://timoshenko.readthedocs.io/en/latest/adapters/)
181
+ - [Runnable examples](https://github.com/Ayberkrk/timoshenko/tree/main/examples), including a [cross-check of PyNite shear-deformable beams](https://timoshenko.readthedocs.io/en/latest/pynite-verification/)
182
+ - [Changelog](https://timoshenko.readthedocs.io/en/latest/changelog/)
165
183
 
166
184
  ## Limits and engineering posture
167
185
 
@@ -176,8 +194,11 @@ The session does not open network connections or run in the background. Use
176
194
  ## Development
177
195
 
178
196
  ```bash
179
- python -m pip install -e ".[test]"
180
- python -m pytest
197
+ python -m pip install -e ".[test,lint]"
198
+ python -m pytest --cov
199
+ python -m ruff check .
200
+ python -m ruff format --check .
201
+ python -m mypy
181
202
  ```
182
203
 
183
204
  To preview the documentation site:
@@ -188,13 +209,20 @@ python -m mkdocs serve
188
209
  ```
189
210
 
190
211
  Bug reports and pull requests are welcome in the
191
- [issue tracker](https://github.com/Ayberkrk/timoshenko/issues).
212
+ [issue tracker](https://github.com/Ayberkrk/timoshenko/issues). See
213
+ [`CONTRIBUTING.md`](https://github.com/Ayberkrk/timoshenko/blob/main/CONTRIBUTING.md)
214
+ for the checks a pull request needs to pass; issues labelled
215
+ [good first issue](https://github.com/Ayberkrk/timoshenko/labels/good%20first%20issue)
216
+ are small, self-contained starting points.
192
217
 
193
218
  ## Citation
194
219
 
195
- If you use Timoshenko in research, please cite it using the metadata in
196
- [`CITATION.cff`](https://github.com/Ayberkrk/timoshenko/blob/main/CITATION.cff)
197
- (GitHub's "Cite this repository" button reads the same file).
220
+ If you use Timoshenko in research, please cite it with its DOI,
221
+ [10.5281/zenodo.22968739](https://doi.org/10.5281/zenodo.22968739), which
222
+ always resolves to the latest release; each release also has its own DOI on
223
+ [Zenodo](https://zenodo.org/records/22968740). The metadata is in
224
+ [`CITATION.cff`](https://github.com/Ayberkrk/timoshenko/blob/main/CITATION.cff),
225
+ which GitHub's "Cite this repository" button reads.
198
226
 
199
227
  ## License
200
228
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "timoshenko-engine"
7
- version = "2.0.2"
7
+ version = "2.1.0"
8
8
  description = "Composable structural engineering calculations and analysis primitives for Python applications."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -28,12 +28,15 @@ classifiers = [
28
28
  "Programming Language :: Python :: 3.11",
29
29
  "Programming Language :: Python :: 3.12",
30
30
  "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
31
32
  "Topic :: Scientific/Engineering",
33
+ "Typing :: Typed",
32
34
  ]
33
35
 
34
36
  [project.optional-dependencies]
35
37
  mqtt = ["paho-mqtt>=2.1,<3"]
36
- test = ["pytest>=7"]
38
+ test = ["pytest>=7", "pytest-cov>=5"]
39
+ lint = ["ruff>=0.6", "mypy>=1.10"]
37
40
  docs = ["mkdocs-material>=9.5,<10"]
38
41
 
39
42
  [project.entry-points."timoshenko.plugins"]
@@ -44,7 +47,7 @@ sensorthings = "timoshenko.sensorthings:SensorThingsPlugin"
44
47
  Homepage = "https://github.com/Ayberkrk/timoshenko"
45
48
  Repository = "https://github.com/Ayberkrk/timoshenko"
46
49
  Issues = "https://github.com/Ayberkrk/timoshenko/issues"
47
- Documentation = "https://github.com/Ayberkrk/timoshenko/tree/main/docs"
50
+ Documentation = "https://timoshenko.readthedocs.io/"
48
51
  Changelog = "https://github.com/Ayberkrk/timoshenko/blob/main/docs/changelog.md"
49
52
 
50
53
  [tool.setuptools]
@@ -53,6 +56,34 @@ package-dir = { "" = "src" }
53
56
  [tool.setuptools.packages.find]
54
57
  where = ["src"]
55
58
 
59
+ [tool.setuptools.package-data]
60
+ timoshenko = ["py.typed"]
61
+
56
62
  [tool.pytest.ini_options]
57
63
  testpaths = ["tests"]
58
64
  xfail_strict = true
65
+
66
+ [tool.coverage.run]
67
+ source = ["timoshenko"]
68
+ relative_files = true
69
+
70
+ [tool.coverage.report]
71
+ show_missing = true
72
+
73
+ [tool.ruff]
74
+ target-version = "py310"
75
+ src = ["src", "tests"]
76
+ line-length = 100
77
+
78
+ [tool.ruff.lint]
79
+ select = ["E4", "E7", "E9", "F", "I", "B"]
80
+
81
+ [tool.ruff.lint.isort]
82
+ force-sort-within-sections = true
83
+
84
+ [tool.mypy]
85
+ files = ["src/timoshenko"]
86
+ check_untyped_defs = true
87
+ disallow_untyped_defs = true
88
+ warn_unused_ignores = true
89
+ warn_redundant_casts = true
@@ -1,19 +1,34 @@
1
1
  """Timoshenko: composable structural engineering primitives."""
2
2
 
3
- from . import adapters, assets, beams, csv_source, health, mechanics, modal, mqtt, observations, oma, plugins, polygon, pressure, project, report, sections, sensorthings, session, shafts, stability, storage, strength, uncertainty, vibration
4
- from .assets import Asset, Relation
5
- from .adapters import AcknowledgingObservationSource, ObservationSource, SessionRunner
6
- from .csv_source import CSVObservationSource, CSVSourceError
7
- from .plugins import (
8
- ENTRY_POINT_GROUP,
9
- PLUGIN_API_VERSION,
10
- EnginePlugin,
11
- PluginCompatibilityError,
12
- PluginContributions,
13
- PluginError,
14
- PluginLoadError,
15
- PluginRegistry,
3
+ from . import (
4
+ adapters,
5
+ assets,
6
+ beams,
7
+ csv_source,
8
+ health,
9
+ mechanics,
10
+ modal,
11
+ mqtt,
12
+ observations,
13
+ oma,
14
+ plugins,
15
+ polygon,
16
+ pressure,
17
+ project,
18
+ report,
19
+ sections,
20
+ sensorthings,
21
+ session,
22
+ shafts,
23
+ stability,
24
+ storage,
25
+ strength,
26
+ structural,
27
+ uncertainty,
28
+ vibration,
16
29
  )
30
+ from .adapters import AcknowledgingObservationSource, ObservationSource, SessionRunner
31
+ from .assets import Asset, Relation
17
32
  from .beams import (
18
33
  BeamDeflection,
19
34
  cantilever_tip_load,
@@ -21,45 +36,101 @@ from .beams import (
21
36
  simply_supported_midpoint_load,
22
37
  simply_supported_uniform_load,
23
38
  )
39
+ from .csv_source import CSVObservationSource, CSVSourceError
24
40
  from .health import HealthAssessment
25
41
  from .mechanics import (
42
+ average_shear_stress,
26
43
  axial_strain,
27
44
  axial_stress,
28
- average_shear_stress,
29
45
  bending_stress,
30
46
  rectangular_max_shear_stress,
31
47
  thermal_strain,
32
48
  youngs_modulus_from_shear,
33
49
  )
34
50
  from .modal import ModalResult, Mode
35
- from .mqtt import MQTTSourceError, MqttObservationSource
36
- from .sensorthings import SensorThingsObservationSource, SensorThingsPlugin, SensorThingsSourceError
37
51
  from .monitor import MonitoringResult, monitor
38
- from .observations import Observation, ObservationBatch
52
+ from .mqtt import MqttObservationSource, MQTTSourceError
39
53
  from .multichannel import MultiChannelData, load_multichannel_csv
54
+ from .observations import Observation, ObservationBatch
40
55
  from .oma import FDDMode, FDDResult, identify_fdd
56
+ from .plugins import (
57
+ ENTRY_POINT_GROUP,
58
+ PLUGIN_API_VERSION,
59
+ EnginePlugin,
60
+ PluginCompatibilityError,
61
+ PluginContributions,
62
+ PluginError,
63
+ PluginLoadError,
64
+ PluginRegistry,
65
+ )
66
+ from .polygon import (
67
+ PolygonSectionProperties,
68
+ polygon_bending_stress_pa,
69
+ polygon_section,
70
+ )
41
71
  from .pressure import ThinWallCylinderResult, thin_wall_cylinder_stress
42
- from .polygon import PolygonSectionProperties, polygon_section
43
- from .project import LoadedProject, ProjectManifest, ProjectRunResult, load_project, read_manifest, run_project
44
- from .storage import BatchAppendResult, SQLiteStore
45
- from .session import MonitoringSession, SessionIngestResult, SessionReport, SessionRestoreResult
46
- from .sections import SectionProperties
72
+ from .project import (
73
+ LoadedProject,
74
+ ProjectManifest,
75
+ ProjectRunResult,
76
+ load_project,
77
+ read_manifest,
78
+ run_project,
79
+ )
80
+ from .sections import SectionProperties, i_section
47
81
  from .sections import circular_tube as circular_tube_section
48
- from .sections import i_section
49
- from .sections import rectangular_tube as rectangular_tube_section
50
82
  from .sections import rectangle as rectangle_section
83
+ from .sections import rectangular_tube as rectangular_tube_section
51
84
  from .sections import solid_circle as solid_circle_section
52
85
  from .sensors import SensorData, load_sensors
86
+ from .sensorthings import (
87
+ SensorThingsObservationSource,
88
+ SensorThingsPlugin,
89
+ SensorThingsSourceError,
90
+ )
91
+ from .session import (
92
+ MonitoringSession,
93
+ SessionIngestResult,
94
+ SessionReport,
95
+ SessionRestoreResult,
96
+ )
53
97
  from .shafts import CircularTorsionResult, circular_shaft_torsion
54
- from .structure import Structure
55
- from .stability import euler_critical_load
56
- from .stability import slenderness_ratio
98
+ from .stability import euler_critical_load, slenderness_ratio
99
+ from .storage import BatchAppendResult, SQLiteStore
57
100
  from .strength import PlaneStressResult, plane_stress
101
+ from .structural import (
102
+ AxialMember,
103
+ BucklingAnalysisResult,
104
+ FrameAnalysisResult,
105
+ FrameMaterial,
106
+ FrameMember,
107
+ FrameMemberResponse,
108
+ FrameNode,
109
+ FramePartialUniformLoad,
110
+ FramePointLoad,
111
+ FrameSection,
112
+ ModalAnalysisResult,
113
+ StructuralModel,
114
+ analyze_linear_buckling,
115
+ analyze_linear_static,
116
+ analyze_modes,
117
+ analyze_p_delta,
118
+ modal_assurance_criterion,
119
+ recover_member_response,
120
+ )
121
+ from .structure import Structure
122
+ from .uncertainty import UncertaintyError, UncertaintyResult
123
+ from .uncertainty import propagate as propagate_uncertainty
58
124
  from .update import update
59
- from .uncertainty import UncertaintyError, UncertaintyResult, propagate as propagate_uncertainty
60
- from .vibration import RayleighDampingResult, damping_ratio, harmonic_response, natural_frequency_hz, rayleigh_damping_coefficients
125
+ from .vibration import (
126
+ RayleighDampingResult,
127
+ damping_ratio,
128
+ harmonic_response,
129
+ natural_frequency_hz,
130
+ rayleigh_damping_coefficients,
131
+ )
61
132
 
62
- __version__ = "2.0.2"
133
+ __version__ = "2.1.0"
63
134
 
64
135
  __all__ = [
65
136
  "HealthAssessment",
@@ -98,6 +169,18 @@ __all__ = [
98
169
  "PluginRegistry",
99
170
  "SensorData",
100
171
  "Structure",
172
+ "StructuralModel",
173
+ "AxialMember",
174
+ "FrameNode",
175
+ "FrameMaterial",
176
+ "FrameSection",
177
+ "FrameMember",
178
+ "FrameMemberResponse",
179
+ "FramePartialUniformLoad",
180
+ "FramePointLoad",
181
+ "FrameAnalysisResult",
182
+ "ModalAnalysisResult",
183
+ "BucklingAnalysisResult",
101
184
  "SectionProperties",
102
185
  "ThinWallCylinderResult",
103
186
  "RayleighDampingResult",
@@ -143,6 +226,7 @@ __all__ = [
143
226
  "plugins",
144
227
  "polygon",
145
228
  "polygon_section",
229
+ "polygon_bending_stress_pa",
146
230
  "report",
147
231
  "rectangle_section",
148
232
  "rectangular_tube_section",
@@ -165,6 +249,13 @@ __all__ = [
165
249
  "vibration",
166
250
  "assets",
167
251
  "adapters",
252
+ "structural",
253
+ "analyze_linear_static",
254
+ "analyze_modes",
255
+ "analyze_p_delta",
256
+ "analyze_linear_buckling",
257
+ "modal_assurance_criterion",
258
+ "recover_member_response",
168
259
  "storage",
169
260
  "uncertainty",
170
261
  "load_project",
@@ -0,0 +1,34 @@
1
+ """Small helpers for locating frequency-domain peaks."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import math
6
+
7
+ import numpy as np
8
+
9
+
10
+ def interpolate_log_peak_frequency(
11
+ frequencies: np.ndarray,
12
+ spectrum: np.ndarray,
13
+ peak_index: int,
14
+ ) -> float:
15
+ """Refine a spectral-bin peak with a three-point log-magnitude parabola."""
16
+ center_frequency = float(frequencies[peak_index])
17
+ if peak_index <= 0 or peak_index >= len(spectrum) - 1:
18
+ return center_frequency
19
+ left = float(spectrum[peak_index - 1])
20
+ center = float(spectrum[peak_index])
21
+ right = float(spectrum[peak_index + 1])
22
+ if not all(math.isfinite(value) and value > 0.0 for value in (left, center, right)):
23
+ return center_frequency
24
+
25
+ log_left, log_center, log_right = math.log(left), math.log(center), math.log(right)
26
+ curvature = log_left - 2.0 * log_center + log_right
27
+ if not math.isfinite(curvature) or curvature >= 0.0:
28
+ return center_frequency
29
+ offset = 0.5 * (log_left - log_right) / curvature
30
+ if not math.isfinite(offset):
31
+ return center_frequency
32
+ offset = min(0.5, max(-0.5, offset))
33
+ bin_width = float(frequencies[peak_index + 1] - frequencies[peak_index])
34
+ return center_frequency + offset * bin_width