pymechlab 0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Xero64
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,228 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymechlab
3
+ Version: 0.1.0
4
+ Summary: Python Package for Mechanical Laboratory Testing
5
+ Author-email: Xero64 <xero64@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Xero64/pymechlab
8
+ Project-URL: Issues, https://github.com/Xero64/pymechlab/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: matplotlib>=3.10.6
15
+ Requires-Dist: numpy>=2.2.6
16
+ Requires-Dist: py2md>=0.1.3
17
+ Requires-Dist: scipy>=1.15.3
18
+ Requires-Dist: toleranceinterval>=1.0.3
19
+ Dynamic: license-file
20
+
21
+ # pymechlab
22
+ Python Package for Mechanical Laboratory Testing
23
+
24
+ This package is used for calculating the A-basis and B-Basis mechanical properties from mechanical laboratory test results and data.
25
+
26
+ An example from CMH-17 is shown below.
27
+
28
+ ## Input file 'cmh17_pg_8-87.json':
29
+
30
+ ```json
31
+ {
32
+ "Material": "Graphite/Epoxy",
33
+ "Property": "Compression Strength",
34
+ "Test Environment": "ETW",
35
+ "Program": "Qualification Data",
36
+ "batches": {
37
+ "1": {
38
+ "datasets": {
39
+ "1": {
40
+ "coupons": {
41
+ "1": 106.358,
42
+ "2": 105.899,
43
+ "3": 88.464,
44
+ "4": 103.902,
45
+ "5": 80.206,
46
+ "6": 109.2,
47
+ "7": 61.014
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "2": {
53
+ "datasets": {
54
+ "2": {
55
+ "coupons": {
56
+ "1": 99.321,
57
+ "2": 115.862,
58
+ "3": 82.613,
59
+ "4": 85.369,
60
+ "5": 115.802,
61
+ "6": 44.322,
62
+ "7": 117.328,
63
+ "8": 88.678
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "3": {
69
+ "datasets": {
70
+ "3": {
71
+ "coupons": {
72
+ "1": 107.677,
73
+ "2": 108.960,
74
+ "3": 116.123,
75
+ "4": 80.233,
76
+ "5": 106.146,
77
+ "6": 104.668,
78
+ "7": 104.235
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ ## Python script 'cmh17_script.py':
88
+
89
+ ```python
90
+ #%%
91
+ # Import Dependencies
92
+ from IPython.display import display_markdown
93
+
94
+ from pymechlab.classes.cmh17statistics import pool_from_json
95
+
96
+ #%%
97
+ # Import JSON File
98
+ jsonfilepath = '../files/cmh17_pg_8-87.json'
99
+ pool = pool_from_json(jsonfilepath)
100
+ display_markdown(pool)
101
+
102
+ #%%
103
+ # Import JSON File
104
+ jsonfilepath = '../files/cmh17_pg_8-92.json'
105
+ pool = pool_from_json(jsonfilepath)
106
+ display_markdown(pool)
107
+ ```
108
+
109
+ ## The output results in markdown are as follows:
110
+
111
+ | Pool Information | Value |
112
+ | :------------------ | -------------------: |
113
+ | Material | Graphite/Epoxy |
114
+ | Property | Compression Strength |
115
+ | Test Environment | ETW |
116
+ | Program | Qualification Data |
117
+ | Number of Specimens | 22 |
118
+ | Number of Batches | 3 |
119
+ | Number of Data Sets | 3 |
120
+ | Minimum Value | 44.322 |
121
+ | Maximum Value | 117.328 |
122
+
123
+ <br/>
124
+
125
+ | Batch ID | Data Set ID | Coupon ID | Data Values | Before Pooling | After Pooling |
126
+ | :------: | :---------: | :-------: | :---------: | :------------: | :-----------: |
127
+ | 1 | 1 | 1 | 106.358 | | |
128
+ | 1 | 1 | 2 | 105.899 | | |
129
+ | 1 | 1 | 3 | 88.464 | | |
130
+ | 1 | 1 | 4 | 103.902 | | |
131
+ | 1 | 1 | 5 | 80.206 | | |
132
+ | 1 | 1 | 6 | 109.2 | | |
133
+ | 1 | 1 | 7 | 61.014 | | |
134
+ | 2 | 2 | 1 | 99.321 | | |
135
+ | 2 | 2 | 2 | 115.862 | | |
136
+ | 2 | 2 | 3 | 82.613 | | |
137
+ | 2 | 2 | 4 | 85.369 | | |
138
+ | 2 | 2 | 5 | 115.802 | | |
139
+ | 2 | 2 | 6 | 44.322 | | X |
140
+ | 2 | 2 | 7 | 117.328 | | |
141
+ | 2 | 2 | 8 | 88.678 | | |
142
+ | 3 | 3 | 1 | 107.677 | | |
143
+ | 3 | 3 | 2 | 108.96 | | |
144
+ | 3 | 3 | 3 | 116.123 | | |
145
+ | 3 | 3 | 4 | 80.233 | X | |
146
+ | 3 | 3 | 5 | 106.146 | | |
147
+ | 3 | 3 | 6 | 104.668 | | |
148
+ | 3 | 3 | 7 | 104.235 | | |
149
+
150
+ <br/>
151
+
152
+ | Anderson k-Sample Test | Value |
153
+ | :---------------------------- | -------: |
154
+ | ADK Statistic | 0.328731 |
155
+ | AD Critical (&alpha; = 0.250) | 0.449259 |
156
+ | AD Critical (&alpha; = 0.100) | 1.30528 |
157
+ | AD Critical (&alpha; = 0.050) | 1.94342 |
158
+ | AD Critical (&alpha; = 0.025) | 2.57697 |
159
+ | AD Critical (&alpha; = 0.010) | 3.41635 |
160
+ | AD Critical (&alpha; = 0.005) | 4.0721 |
161
+ | AD Critical (&alpha; = 0.001) | 5.56419 |
162
+ | ADK p-value | 0.2888 |
163
+
164
+ <br/>
165
+
166
+ | Normal Distribution Statistics | Value |
167
+ | :-------------------------------- | ---------: |
168
+ | Observed Significance Level (OSL) | 0.00605107 |
169
+ | Mean | 96.9264 |
170
+ | Standard Deviation | 18.8048 |
171
+ | Coefficient of Variation (%) | 19.4012% |
172
+ | B-Basis Value | 61.4527 |
173
+ | A-Basis Value | 36.1265 |
174
+
175
+ <br/>
176
+
177
+ | Log Normal Distribution Statistics | Value |
178
+ | :--------------------------------- | ----------: |
179
+ | Observed Significance Level (OSL) | 0.000307372 |
180
+ | Log Mean | 4.55097 |
181
+ | Log Standard Deviation | 0.234756 |
182
+ | B-Basis Value | 60.8328 |
183
+ | A-Basis Value | 44.3433 |
184
+
185
+ <br/>
186
+
187
+ | Two Param Weibull Distribution Statistics | Value |
188
+ | :---------------------------------------- | --------: |
189
+ | Observed Significance Level (OSL) | 0.0218837 |
190
+ | Scale Parameter | 103.847 |
191
+ | Shape Parameter | 7.28576 |
192
+ | B-Basis Value | 66.864 |
193
+ | A-Basis Value | 43.1806 |
194
+
195
+ <br/>
196
+
197
+ | Non-Parametric Statistics | Value |
198
+ | :------------------------- | --------: |
199
+ | B-Basis Method | Hans-Koop |
200
+ | A-Basis Method | Hans-Koop |
201
+ | B-Basis Rank | 10 |
202
+ | A-Basis Rank | N/A |
203
+ | B-Basis Hans-Koop k Factor | 1.18418 |
204
+ | A-Basis Hans-Koop k Factor | 2.2602 |
205
+ | B-Basis Value | 37.8853 |
206
+ | A-Basis Value | 12.9966 |
207
+
208
+ <br/>
209
+
210
+ | Parameter | Value |
211
+ | :-------- | -------: |
212
+ | Fcalc | 1.50529 |
213
+ | pcalc | 0.247263 |
214
+ | Fcrit | 4.67443 |
215
+
216
+ <br/>
217
+
218
+ | ANOVA Statistics | Value |
219
+ | :--------------------------------------------- | ------: |
220
+ | Sample Between-batch Mean Sq. (MSB) | 257.302 |
221
+ | Error Mean Square (MSE) | 363.761 |
222
+ | Estimate of Pop. Std. Deviation(s) | 18.6873 |
223
+ | B-Basis Tolerance Limit Factor (T<sub>B</sub>) | 1.88641 |
224
+ | A-Basis Tolerance Limit Factor (T<sub>A</sub>) | 3.2332 |
225
+ | B-Basis Value | 61.6745 |
226
+ | A-Basis Value | 36.5067 |
227
+
228
+ <br/>
@@ -0,0 +1,208 @@
1
+ # pymechlab
2
+ Python Package for Mechanical Laboratory Testing
3
+
4
+ This package is used for calculating the A-basis and B-Basis mechanical properties from mechanical laboratory test results and data.
5
+
6
+ An example from CMH-17 is shown below.
7
+
8
+ ## Input file 'cmh17_pg_8-87.json':
9
+
10
+ ```json
11
+ {
12
+ "Material": "Graphite/Epoxy",
13
+ "Property": "Compression Strength",
14
+ "Test Environment": "ETW",
15
+ "Program": "Qualification Data",
16
+ "batches": {
17
+ "1": {
18
+ "datasets": {
19
+ "1": {
20
+ "coupons": {
21
+ "1": 106.358,
22
+ "2": 105.899,
23
+ "3": 88.464,
24
+ "4": 103.902,
25
+ "5": 80.206,
26
+ "6": 109.2,
27
+ "7": 61.014
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "2": {
33
+ "datasets": {
34
+ "2": {
35
+ "coupons": {
36
+ "1": 99.321,
37
+ "2": 115.862,
38
+ "3": 82.613,
39
+ "4": 85.369,
40
+ "5": 115.802,
41
+ "6": 44.322,
42
+ "7": 117.328,
43
+ "8": 88.678
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "3": {
49
+ "datasets": {
50
+ "3": {
51
+ "coupons": {
52
+ "1": 107.677,
53
+ "2": 108.960,
54
+ "3": 116.123,
55
+ "4": 80.233,
56
+ "5": 106.146,
57
+ "6": 104.668,
58
+ "7": 104.235
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ ## Python script 'cmh17_script.py':
68
+
69
+ ```python
70
+ #%%
71
+ # Import Dependencies
72
+ from IPython.display import display_markdown
73
+
74
+ from pymechlab.classes.cmh17statistics import pool_from_json
75
+
76
+ #%%
77
+ # Import JSON File
78
+ jsonfilepath = '../files/cmh17_pg_8-87.json'
79
+ pool = pool_from_json(jsonfilepath)
80
+ display_markdown(pool)
81
+
82
+ #%%
83
+ # Import JSON File
84
+ jsonfilepath = '../files/cmh17_pg_8-92.json'
85
+ pool = pool_from_json(jsonfilepath)
86
+ display_markdown(pool)
87
+ ```
88
+
89
+ ## The output results in markdown are as follows:
90
+
91
+ | Pool Information | Value |
92
+ | :------------------ | -------------------: |
93
+ | Material | Graphite/Epoxy |
94
+ | Property | Compression Strength |
95
+ | Test Environment | ETW |
96
+ | Program | Qualification Data |
97
+ | Number of Specimens | 22 |
98
+ | Number of Batches | 3 |
99
+ | Number of Data Sets | 3 |
100
+ | Minimum Value | 44.322 |
101
+ | Maximum Value | 117.328 |
102
+
103
+ <br/>
104
+
105
+ | Batch ID | Data Set ID | Coupon ID | Data Values | Before Pooling | After Pooling |
106
+ | :------: | :---------: | :-------: | :---------: | :------------: | :-----------: |
107
+ | 1 | 1 | 1 | 106.358 | | |
108
+ | 1 | 1 | 2 | 105.899 | | |
109
+ | 1 | 1 | 3 | 88.464 | | |
110
+ | 1 | 1 | 4 | 103.902 | | |
111
+ | 1 | 1 | 5 | 80.206 | | |
112
+ | 1 | 1 | 6 | 109.2 | | |
113
+ | 1 | 1 | 7 | 61.014 | | |
114
+ | 2 | 2 | 1 | 99.321 | | |
115
+ | 2 | 2 | 2 | 115.862 | | |
116
+ | 2 | 2 | 3 | 82.613 | | |
117
+ | 2 | 2 | 4 | 85.369 | | |
118
+ | 2 | 2 | 5 | 115.802 | | |
119
+ | 2 | 2 | 6 | 44.322 | | X |
120
+ | 2 | 2 | 7 | 117.328 | | |
121
+ | 2 | 2 | 8 | 88.678 | | |
122
+ | 3 | 3 | 1 | 107.677 | | |
123
+ | 3 | 3 | 2 | 108.96 | | |
124
+ | 3 | 3 | 3 | 116.123 | | |
125
+ | 3 | 3 | 4 | 80.233 | X | |
126
+ | 3 | 3 | 5 | 106.146 | | |
127
+ | 3 | 3 | 6 | 104.668 | | |
128
+ | 3 | 3 | 7 | 104.235 | | |
129
+
130
+ <br/>
131
+
132
+ | Anderson k-Sample Test | Value |
133
+ | :---------------------------- | -------: |
134
+ | ADK Statistic | 0.328731 |
135
+ | AD Critical (&alpha; = 0.250) | 0.449259 |
136
+ | AD Critical (&alpha; = 0.100) | 1.30528 |
137
+ | AD Critical (&alpha; = 0.050) | 1.94342 |
138
+ | AD Critical (&alpha; = 0.025) | 2.57697 |
139
+ | AD Critical (&alpha; = 0.010) | 3.41635 |
140
+ | AD Critical (&alpha; = 0.005) | 4.0721 |
141
+ | AD Critical (&alpha; = 0.001) | 5.56419 |
142
+ | ADK p-value | 0.2888 |
143
+
144
+ <br/>
145
+
146
+ | Normal Distribution Statistics | Value |
147
+ | :-------------------------------- | ---------: |
148
+ | Observed Significance Level (OSL) | 0.00605107 |
149
+ | Mean | 96.9264 |
150
+ | Standard Deviation | 18.8048 |
151
+ | Coefficient of Variation (%) | 19.4012% |
152
+ | B-Basis Value | 61.4527 |
153
+ | A-Basis Value | 36.1265 |
154
+
155
+ <br/>
156
+
157
+ | Log Normal Distribution Statistics | Value |
158
+ | :--------------------------------- | ----------: |
159
+ | Observed Significance Level (OSL) | 0.000307372 |
160
+ | Log Mean | 4.55097 |
161
+ | Log Standard Deviation | 0.234756 |
162
+ | B-Basis Value | 60.8328 |
163
+ | A-Basis Value | 44.3433 |
164
+
165
+ <br/>
166
+
167
+ | Two Param Weibull Distribution Statistics | Value |
168
+ | :---------------------------------------- | --------: |
169
+ | Observed Significance Level (OSL) | 0.0218837 |
170
+ | Scale Parameter | 103.847 |
171
+ | Shape Parameter | 7.28576 |
172
+ | B-Basis Value | 66.864 |
173
+ | A-Basis Value | 43.1806 |
174
+
175
+ <br/>
176
+
177
+ | Non-Parametric Statistics | Value |
178
+ | :------------------------- | --------: |
179
+ | B-Basis Method | Hans-Koop |
180
+ | A-Basis Method | Hans-Koop |
181
+ | B-Basis Rank | 10 |
182
+ | A-Basis Rank | N/A |
183
+ | B-Basis Hans-Koop k Factor | 1.18418 |
184
+ | A-Basis Hans-Koop k Factor | 2.2602 |
185
+ | B-Basis Value | 37.8853 |
186
+ | A-Basis Value | 12.9966 |
187
+
188
+ <br/>
189
+
190
+ | Parameter | Value |
191
+ | :-------- | -------: |
192
+ | Fcalc | 1.50529 |
193
+ | pcalc | 0.247263 |
194
+ | Fcrit | 4.67443 |
195
+
196
+ <br/>
197
+
198
+ | ANOVA Statistics | Value |
199
+ | :--------------------------------------------- | ------: |
200
+ | Sample Between-batch Mean Sq. (MSB) | 257.302 |
201
+ | Error Mean Square (MSE) | 363.761 |
202
+ | Estimate of Pop. Std. Deviation(s) | 18.6873 |
203
+ | B-Basis Tolerance Limit Factor (T<sub>B</sub>) | 1.88641 |
204
+ | A-Basis Tolerance Limit Factor (T<sub>A</sub>) | 3.2332 |
205
+ | B-Basis Value | 61.6745 |
206
+ | A-Basis Value | 36.5067 |
207
+
208
+ <br/>
@@ -0,0 +1,26 @@
1
+ [project]
2
+ name = "pymechlab"
3
+ version = "0.1.0"
4
+ authors = [
5
+ { name="Xero64", email="xero64@gmail.com" },
6
+ ]
7
+ description = "Python Package for Mechanical Laboratory Testing"
8
+ readme = "README.md"
9
+ requires-python = ">=3.10"
10
+ classifiers = [
11
+ "Programming Language :: Python :: 3",
12
+ "Operating System :: OS Independent",
13
+ ]
14
+ license = "MIT"
15
+ license-files = ["LICEN[CS]E*"]
16
+ dependencies = [
17
+ "matplotlib>=3.10.6",
18
+ "numpy>=2.2.6",
19
+ "py2md>=0.1.3",
20
+ "scipy>=1.15.3",
21
+ "toleranceinterval>=1.0.3",
22
+ ]
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/Xero64/pymechlab"
26
+ Issues = "https://github.com/Xero64/pymechlab/issues"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from .classes.batchresult import batch_from_json as batch_from_json
File without changes