corrosim 1.0.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.
corrosim-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 khadev
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,258 @@
1
+ Metadata-Version: 2.4
2
+ Name: corrosim
3
+ Version: 1.0.0
4
+ Summary: Professional Corrosion Analysis Platform
5
+ Home-page: https://github.com/khadev/CorroSim
6
+ Author: Khaled Oukil
7
+ Author-email: oukil.khaled@gmail.com
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: PyQt6>=6.5.0
20
+ Requires-Dist: matplotlib>=3.7.0
21
+ Requires-Dist: numpy>=1.24.0
22
+ Requires-Dist: pandas>=2.0.0
23
+ Requires-Dist: scipy>=1.10.0
24
+ Requires-Dist: openpyxl>=3.1.0
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
36
+
37
+ # โšก CorroSim - Professional Corrosion Analysis Platform
38
+
39
+ [![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)
40
+ [![PyQt6](https://img.shields.io/badge/PyQt-6.0+-green.svg)](https://www.riverbankcomputing.com/software/pyqt/)
41
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
42
+ [![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](tests/)
43
+
44
+ A comprehensive desktop application for electrochemical corrosion analysis, featuring Tafel polarization fitting, lifetime prediction, and multi-sample comparison.
45
+
46
+ ## โœจ Features
47
+
48
+ ### ๐Ÿ”ฌ Tafel Polarization Analysis
49
+ - Automatic detection of current units (A, mA, ฮผA)
50
+ - Proper Tafel region identification (80-200 mV from Ecorr)
51
+ - Verified Butler-Volmer kinetics fitting
52
+ - Real-time visualization with Matplotlib
53
+ - Export plots as PNG or PDF
54
+
55
+ ### ๐Ÿ”ฎ Lifetime Prediction
56
+ - Linear, Power Law, and Exponential degradation models
57
+ - Confidence band visualization
58
+ - Service life estimation with threshold detection
59
+ - Interactive parameter adjustment
60
+
61
+ ### ๐Ÿ“Š Sample Comparison
62
+ - Multi-sample database with SQLite storage
63
+ - Search and filter functionality
64
+ - Color-coded corrosion rate indicators
65
+ - Export to Excel for further analysis
66
+
67
+ ### ๐Ÿ“ Data Import
68
+ - Support for Excel (.xlsx, .xls) and CSV files
69
+ - Automatic column detection
70
+ - Data preview with statistics
71
+ - Unit specification options
72
+
73
+ ### ๐ŸŽจ Professional UI
74
+ - Modern, responsive interface with PyQt6
75
+ - Custom splash screen with progress indicator
76
+ - Consistent styling with professional color theme
77
+ - Sidebar navigation with active state indicators
78
+
79
+ ## ๐Ÿ“ธ Screenshots
80
+
81
+ <div align="center">
82
+
83
+ ### ๐Ÿ–ฅ๏ธ Main Application
84
+ <img src="screenshots/main_window.png" alt="Main Window" width="800"/>
85
+
86
+ ### โšก Tafel Analysis
87
+ <img src="screenshots/tafel_tab.png" alt="Tafel Analysis" width="800"/>
88
+
89
+ ### ๐Ÿ“ Data Import
90
+ <img src="screenshots/import_tab.png" alt="Data Import" width="800"/>
91
+
92
+ ### ๐Ÿ”ฎ Lifetime Prediction
93
+ <img src="screenshots/prediction_tab.png" alt="Prediction" width="800"/>
94
+
95
+ ### ๐Ÿ“Š Sample Comparison
96
+ <img src="screenshots/comparison_tab.png" alt="Comparison" width="800"/>
97
+
98
+ </div>
99
+
100
+ ## ๐Ÿš€ Installation
101
+
102
+ ### Prerequisites
103
+ - Python 3.8 or higher
104
+ - pip package manager
105
+
106
+ ### Quick Install
107
+
108
+
109
+ # Clone the repository
110
+ git clone https://github.com/khadev/corrosim.git
111
+ cd corrosim
112
+
113
+ # Install dependencies
114
+ pip install -r requirements.txt
115
+
116
+ # Run the application
117
+ python run.py
118
+
119
+
120
+ ### Install as Package
121
+
122
+
123
+ pip install -e .
124
+ corrosim
125
+
126
+
127
+ ### Direct Install from GitHub
128
+
129
+
130
+ pip install git+https://github.com/khadev/corrosim.git
131
+ corrosim
132
+
133
+
134
+ ## ๐Ÿ“ฆ Dependencies
135
+
136
+ txt
137
+ PyQt6>=6.5.0
138
+ matplotlib>=3.7.0
139
+ numpy>=1.24.0
140
+ pandas>=2.0.0
141
+ scipy>=1.10.0
142
+ openpyxl>=3.1.0
143
+
144
+
145
+ ## ๐Ÿงช Running Tests
146
+
147
+
148
+ python tests/test_tafel.py
149
+
150
+
151
+ Expected output:
152
+
153
+ โœ“ Test data generation passed
154
+ โœ“ All accuracy checks passed!
155
+
156
+
157
+ ## ๐Ÿ“– Usage Guide
158
+
159
+ ### 1. Import Data
160
+ 1. Click **๐Ÿ“ Import** in the sidebar
161
+ 2. Browse and select your Excel/CSV file
162
+ 3. Click **Load Preview** to verify data
163
+ 4. Enter sample name and select test type
164
+ 5. Specify current units (or use Auto-detect)
165
+ 6. Click **Import to Database**
166
+
167
+ ### 2. Tafel Analysis
168
+ 1. Navigate to **โšก Tafel** tab
169
+ 2. Click **Load Data** to retrieve imported data
170
+ 3. Verify current units and electrode area
171
+ 4. Click **โšก Run Tafel Analysis**
172
+ 5. View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
173
+ 6. Export plot as PNG or PDF
174
+
175
+ ### 3. Lifetime Prediction
176
+ 1. Go to **๐Ÿ”ฎ Prediction** tab
177
+ 2. Select degradation model (Linear/Power Law/Exponential)
178
+ 3. Set initial corrosion rate and failure threshold
179
+ 4. Set analysis period
180
+ 5. Click **๐Ÿ”ฎ Calculate Prediction**
181
+ 6. View predicted lifetime and degradation curve
182
+
183
+ ### 4. Compare Samples
184
+ 1. Open **๐Ÿ“Š Compare** tab
185
+ 2. Search and filter samples by name
186
+ 3. View all analysis results in sortable table
187
+ 4. Color-coded CR values: Green (low), Yellow (medium), Red (high)
188
+ 5. Export data to Excel
189
+
190
+ ## ๐Ÿ—๏ธ Project Structure
191
+
192
+
193
+ corrosim/
194
+ โ”œโ”€โ”€ corrosim/ # Main package
195
+ โ”‚ โ”œโ”€โ”€ __init__.py
196
+ โ”‚ โ”œโ”€โ”€ main.py # Entry point
197
+ โ”‚ โ”œโ”€โ”€ app.py # Main window
198
+ โ”‚ โ”œโ”€โ”€ theme.py # UI styling
199
+ โ”‚ โ”œโ”€โ”€ database.py # SQLite database
200
+ โ”‚ โ”œโ”€โ”€ tafel_engine.py # Analysis algorithms
201
+ โ”‚ โ”œโ”€โ”€ splash_screen.py # Splash screen
202
+ โ”‚ โ”œโ”€โ”€ tabs/ # Tab modules
203
+ โ”‚ โ”‚ โ”œโ”€โ”€ import_tab.py
204
+ โ”‚ โ”‚ โ”œโ”€โ”€ tafel_tab.py
205
+ โ”‚ โ”‚ โ”œโ”€โ”€ prediction_tab.py
206
+ โ”‚ โ”‚ โ””โ”€โ”€ comparison_tab.py
207
+ โ”‚ โ””โ”€โ”€ utils/
208
+ โ”‚ โ””โ”€โ”€ constants.py # Physical constants
209
+ โ”œโ”€โ”€ tests/
210
+ โ”‚ โ””โ”€โ”€ test_tafel.py # Validation tests
211
+ โ”œโ”€โ”€ screenshots/ # Application screenshots
212
+ โ”œโ”€โ”€ requirements.txt
213
+ โ”œโ”€โ”€ setup.py
214
+ โ”œโ”€โ”€ run.py
215
+ โ”œโ”€โ”€ README.md
216
+ โ”œโ”€โ”€ LICENSE
217
+ โ””โ”€โ”€ .gitignore
218
+
219
+
220
+ ## ๐Ÿ”ฌ Algorithm Verification
221
+
222
+ The Tafel engine has been validated using synthetic Butler-Volmer data:
223
+
224
+ | Parameter | Expected | Recovered | Error |
225
+ |-----------|----------|-----------|-------|
226
+ | Ecorr | -0.500 V | -0.502 V | 0.4% |
227
+ | Icorr | 10.0 ฮผA/cmยฒ | 9.5 ฮผA/cmยฒ | 5.0% |
228
+ | ฮฒa | 120 mV/dec | 118.1 mV/dec | 1.6% |
229
+ | ฮฒc | 120 mV/dec | 118.4 mV/dec | 1.3% |
230
+ | Rยฒ | โ€” | 0.9997 | โ€” |
231
+
232
+ ## ๐Ÿค Contributing
233
+
234
+ 1. Fork the repository
235
+ 2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
236
+ 3. Commit your changes (`git commit -m 'Add feature'`)
237
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
238
+ 5. Open a Pull Request
239
+
240
+ ## ๐Ÿ“„ License
241
+
242
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
243
+
244
+ ## ๐Ÿ‘ค Author
245
+
246
+ **Khaled Oukil**
247
+ - GitHub: [@khadev](https://github.com/khadev)
248
+ - Email: oukil.khaled@gmail.com
249
+
250
+ ## ๐Ÿ“š References
251
+
252
+ 1. Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. *Journal of the Electrochemical Society*, 104(1), 56-63.
253
+ 2. Tafel, J. (1905). รœber die Polarisation bei kathodischer Wasserstoffentwicklung. *Zeitschrift fรผr Physikalische Chemie*, 50(1), 641-712.
254
+ 3. ASTM G102-89(2015) - Standard Practice for Calculation of Corrosion Rates from Electrochemical Measurements.
255
+
256
+
257
+
258
+ **Built with โค๏ธ for the corrosion science community**
@@ -0,0 +1,223 @@
1
+
2
+ # โšก CorroSim - Professional Corrosion Analysis Platform
3
+
4
+ [![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)
5
+ [![PyQt6](https://img.shields.io/badge/PyQt-6.0+-green.svg)](https://www.riverbankcomputing.com/software/pyqt/)
6
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+ [![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](tests/)
8
+
9
+ A comprehensive desktop application for electrochemical corrosion analysis, featuring Tafel polarization fitting, lifetime prediction, and multi-sample comparison.
10
+
11
+ ## โœจ Features
12
+
13
+ ### ๐Ÿ”ฌ Tafel Polarization Analysis
14
+ - Automatic detection of current units (A, mA, ฮผA)
15
+ - Proper Tafel region identification (80-200 mV from Ecorr)
16
+ - Verified Butler-Volmer kinetics fitting
17
+ - Real-time visualization with Matplotlib
18
+ - Export plots as PNG or PDF
19
+
20
+ ### ๐Ÿ”ฎ Lifetime Prediction
21
+ - Linear, Power Law, and Exponential degradation models
22
+ - Confidence band visualization
23
+ - Service life estimation with threshold detection
24
+ - Interactive parameter adjustment
25
+
26
+ ### ๐Ÿ“Š Sample Comparison
27
+ - Multi-sample database with SQLite storage
28
+ - Search and filter functionality
29
+ - Color-coded corrosion rate indicators
30
+ - Export to Excel for further analysis
31
+
32
+ ### ๐Ÿ“ Data Import
33
+ - Support for Excel (.xlsx, .xls) and CSV files
34
+ - Automatic column detection
35
+ - Data preview with statistics
36
+ - Unit specification options
37
+
38
+ ### ๐ŸŽจ Professional UI
39
+ - Modern, responsive interface with PyQt6
40
+ - Custom splash screen with progress indicator
41
+ - Consistent styling with professional color theme
42
+ - Sidebar navigation with active state indicators
43
+
44
+ ## ๐Ÿ“ธ Screenshots
45
+
46
+ <div align="center">
47
+
48
+ ### ๐Ÿ–ฅ๏ธ Main Application
49
+ <img src="screenshots/main_window.png" alt="Main Window" width="800"/>
50
+
51
+ ### โšก Tafel Analysis
52
+ <img src="screenshots/tafel_tab.png" alt="Tafel Analysis" width="800"/>
53
+
54
+ ### ๐Ÿ“ Data Import
55
+ <img src="screenshots/import_tab.png" alt="Data Import" width="800"/>
56
+
57
+ ### ๐Ÿ”ฎ Lifetime Prediction
58
+ <img src="screenshots/prediction_tab.png" alt="Prediction" width="800"/>
59
+
60
+ ### ๐Ÿ“Š Sample Comparison
61
+ <img src="screenshots/comparison_tab.png" alt="Comparison" width="800"/>
62
+
63
+ </div>
64
+
65
+ ## ๐Ÿš€ Installation
66
+
67
+ ### Prerequisites
68
+ - Python 3.8 or higher
69
+ - pip package manager
70
+
71
+ ### Quick Install
72
+
73
+
74
+ # Clone the repository
75
+ git clone https://github.com/khadev/corrosim.git
76
+ cd corrosim
77
+
78
+ # Install dependencies
79
+ pip install -r requirements.txt
80
+
81
+ # Run the application
82
+ python run.py
83
+
84
+
85
+ ### Install as Package
86
+
87
+
88
+ pip install -e .
89
+ corrosim
90
+
91
+
92
+ ### Direct Install from GitHub
93
+
94
+
95
+ pip install git+https://github.com/khadev/corrosim.git
96
+ corrosim
97
+
98
+
99
+ ## ๐Ÿ“ฆ Dependencies
100
+
101
+ txt
102
+ PyQt6>=6.5.0
103
+ matplotlib>=3.7.0
104
+ numpy>=1.24.0
105
+ pandas>=2.0.0
106
+ scipy>=1.10.0
107
+ openpyxl>=3.1.0
108
+
109
+
110
+ ## ๐Ÿงช Running Tests
111
+
112
+
113
+ python tests/test_tafel.py
114
+
115
+
116
+ Expected output:
117
+
118
+ โœ“ Test data generation passed
119
+ โœ“ All accuracy checks passed!
120
+
121
+
122
+ ## ๐Ÿ“– Usage Guide
123
+
124
+ ### 1. Import Data
125
+ 1. Click **๐Ÿ“ Import** in the sidebar
126
+ 2. Browse and select your Excel/CSV file
127
+ 3. Click **Load Preview** to verify data
128
+ 4. Enter sample name and select test type
129
+ 5. Specify current units (or use Auto-detect)
130
+ 6. Click **Import to Database**
131
+
132
+ ### 2. Tafel Analysis
133
+ 1. Navigate to **โšก Tafel** tab
134
+ 2. Click **Load Data** to retrieve imported data
135
+ 3. Verify current units and electrode area
136
+ 4. Click **โšก Run Tafel Analysis**
137
+ 5. View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
138
+ 6. Export plot as PNG or PDF
139
+
140
+ ### 3. Lifetime Prediction
141
+ 1. Go to **๐Ÿ”ฎ Prediction** tab
142
+ 2. Select degradation model (Linear/Power Law/Exponential)
143
+ 3. Set initial corrosion rate and failure threshold
144
+ 4. Set analysis period
145
+ 5. Click **๐Ÿ”ฎ Calculate Prediction**
146
+ 6. View predicted lifetime and degradation curve
147
+
148
+ ### 4. Compare Samples
149
+ 1. Open **๐Ÿ“Š Compare** tab
150
+ 2. Search and filter samples by name
151
+ 3. View all analysis results in sortable table
152
+ 4. Color-coded CR values: Green (low), Yellow (medium), Red (high)
153
+ 5. Export data to Excel
154
+
155
+ ## ๐Ÿ—๏ธ Project Structure
156
+
157
+
158
+ corrosim/
159
+ โ”œโ”€โ”€ corrosim/ # Main package
160
+ โ”‚ โ”œโ”€โ”€ __init__.py
161
+ โ”‚ โ”œโ”€โ”€ main.py # Entry point
162
+ โ”‚ โ”œโ”€โ”€ app.py # Main window
163
+ โ”‚ โ”œโ”€โ”€ theme.py # UI styling
164
+ โ”‚ โ”œโ”€โ”€ database.py # SQLite database
165
+ โ”‚ โ”œโ”€โ”€ tafel_engine.py # Analysis algorithms
166
+ โ”‚ โ”œโ”€โ”€ splash_screen.py # Splash screen
167
+ โ”‚ โ”œโ”€โ”€ tabs/ # Tab modules
168
+ โ”‚ โ”‚ โ”œโ”€โ”€ import_tab.py
169
+ โ”‚ โ”‚ โ”œโ”€โ”€ tafel_tab.py
170
+ โ”‚ โ”‚ โ”œโ”€โ”€ prediction_tab.py
171
+ โ”‚ โ”‚ โ””โ”€โ”€ comparison_tab.py
172
+ โ”‚ โ””โ”€โ”€ utils/
173
+ โ”‚ โ””โ”€โ”€ constants.py # Physical constants
174
+ โ”œโ”€โ”€ tests/
175
+ โ”‚ โ””โ”€โ”€ test_tafel.py # Validation tests
176
+ โ”œโ”€โ”€ screenshots/ # Application screenshots
177
+ โ”œโ”€โ”€ requirements.txt
178
+ โ”œโ”€โ”€ setup.py
179
+ โ”œโ”€โ”€ run.py
180
+ โ”œโ”€โ”€ README.md
181
+ โ”œโ”€โ”€ LICENSE
182
+ โ””โ”€โ”€ .gitignore
183
+
184
+
185
+ ## ๐Ÿ”ฌ Algorithm Verification
186
+
187
+ The Tafel engine has been validated using synthetic Butler-Volmer data:
188
+
189
+ | Parameter | Expected | Recovered | Error |
190
+ |-----------|----------|-----------|-------|
191
+ | Ecorr | -0.500 V | -0.502 V | 0.4% |
192
+ | Icorr | 10.0 ฮผA/cmยฒ | 9.5 ฮผA/cmยฒ | 5.0% |
193
+ | ฮฒa | 120 mV/dec | 118.1 mV/dec | 1.6% |
194
+ | ฮฒc | 120 mV/dec | 118.4 mV/dec | 1.3% |
195
+ | Rยฒ | โ€” | 0.9997 | โ€” |
196
+
197
+ ## ๐Ÿค Contributing
198
+
199
+ 1. Fork the repository
200
+ 2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
201
+ 3. Commit your changes (`git commit -m 'Add feature'`)
202
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
203
+ 5. Open a Pull Request
204
+
205
+ ## ๐Ÿ“„ License
206
+
207
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
208
+
209
+ ## ๐Ÿ‘ค Author
210
+
211
+ **Khaled Oukil**
212
+ - GitHub: [@khadev](https://github.com/khadev)
213
+ - Email: oukil.khaled@gmail.com
214
+
215
+ ## ๐Ÿ“š References
216
+
217
+ 1. Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. *Journal of the Electrochemical Society*, 104(1), 56-63.
218
+ 2. Tafel, J. (1905). รœber die Polarisation bei kathodischer Wasserstoffentwicklung. *Zeitschrift fรผr Physikalische Chemie*, 50(1), 641-712.
219
+ 3. ASTM G102-89(2015) - Standard Practice for Calculation of Corrosion Rates from Electrochemical Measurements.
220
+
221
+
222
+
223
+ **Built with โค๏ธ for the corrosion science community**
@@ -0,0 +1,19 @@
1
+ """
2
+ CorroSim - Professional Corrosion Analysis Platform
3
+
4
+ A comprehensive tool for electrochemical corrosion analysis including:
5
+ - Tafel polarization analysis
6
+ - Lifetime prediction
7
+ - Multi-sample comparison
8
+ - Data import/export
9
+ """
10
+
11
+ __version__ = "1.0.0"
12
+ __author__ = "Your Name"
13
+ __description__ = "Professional Corrosion Analysis Platform"
14
+
15
+ from .tafel_engine import TafelEngine
16
+ from .database import Database
17
+ from .theme import Theme
18
+
19
+ __all__ = ['TafelEngine', 'Database', 'Theme']