PyGamLab 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

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.
PyGamLab/Constants.py CHANGED
@@ -64,7 +64,6 @@ pi = 3.14159
64
64
  e = 2.71828
65
65
  g = 9.81 # Gravitational constant
66
66
  h = 6.634 * 10**-34 # constant pelank
67
- k , b = 1.38 * 10 ** -23 # J/mjck constant of boltzman
68
67
  tau = 6.28
69
68
  R =0.08206 #unit = ((L*atm) / (mol*k)) # Global constant of gases
70
69
  pi=3.14
@@ -248,7 +247,6 @@ Tm=14.025 ## hydrojen melting point in K
248
247
 
249
248
  vacuum_permeability=1
250
249
  π=3.14
251
- G=6.674 * 10^-11
252
250
  e=2.71828
253
251
  k=9*10**9
254
252
 
@@ -413,7 +411,6 @@ NA = 6.023*10**23
413
411
  # Faraday's Constant
414
412
  F= 96485 #C/mole
415
413
  #Boltzmann Constant
416
- k_B = 1.381*10**-23 #J/K
417
414
  #Planck's Constant
418
415
  h = 6.626*10**-34 #JS
419
416
 
PyGamLab/Data_Analysis.py CHANGED
@@ -187,46 +187,10 @@ def Energie(input_file,which):
187
187
 
188
188
 
189
189
 
190
- def Stress_Strain1(input_file,which,count):
191
- '''
192
- This function claculates the stress and strain
193
- Parameters from load and elongation data
194
- ----------
195
- input_file : .csv format
196
- the file must be inserted in csv.
197
- whcih : str
198
- please say which work we do ( plot or calculate?).
199
- count: int
200
- please enter the yarn count in Tex
201
- remember: gauge length has been set in 250 mm
202
- '''
203
-
204
- #convert the file
205
- mydf=pd.read_csv(input_file)
206
-
207
- if which=='plot':
208
-
209
- stress=mydf['Load']/count
210
- strain=mydf['Extension']/250
211
- plt.plot(stress,strain)
212
- plt.title('stress-strain curve')
213
- plt.xlabel('stress')
214
- plt.ylabel('strain')
215
- plt.show()
216
-
217
-
218
- if which=='max stress':
219
- stress_max=mydf['stress'].max()
220
- return stress_max
221
-
222
- if which=='max strain':
223
- strain_max=mydf['strain'].max()
224
- return strain_max
225
190
 
226
191
 
227
192
 
228
-
229
- def Strain_Stress2(df,operation):
193
+ def Stress_Strain1(df,operation,L0=90,D0=9):
230
194
  '''
231
195
 
232
196
 
@@ -239,17 +203,17 @@ def Strain_Stress2(df,operation):
239
203
  df : DataFrame
240
204
  It has 2 columns: DL(which is length in mm) & F (which is the force in N).
241
205
  operation :
242
- It tells the function to whether Plot the curve or find the UTS valu.
206
+ It tells the function to whether PLOT the curve or find the UTS valu.
207
+
208
+ L0: initial length of the sample
209
+ D0: initial diameter of the sample
243
210
 
244
211
  Returns
245
212
  -------
246
213
  The Stress-Strain curve or the amount of UTS
247
214
 
248
215
  '''
249
- L0 = 40
250
- #L0: initial length of the sample
251
- D0 = 9
252
- #D0: initial diameter of the sample
216
+
253
217
  A0 = math.pi / 4 * (D0 ** 2)
254
218
  df['e'] = df['DL'] / L0
255
219
  df['S'] = df['F'] / A0
@@ -271,6 +235,44 @@ def Strain_Stress2(df,operation):
271
235
 
272
236
 
273
237
 
238
+
239
+ def Stress_Strain2(input_file,which,count):
240
+ '''
241
+ This function claculates the stress and strain
242
+ Parameters from load and elongation data
243
+ ----------
244
+ input_file : .csv format
245
+ the file must be inserted in csv.
246
+ whcih : str
247
+ please say which work we do ( plot or calculate?).
248
+ count: int
249
+ please enter the yarn count in Tex
250
+ remember: gauge length has been set in 250 mm
251
+ '''
252
+
253
+ #convert the file
254
+ mydf=pd.read_csv(input_file)
255
+
256
+ if which=='plot':
257
+
258
+ stress=mydf['Load']/count
259
+ strain=mydf['Extension']/250
260
+ plt.plot(stress,strain)
261
+ plt.title('stress-strain curve')
262
+ plt.xlabel('stress')
263
+ plt.ylabel('strain')
264
+ plt.show()
265
+
266
+
267
+ if which=='max stress':
268
+ stress_max=mydf['stress'].max()
269
+ return stress_max
270
+
271
+ if which=='max strain':
272
+ strain_max=mydf['strain'].max()
273
+ return strain_max
274
+
275
+
274
276
  def Stress_Strain3(input_data, action):
275
277
  stress = input_data['Stress (MPa)']
276
278
  strain = input_data['Strain (%)']
@@ -1251,10 +1253,10 @@ def Xrd_Analysis(data, operation):
1251
1253
  operation : str
1252
1254
  determine an operation which apply on data
1253
1255
  possible values:
1254
- information
1255
1256
  max intensity
1256
1257
  scatter plot
1257
1258
  line graph
1259
+ line graph fill between
1258
1260
  Returns
1259
1261
  -------
1260
1262
  max intensity and degree of max intensity
PyGamLab/__init__.py CHANGED
@@ -43,3 +43,11 @@ Y88b. 88 Y88..88PP. 888 888 888 888...... Y88..88PP. 888 888
43
43
  '''
44
44
 
45
45
 
46
+
47
+ __version__ = "0.1.1"
48
+
49
+
50
+
51
+ __all__ = ["Constants", "Convertors", "Functions", "Data_Analysis"]
52
+
53
+
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyGamLab
3
+ Version: 0.1.1
4
+ Summary: A scientific Python library with constants, unit convertors, formulas, and data analysis tools.
5
+ Home-page: https://github.com/APMaii/pygamlab/tree/main
6
+ Author: Ali Pilehvar Meibody
7
+ Author-email: Ali Pilehvar Meibody <ai.2024.pilehvar@Gmail.com>
8
+ License-Expression: MIT
9
+ Project-URL: Source, https://github.com/APMaii/pygamlab/tree/main
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Topic :: Scientific/Engineering
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: numpy
17
+ Requires-Dist: pandas
18
+ Requires-Dist: scipy
19
+ Requires-Dist: matplotlib
20
+ Requires-Dist: seaborn
21
+ Requires-Dist: scikit-learn
22
+ Dynamic: author
23
+ Dynamic: home-page
24
+ Dynamic: requires-python
25
+
26
+ # PyGamLab
27
+
28
+ **PyGamLab** is a scientific Python library developed for researchers, engineers, and students who need access to fundamental constants, conversion tools, engineering formulas, and data analysis utilities. The package is designed with simplicity, clarity, and usability in mind.
29
+
30
+ ---
31
+
32
+ ## 📌 Overview
33
+
34
+ **PyGAMLab** stands for *Python GAMLAb tools*, a collection of scientific tools and functions developed at the **GAMLab** by **Ali Pilehvar Meibody** under the supervision of **Prof. Malek Naderi** at **Gamlab (Graphene and Advanced Material Laboratory)** under supervision of **Amirkabir University of Technology (AUT)**.
35
+
36
+ - **Author:** Ali Pilehvar Meibody
37
+ - **Supervisor:** Prof. Naderi
38
+ - **Affiliation:** GAMLab, Amirkabir University of Technology (AUT)
39
+
40
+ ---
41
+
42
+ ## 📦 Modules
43
+
44
+ PyGAMLab is composed of **four core modules**, each focused on a specific area of scientific computation:
45
+
46
+ ### 🔹 ` Constants.py`
47
+ This module includes a comprehensive set of scientific constants used in physics, chemistry, and engineering.
48
+
49
+ Examples:
50
+ - Planck's constant
51
+ - Boltzmann constant
52
+ - Speed of light
53
+ - Universal gas constant
54
+ - Density of Metals
55
+ - Tm of Metals
56
+ - And many more...
57
+
58
+ ---
59
+
60
+ ### 🔹 `Convertors.py`
61
+ Contains unit conversion functions that follow the format:
62
+ `FirstUnit_To_SecondUnit()`
63
+
64
+ Examples:
65
+ - `Kelvin_To_Celsius(k)`
66
+ - `Celsius_To_Kelvin(c)`
67
+ - `Meter_To_Foot(m)`
68
+ - ...and many more standard conversions used in science and engineering.
69
+
70
+ ---
71
+
72
+ ### 🔹 `Functions.py`
73
+ This module provides a wide collection of **scientific formulas and functional tools** commonly used in engineering applications.
74
+
75
+ Examples:
76
+ - Thermodynamics equations
77
+ - Mechanical stress and strain calculations
78
+ - Fluid dynamics formulas
79
+ - General utility functions
80
+
81
+ ---
82
+
83
+ ### 🔹 `Data_Analysis.py`
84
+ Provides tools for working with data, either from a **file path** or directly from a **DataFrame**.
85
+
86
+ Features include:
87
+ - Reading and preprocessing datasets
88
+ - Performing scientific calculations
89
+ - Creating visualizations (e.g., line plots, scatter plots, histograms)
90
+
91
+
92
+
93
+ ---
94
+
95
+ ## 📦 Requirements
96
+
97
+ To use **PyGamLab**, make sure you have the following Python packages installed:
98
+
99
+ - `numpy`
100
+ - `pandas`
101
+ - `scipy`
102
+ - `matplotlib`
103
+ - `seaborn`
104
+ - `scikit-learn`
105
+
106
+ You can install all dependencies using:
107
+
108
+ ```bash
109
+ pip install numpy pandas scipy matplotlib seaborn scikit-learn
110
+ ```
111
+
112
+
113
+
114
+ ---
115
+
116
+ ## 🚀 Installation
117
+
118
+ To install PyGAMLab via pip (after uploading it to PyPI):
119
+
120
+ ```bash
121
+ pip install pygamlab
122
+ ```
123
+
124
+ or
125
+
126
+ ```bash
127
+ git clone https://github.com/APMaii/pygamlab.git
128
+ ```
129
+
130
+ ---
131
+
132
+ ## 📖 Usage Example
133
+
134
+ ```python
135
+ import PyGamLab
136
+
137
+ #--------------Constants-----------------------
138
+
139
+ print(PyGamLab.Constants.melting_point_of_Cu)
140
+ print(PyGamLab.Constants.melting_point_of_Al)
141
+ print(PyGamLab.Constants.Fe_Tm_Alpha)
142
+ print(PyGamLab.Constants.Fe_Tm_Gama)
143
+
144
+ print(PyGamLab.Constants.Boltzmann_Constant)
145
+ print(PyGamLab.Constants.Faraday_Constant)
146
+
147
+ #----------------Convertors---------------------
148
+
149
+ print(PyGamLab.Convertos.Kelvin_to_Celcius(300))
150
+ print(PyGamLab.Convertos.Coulomb_To_Electron_volt())
151
+ print(PyGamLab.Convertos.Angstrom_To_Milimeter())
152
+ print(PyGamLab.Convertos.Bar_To_Pascal())
153
+
154
+ #------------Functions-----------------------
155
+
156
+ PyGamLab.Functions.Gibs_free_energy(H0,T,S0)
157
+
158
+
159
+ PyGamLab.Functions.Bragg_Law(h, k, l, a, y)
160
+
161
+
162
+ PyGamLab.Functions.Electrical_Resistance(v,i)
163
+
164
+
165
+ PyGamLab.Functions.Hall_Petch(d_grain,sigma0,k)
166
+
167
+ #-----------Data_Analysis--------------------
168
+ import pandas as pd
169
+
170
+ df= pd.read_csv('/users/apm/....../data.csv')
171
+ PyGamLab.Data_Analysis.Stress_Strain1(df, 'PLOT')
172
+ my_uts=PyGamLab.Data_Analysis.Stress_Strain1(df, 'UTS')
173
+
174
+
175
+ data=pd.read_csv('/users/apm/....../data.csv')
176
+ my_max=PyGamLab.Data_Analysis.Xrd_Analysis(data,'max intensity')
177
+ PyGamLab.Data_Analysis.Xrd_Analysis(data,'scatter plot')
178
+ PyGamLab.Data_Analysis.Xrd_Analysis(data,'line graph')
179
+
180
+ ```
181
+
182
+
183
+ ---
184
+
185
+ ## Structure
186
+ ```
187
+ pygamlab/
188
+ ├── __init__.py
189
+ ├── Constants.py
190
+ ├── Convertors.py
191
+ ├── Functions.py
192
+ ├── Data_Analysis.py
193
+ └── contributers.md
194
+
195
+ ```
196
+
197
+
198
+ ---
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ ---
208
+ ## 🤝 Contributing
209
+
210
+ **Contributions** are welcome! Here's how to get started:
211
+
212
+ Fork the repository.
213
+ Create your feature branch
214
+
215
+ ```bash
216
+ git checkout -b feature/my-feature
217
+ ```
218
+ Commit your changes
219
+ ```bash
220
+ git commit -am 'Add some feature'
221
+ ```
222
+ Push to the branch
223
+ ```bash
224
+ git push origin feature/my-feature
225
+ ```
226
+ Create a new Pull Request.
227
+ Please make sure to update tests as appropriate and follow PEP8 guidelines.
228
+
229
+
230
+
231
+ ---
232
+ ## 📄 License
233
+
234
+ This project is licensed under the MIT License — see the LICENSE.txt file for details
235
+
236
+
237
+
238
+ ---
239
+
240
+ ## 🙏 Acknowledgements
241
+
242
+ This project is part of the scientific research activities at **GAMLab (Generalized Applied Mechanics Laboratory)** at **Amirkabir University of Technology (AUT)**.
243
+
244
+ Special thanks to:
245
+
246
+ - **Prof. Nader** – For his guidance, mentorship, and continuous support.
247
+ - **Ali Pilehvar Meibody** – Main developer and author of PyGamLab.
248
+ - **GAMLab Research Group** – For providing a collaborative and innovative environment.
249
+
250
+ We would also like to thank **all the students who participated in the GAMLab AI course** and contributed to the growth and feedback of this project. Their names are proudly listed in the [contributors.md](contributors.md) file.
251
+
252
+ This project was made possible thanks to the powerful Python open-source ecosystem:
253
+ `NumPy`, `SciPy`, `Pandas`, `Matplotlib`, `Seaborn`, `Scikit-learn`, and many more.
254
+
255
+ ---
256
+
257
+
258
+
259
+
260
+
261
+
@@ -0,0 +1,9 @@
1
+ PyGamLab/Constants.py,sha256=hupfOwj-2ofXWSPvsdO_WZgyKxoCTZl_Uxq3uB3C-yw,16927
2
+ PyGamLab/Convertos.py,sha256=f2-hfi1jJOeWBrCWJBWiRGZfPy3uhROHKj_iIvlOmA4,31575
3
+ PyGamLab/Data_Analysis.py,sha256=-hlQE3APk2eVwwZuMvMRdqSeV_pwkMq9a85v71zvLVw,109917
4
+ PyGamLab/Functions.py,sha256=fFZ2nCMtDHsEKqfDbLd8fJWPnFQzaS5V8CrJ-Y4Rde8,111881
5
+ PyGamLab/__init__.py,sha256=Jk2e1ZsFaemg_xhfpAcY6Ul_6ixjrBMfnea81xMFY2s,1959
6
+ pygamlab-0.1.1.dist-info/METADATA,sha256=rjaEHzWwi6djkPsQNR2c0TrbsypVa8bLyNMMhWdN-Ds,6294
7
+ pygamlab-0.1.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ pygamlab-0.1.1.dist-info/top_level.txt,sha256=E5IBZwx9PoAR8NyXgNAT3iUIuGvYfJlfyOKQY1sNkXU,9
9
+ pygamlab-0.1.1.dist-info/RECORD,,
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: PyGamLab
3
- Version: 0.1.0
4
- Summary: A scientific Python library with constants, unit convertors, formulas, and data analysis tools.
5
- Home-page: https://github.com/APMaii/pygamlab/tree/main
6
- Author: Ali Pilehvar Meibody
7
- Author-email: Ali Pilehvar Meibody <ai.2024.pilehvar@Gmail.com>
8
- License-Expression: MIT
9
- Project-URL: Source, https://github.com/APMaii/pygamlab/tree/main
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: Topic :: Scientific/Engineering
14
- Requires-Python: >=3.7
15
- Description-Content-Type: text/markdown
16
- Requires-Dist: numpy
17
- Requires-Dist: pandas
18
- Requires-Dist: scipy
19
- Requires-Dist: matplotlib
20
- Requires-Dist: seaborn
21
- Requires-Dist: scikit-learn
22
- Dynamic: author
23
- Dynamic: home-page
24
- Dynamic: requires-python
25
-
26
- # PyGamMLab
27
-
28
- **PyGAMLab** is a scientific Python library developed for researchers, engineers, and students who need access to fundamental constants, conversion tools, engineering formulas, and data analysis utilities. The package is designed with simplicity, clarity, and usability in mind.
29
-
30
- ---
31
-
32
- ## 📌 Overview
33
-
34
- **PyGAMLab** stands for *Python GAMLAb tools*, a collection of scientific tools and functions developed at the **GAMLab** under the supervision of **Prof. Nader** at **Amirkabir University of Technology (AUT)**.
35
-
36
- - **Author:** Ali Pilehvar Meibody
37
- - **Supervisor:** Prof. Nader
38
- - **Affiliation:** GAMLab, Amirkabir University of Technology (AUT)
39
-
40
- ---
41
-
42
- ## 📦 Modules
43
-
44
- PyGAMLab is composed of **four core modules**, each focused on a specific area of scientific computation:
45
-
46
- ### 🔹 `constants.py`
47
- This module includes a comprehensive set of scientific constants used in physics, chemistry, and engineering.
48
-
49
- Examples:
50
- - Planck's constant
51
- - Boltzmann constant
52
- - Speed of light
53
- - Universal gas constant
54
- - And many more...
55
-
56
- ---
57
-
58
- ### 🔹 `convertors.py`
59
- Contains unit conversion functions that follow the format:
60
- `FirstUnit_To_SecondUnit()`
61
-
62
- Examples:
63
- - `Kelvin_To_Celsius(k)`
64
- - `Pascal_To_Bar(p)`
65
- - `Meter_To_Foot(m)`
66
- - ...and many more standard conversions used in science and engineering.
67
-
68
- ---
69
-
70
- ### 🔹 `functions.py`
71
- This module provides a wide collection of **scientific formulas and functional tools** commonly used in engineering applications.
72
-
73
- Examples:
74
- - Thermodynamics equations
75
- - Mechanical stress and strain calculations
76
- - Fluid dynamics formulas
77
- - General utility functions
78
-
79
- ---
80
-
81
- ### 🔹 `data_analysis.py`
82
- Provides tools for working with data, either from a **file path** or directly from a **DataFrame**.
83
-
84
- Features include:
85
- - Reading and preprocessing datasets
86
- - Performing scientific calculations
87
- - Creating visualizations (e.g., line plots, scatter plots, histograms)
88
-
89
- ---
90
-
91
- ## 🚀 Installation
92
-
93
- To install PyGAMLab via pip (after uploading it to PyPI):
94
-
95
- ```bash
96
- pip install pygamlab
97
- ```
98
-
99
-
100
- ---
101
-
102
- ## 📖 Usage Example
103
-
104
- ```python
105
- from pygamlab import Kelvin_To_Celsius, universal_gas_constant
106
- from pygamlab import calculate_stress
107
- from pygamlab import plot_from_csv
108
-
109
- # Convert temperature
110
- print(Kelvin_To_Celsius(300))
111
-
112
- # Use a constant
113
- print(universal_gas_constant)
114
-
115
- # Use an engineering function
116
- stress = calculate_stress(force=500, area=0.01)
117
- print(stress)
118
-
119
- # Analyze a dataset
120
- plot_from_csv("data/experiment.csv", column_x="Time", column_y="Temperature")
121
- ```
122
-
@@ -1,9 +0,0 @@
1
- PyGamLab/Constants.py,sha256=_LFtAgTezfPSc9oS3nr9Dk81sQIqQOQIeGIVRNvosiY,17065
2
- PyGamLab/Convertos.py,sha256=f2-hfi1jJOeWBrCWJBWiRGZfPy3uhROHKj_iIvlOmA4,31575
3
- PyGamLab/Data_Analysis.py,sha256=nf3js_oAWJ80Ja-c4N0QskDo_y7B2o82W5U-0M_3F-I,109894
4
- PyGamLab/Functions.py,sha256=fFZ2nCMtDHsEKqfDbLd8fJWPnFQzaS5V8CrJ-Y4Rde8,111881
5
- PyGamLab/__init__.py,sha256=0qtyDfXr6_Zvr4K27cV_Gjn9o27o4t8j515uar5koG8,1863
6
- pygamlab-0.1.0.dist-info/METADATA,sha256=hn7v-M5TEGdzTpmSHjuQ02KOSZRBN-Vus66fWERRsCk,3353
7
- pygamlab-0.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- pygamlab-0.1.0.dist-info/top_level.txt,sha256=E5IBZwx9PoAR8NyXgNAT3iUIuGvYfJlfyOKQY1sNkXU,9
9
- pygamlab-0.1.0.dist-info/RECORD,,