mechlab 0.2.2__tar.gz → 0.2.4__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.
- mechlab-0.2.4/.gitignore +17 -0
- mechlab-0.2.4/.vscode/settings.json +3 -0
- mechlab-0.2.4/DEVLOG.md +373 -0
- mechlab-0.2.4/PKG-INFO +272 -0
- mechlab-0.2.4/README.md +223 -0
- mechlab-0.2.4/check.py +23 -0
- mechlab-0.2.4/docs/.gitignore +11 -0
- mechlab-0.2.4/docs/Makefile +20 -0
- mechlab-0.2.4/docs/make.bat +35 -0
- mechlab-0.2.4/docs/source/.nojekyll +0 -0
- mechlab-0.2.4/docs/source/_static/custom.css +8 -0
- mechlab-0.2.4/docs/source/_static/logo.png +0 -0
- mechlab-0.2.4/docs/source/changelog/index.rst +13 -0
- mechlab-0.2.4/docs/source/conf.py +78 -0
- mechlab-0.2.4/docs/source/contributing/index.rst +25 -0
- mechlab-0.2.4/docs/source/examples/index.rst +24 -0
- mechlab-0.2.4/docs/source/faq/index.rst +11 -0
- mechlab-0.2.4/docs/source/guides/index.rst +13 -0
- mechlab-0.2.4/docs/source/index.rst +36 -0
- mechlab-0.2.4/docs/source/installation/index.rst +67 -0
- mechlab-0.2.4/docs/source/reference/index.rst +9 -0
- mechlab-0.2.4/docs/source/reference/mechanics.rst +40 -0
- mechlab-0.2.4/docs/source/tutorials/branch/mechanics.rst +9 -0
- mechlab-0.2.4/docs/source/tutorials/index.rst +16 -0
- mechlab-0.2.4/docs/source/tutorials/quickstart.rst +43 -0
- mechlab-0.2.4/interactive_stress_element_3d.html +3888 -0
- mechlab-0.2.4/main.py +58 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/__init__.py +1 -1
- mechlab-0.2.4/mechlab/mechanics/__init__.py +11 -0
- mechlab-0.2.4/mechlab/mechanics/dynamics/__init__.py +11 -0
- mechlab-0.2.4/mechlab/mechanics/dynamics/dynamics.py +0 -0
- mechlab-0.2.4/mechlab/mechanics/dynamics/velocity.py +2 -0
- mechlab-0.2.4/mechlab/mechanics/statics/__init__.py +13 -0
- mechlab-0.2.4/mechlab/mechanics/statics/stress.py +35 -0
- mechlab-0.2.4/mechlab/thermodynamics/cycle.py +102 -0
- mechlab-0.2.4/pyproject.toml +99 -0
- mechlab-0.2.4/requirements.txt +99 -0
- mechlab-0.2.4/scripts.py +6 -0
- mechlab-0.2.4/stress_element.png +0 -0
- mechlab-0.2.4/stress_element_3d_fbd.html +3888 -0
- mechlab-0.2.4/stress_element_fbd.png +0 -0
- mechlab-0.2.4/test.py +23 -0
- mechlab-0.2.4/test1.py +104 -0
- mechlab-0.2.4/test2.py +32 -0
- mechlab-0.2.4/test3.py +14 -0
- mechlab-0.2.4/uv.lock +1496 -0
- mechlab-0.2.2/PKG-INFO +0 -232
- mechlab-0.2.2/README.md +0 -179
- mechlab-0.2.2/mechlab/mechanics/__init__.py +0 -2
- mechlab-0.2.2/mechlab/mechanics/statics.py +0 -56
- mechlab-0.2.2/pyproject.toml +0 -89
- {mechlab-0.2.2 → mechlab-0.2.4}/LICENSE +0 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/cli.py +0 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/thermodynamics/__init__.py +0 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/thermodynamics/properties.py +0 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/thermodynamics/state.py +0 -0
- {mechlab-0.2.2 → mechlab-0.2.4}/mechlab/thermodynamics/test_run.py +0 -0
mechlab-0.2.4/.gitignore
ADDED
mechlab-0.2.4/DEVLOG.md
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
Perfect 👍
|
|
2
|
+
Below is a **complete, clean, copy-paste ready `DEVLOG.md`** written in **proper Markdown**, covering **everything step-by-step**: setup, docs, GitHub Pages, and PyPI publishing.
|
|
3
|
+
|
|
4
|
+
You can save this **exactly as `DEVLOG.md`** in your repo root.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MechLab – Development & Deployment Log (DEVLOG)
|
|
9
|
+
|
|
10
|
+
This document records the **complete setup, documentation, GitHub Pages deployment, and PyPI publishing workflow** for the `mechlab` Python library.
|
|
11
|
+
|
|
12
|
+
It is intended to be reusable for **future releases**.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Project Information
|
|
17
|
+
|
|
18
|
+
- **Package name:** mechlab
|
|
19
|
+
- **Current version:** 0.1.1
|
|
20
|
+
- **Description:** Computational Mechanical Engineering Toolkit
|
|
21
|
+
- **Author:** Sewak Sunar
|
|
22
|
+
- **License:** MIT
|
|
23
|
+
- **Build system:** Poetry (PEP 621)
|
|
24
|
+
- **Documentation:** Sphinx
|
|
25
|
+
- **Hosting:** GitHub Pages
|
|
26
|
+
- **Distribution:** PyPI
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 1. Environment Setup
|
|
31
|
+
|
|
32
|
+
### Python
|
|
33
|
+
- Python **>= 3.14**
|
|
34
|
+
|
|
35
|
+
### Poetry
|
|
36
|
+
Install Poetry:
|
|
37
|
+
```bash
|
|
38
|
+
pip install poetry
|
|
39
|
+
````
|
|
40
|
+
|
|
41
|
+
Enable in-project virtual environment:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
poetry config virtualenvs.in-project true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Install dependencies:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
poetry install
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Activate environment (Poetry 2.x):
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
poetry env activate
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> Note: `poetry shell` is deprecated in Poetry ≥ 2.0
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 2. Project Structure
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
mechlab/
|
|
67
|
+
├── mechlab/ # Python package
|
|
68
|
+
├── docs/ # Sphinx documentation
|
|
69
|
+
│ ├── source/
|
|
70
|
+
│ └── build/
|
|
71
|
+
├── pyproject.toml
|
|
72
|
+
├── poetry.lock
|
|
73
|
+
├── README.md
|
|
74
|
+
├── LICENSE
|
|
75
|
+
└── DEVLOG.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 3. Documentation (Sphinx)
|
|
81
|
+
|
|
82
|
+
### Install documentation dependencies
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
poetry add --group docs sphinx furo myst-parser sphinx-design sphinx-copybutton
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### Generate API documentation
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
poetry run sphinx-apidoc -o docs/source mechlab
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This generates:
|
|
97
|
+
|
|
98
|
+
* `modules.rst`
|
|
99
|
+
* module documentation files
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Build HTML documentation
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
poetry run sphinx-build -b html docs/source docs/build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Output:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
docs/build/index.html
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### View documentation locally
|
|
118
|
+
|
|
119
|
+
Open in browser:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
docs/build/index.html
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 4. Common Sphinx Fixes
|
|
128
|
+
|
|
129
|
+
### Fix: Title underline too short
|
|
130
|
+
|
|
131
|
+
```rst
|
|
132
|
+
MechLab Documentation
|
|
133
|
+
====================
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Underline must match title length.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Fix: toctree document has no title
|
|
141
|
+
|
|
142
|
+
Every `.rst` file **must start with a title**.
|
|
143
|
+
|
|
144
|
+
```rst
|
|
145
|
+
Thermodynamics
|
|
146
|
+
==============
|
|
147
|
+
|
|
148
|
+
.. automodule:: mechlab.thermodynamics
|
|
149
|
+
:members:
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Fix: ModuleNotFoundError in autodoc
|
|
155
|
+
|
|
156
|
+
Add to `docs/source/conf.py`:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
import sys
|
|
160
|
+
from pathlib import Path
|
|
161
|
+
|
|
162
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 5. GitHub Pages Deployment (Sphinx)
|
|
168
|
+
|
|
169
|
+
### Create gh-pages branch
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
git branch gh-pages
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### Create Git worktree
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
git worktree add ../mechlab-docs gh-pages
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Directory layout:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
MechLab/
|
|
187
|
+
├── mechlab/ # main branch
|
|
188
|
+
└── mechlab-docs/ # gh-pages branch
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### Copy built docs
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
Copy-Item docs\build\* ..\mechlab-docs\ -Recurse -Force
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### Disable Jekyll
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
cd ../mechlab-docs
|
|
205
|
+
New-Item .nojekyll -Force
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Commit & push docs
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
git add .
|
|
214
|
+
git commit -m "Deploy documentation"
|
|
215
|
+
git push origin gh-pages
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
### Enable GitHub Pages
|
|
221
|
+
|
|
222
|
+
GitHub → **Settings → Pages**
|
|
223
|
+
|
|
224
|
+
* Source: Deploy from branch
|
|
225
|
+
* Branch: `gh-pages`
|
|
226
|
+
* Folder: `/ (root)`
|
|
227
|
+
|
|
228
|
+
Documentation URL:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
https://sewaksunar.github.io/mechlab/
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 6. PyPI Packaging (Poetry)
|
|
237
|
+
|
|
238
|
+
### Build package
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
poetry build
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Artifacts:
|
|
245
|
+
|
|
246
|
+
```text
|
|
247
|
+
dist/
|
|
248
|
+
├── mechlab-0.1.1.tar.gz
|
|
249
|
+
└── mechlab-0.1.1-py3-none-any.whl
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## 7. PyPI Metadata Fixes
|
|
255
|
+
|
|
256
|
+
### Invalid classifier (removed)
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
Topic :: Scientific/Engineering :: Mechanical Engineering
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
❌ Not a valid PyPI classifier
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### Valid classifiers used
|
|
267
|
+
|
|
268
|
+
```toml
|
|
269
|
+
classifiers = [
|
|
270
|
+
"Development Status :: 3 - Alpha",
|
|
271
|
+
"Intended Audience :: Science/Research",
|
|
272
|
+
"Intended Audience :: Education",
|
|
273
|
+
"Topic :: Scientific/Engineering",
|
|
274
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
275
|
+
"License :: OSI Approved :: MIT License",
|
|
276
|
+
"Programming Language :: Python :: 3",
|
|
277
|
+
"Operating System :: OS Independent"
|
|
278
|
+
]
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### License fix
|
|
284
|
+
|
|
285
|
+
```toml
|
|
286
|
+
license = "MIT"
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### Scripts fix
|
|
292
|
+
|
|
293
|
+
```toml
|
|
294
|
+
[project.scripts]
|
|
295
|
+
dev = "scripts:docs_dev"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### Update lock file
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
poetry lock
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### Validate package
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
poetry check
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
### Publish to PyPI
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
poetry publish
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Or build + publish:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
poetry publish --build
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 8. Release Checklist
|
|
331
|
+
|
|
332
|
+
* [x] Docs build successfully
|
|
333
|
+
* [x] Docs render locally
|
|
334
|
+
* [x] GitHub Pages live
|
|
335
|
+
* [x] Valid PyPI classifiers
|
|
336
|
+
* [x] Poetry check passes
|
|
337
|
+
* [x] Wheel & sdist built
|
|
338
|
+
* [x] PyPI upload successful
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 9. Future Improvements
|
|
343
|
+
|
|
344
|
+
* Versioned documentation (`/v0.2/`)
|
|
345
|
+
* Read the Docs integration
|
|
346
|
+
* GitHub Actions CI/CD
|
|
347
|
+
* Automated PyPI releases
|
|
348
|
+
* Example gallery
|
|
349
|
+
* API stability guarantees
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## End of DEVLOG
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
If you want next, I can:
|
|
360
|
+
- 🔁 automate **docs + PyPI release**
|
|
361
|
+
- 🎨 improve docs theme & layout
|
|
362
|
+
- 🧪 add CI testing
|
|
363
|
+
- 📦 prepare **v0.2.0 roadmap**
|
|
364
|
+
|
|
365
|
+
Just say the word 🚀
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
# Clear old build files to avoid confusion
|
|
369
|
+
Remove-Item -Recurse -Force dist
|
|
370
|
+
|
|
371
|
+
# Build and Upload
|
|
372
|
+
poetry build
|
|
373
|
+
poetry publish
|
mechlab-0.2.4/PKG-INFO
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mechlab
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Computational Mechanical Engineering Toolkit
|
|
5
|
+
Project-URL: Homepage, https://github.com/sewaksunar/mechlab
|
|
6
|
+
Project-URL: Documentation, https://sewaksunar.github.io/mechlab/
|
|
7
|
+
Project-URL: Repository, https://github.com/sewaksunar/mechlab.git
|
|
8
|
+
Project-URL: Issues, https://github.com/sewaksunar/mechlab/issues
|
|
9
|
+
Author-email: Sewak Sunar <sewaksunar@hotmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: control-systems,engineering,fluid-mechanics,mechanical-engineering,scientific-computing,thermodynamics
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: colorama==0.4.6
|
|
23
|
+
Requires-Dist: contourpy==1.3.3
|
|
24
|
+
Requires-Dist: control==0.10.2
|
|
25
|
+
Requires-Dist: coolprop==7.2.0
|
|
26
|
+
Requires-Dist: cycler==0.12.1
|
|
27
|
+
Requires-Dist: flexcache==0.3
|
|
28
|
+
Requires-Dist: flexparser==0.4
|
|
29
|
+
Requires-Dist: fluids==1.3.0
|
|
30
|
+
Requires-Dist: fonttools==4.61.1
|
|
31
|
+
Requires-Dist: kiwisolver==1.4.9
|
|
32
|
+
Requires-Dist: matplotlib==3.10.8
|
|
33
|
+
Requires-Dist: mpmath==1.3.0
|
|
34
|
+
Requires-Dist: numpy==2.4.1
|
|
35
|
+
Requires-Dist: packaging==26.0
|
|
36
|
+
Requires-Dist: pillow==12.1.0
|
|
37
|
+
Requires-Dist: pint==0.25.2
|
|
38
|
+
Requires-Dist: platformdirs==4.5.1
|
|
39
|
+
Requires-Dist: plotly>=6.5.2
|
|
40
|
+
Requires-Dist: pycairo>=1.29.0
|
|
41
|
+
Requires-Dist: pygments==2.19.2
|
|
42
|
+
Requires-Dist: pyparsing==3.3.2
|
|
43
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
44
|
+
Requires-Dist: scipy==1.17.0
|
|
45
|
+
Requires-Dist: six==1.17.0
|
|
46
|
+
Requires-Dist: sympy==1.14.0
|
|
47
|
+
Requires-Dist: typing-extensions==4.15.0
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<img src="https://github.com/sewaksunar/mechlab/blob/main/docs/source/_static/logo.png" width="200" alt="MechLab Logo">
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+

|
|
56
|
+

|
|
57
|
+
[](https://sewaksunar.github.io/mechlab/)
|
|
58
|
+
<!-- [](https://www.reddit.com/r/) -->
|
|
59
|
+
|
|
60
|
+
# MechLab
|
|
61
|
+
|
|
62
|
+
**MechLab** is an open-source **Python library for mechanical engineering computations**, providing a unified, modular, and extensible toolkit for **students, researchers, and practicing engineers**.
|
|
63
|
+
|
|
64
|
+
It brings together widely used scientific libraries under a clean, engineering-focused API for:
|
|
65
|
+
|
|
66
|
+
`mechanics` `thermodynamics` `fluid mechanics` `control systems` `numerical & symbolic computation`
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
* Mechanics (statics & dynamics)
|
|
73
|
+
* Thermodynamics utilities (properties, processes, cycles)
|
|
74
|
+
* Fluid mechanics calculations (dimensionless numbers, flow relations)
|
|
75
|
+
* Control systems analysis
|
|
76
|
+
* Symbolic & numerical computation
|
|
77
|
+
* Modular and extensible architecture
|
|
78
|
+
* Sphinx-based documentation with API reference
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
Install directly from **PyPI**:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install mechlab
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Using **uv** (recommended):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
uv pip install mechlab
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from mechlab.thermodynamics import enthalpy_TP
|
|
102
|
+
|
|
103
|
+
h = enthalpy_TP(
|
|
104
|
+
fluid="Water",
|
|
105
|
+
T=500, # Temperature [K]
|
|
106
|
+
P=3e6 # Pressure [Pa]
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
print(f"Enthalpy: {h:.2f} J/kg")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Package Structure
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
mechlab/
|
|
118
|
+
│
|
|
119
|
+
├── mechanics/
|
|
120
|
+
│ ├── __init__.py
|
|
121
|
+
│ ├── statics/
|
|
122
|
+
│ │ ├── stress.py
|
|
123
|
+
│ │ └── strain.py
|
|
124
|
+
│ └── dynamics/
|
|
125
|
+
│ ├── linear_motion.py
|
|
126
|
+
│ ├── rectilinear_motion.py
|
|
127
|
+
│ └── motion_3d.py
|
|
128
|
+
│
|
|
129
|
+
├── mscience/ # Material science
|
|
130
|
+
│
|
|
131
|
+
├── thermodynamics/
|
|
132
|
+
│ ├── __init__.py
|
|
133
|
+
│ ├── properties.py
|
|
134
|
+
│ └── cycles.py
|
|
135
|
+
│
|
|
136
|
+
├── fluid_mechanics/
|
|
137
|
+
│ ├── __init__.py
|
|
138
|
+
│ └── dimensionless.py
|
|
139
|
+
│
|
|
140
|
+
├── control_systems/
|
|
141
|
+
│ ├── __init__.py
|
|
142
|
+
│ └── linear.py
|
|
143
|
+
│
|
|
144
|
+
├── utils/
|
|
145
|
+
│ ├── __init__.py
|
|
146
|
+
│ └── constants.py
|
|
147
|
+
│
|
|
148
|
+
└── __init__.py
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Dependencies
|
|
153
|
+
|
|
154
|
+
MechLab is built on top of proven scientific Python libraries:
|
|
155
|
+
|
|
156
|
+
`numpy` `scipy` `sympy` `control` `fluids` `CoolProp` `pint` `matplotlib`
|
|
157
|
+
|
|
158
|
+
All dependencies are installed automatically.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Design Philosophy
|
|
163
|
+
|
|
164
|
+
* **Engineering-first API** (clear physical meaning)
|
|
165
|
+
* **Readable code** over premature optimization
|
|
166
|
+
* **Modular design** — subject areas are independent
|
|
167
|
+
* **Extensible** — easy to add new models & correlations
|
|
168
|
+
* **Documented** — API reference generated directly from code
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Roadmap
|
|
173
|
+
|
|
174
|
+
* Rankine, Otto, Diesel cycles
|
|
175
|
+
* Pipe flow & heat exchanger modules
|
|
176
|
+
* Full unit-aware API using Pint
|
|
177
|
+
* Validation against textbook examples
|
|
178
|
+
* Interactive Jupyter notebooks
|
|
179
|
+
* Hosted documentation website
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Development Setup (Contributors)
|
|
184
|
+
|
|
185
|
+
Clone the repository:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
git clone https://github.com/sewaksunar/mechlab.git
|
|
189
|
+
cd mechlab
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Create a virtual environment and install dependencies with **uv**:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
uv venv
|
|
196
|
+
uv pip install -e .
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Build documentation:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cd docs
|
|
203
|
+
uv run sphinx-build source build
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Run tests:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
pytest
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Contributing
|
|
215
|
+
|
|
216
|
+
Contributions are welcome!
|
|
217
|
+
|
|
218
|
+
1. Fork the repository
|
|
219
|
+
2. Create a feature branch
|
|
220
|
+
3. Commit your changes
|
|
221
|
+
4. Open a Pull Request
|
|
222
|
+
|
|
223
|
+
Please follow:
|
|
224
|
+
|
|
225
|
+
* PEP-8 style
|
|
226
|
+
* Clear docstrings
|
|
227
|
+
* Basic tests for new features
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Documentation
|
|
233
|
+
|
|
234
|
+
The documentation is built using **Sphinx** with autodoc support.
|
|
235
|
+
|
|
236
|
+
Build locally:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
cd docs
|
|
240
|
+
uv run sphinx-build source build
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Then open:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
docs/build/index.html
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
This project is licensed under the **MIT License**.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Author
|
|
258
|
+
|
|
259
|
+
**Sewak Sunar**
|
|
260
|
+
Mechanical Engineering Enthusiast & Python Developer
|
|
261
|
+
|
|
262
|
+
GitHub: [https://github.com/sewaksunar](https://github.com/sewaksunar)
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Acknowledgements
|
|
267
|
+
|
|
268
|
+
Inspired by mechanical engineering textbooks and the open-source scientific Python ecosystem.
|
|
269
|
+
|
|
270
|
+
If you find **MechLab** useful, please ⭐ the repository on GitHub!
|
|
271
|
+
|
|
272
|
+
---
|