PPMS_Toolkit 0.2.1__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 (47) hide show
  1. ppms_toolkit-0.2.1/.binder/environment.yml +9 -0
  2. ppms_toolkit-0.2.1/.binder/postBuild +2 -0
  3. ppms_toolkit-0.2.1/.gitignore +19 -0
  4. ppms_toolkit-0.2.1/.vscode/settings.json +5 -0
  5. ppms_toolkit-0.2.1/LICENSE +21 -0
  6. ppms_toolkit-0.2.1/PKG-INFO +296 -0
  7. ppms_toolkit-0.2.1/environment.yml +28 -0
  8. ppms_toolkit-0.2.1/examples/code_example.ipynb +1060 -0
  9. ppms_toolkit-0.2.1/examples/profile.prof +0 -0
  10. ppms_toolkit-0.2.1/examples/test_data/HC_test_data.Dat +378 -0
  11. ppms_toolkit-0.2.1/examples/test_data/VSM_TestData_4Cl_IP/MH_2P5K.DAT +13931 -0
  12. ppms_toolkit-0.2.1/examples/test_data/VSM_TestData_4Cl_IP/MT_0P01T_FC.DAT +1597 -0
  13. ppms_toolkit-0.2.1/examples/test_data/VSM_TestData_4Cl_IP/MT_0P01T_ZFC.DAT +1630 -0
  14. ppms_toolkit-0.2.1/examples/test_data/VSM_TestData_4Cl_IP/MT_0P1T_FC.DAT +1589 -0
  15. ppms_toolkit-0.2.1/examples/test_data/VSM_TestData_4Cl_IP/MT_0P1T_ZFC.DAT +1638 -0
  16. ppms_toolkit-0.2.1/pyproject.toml +41 -0
  17. ppms_toolkit-0.2.1/readme.md +257 -0
  18. ppms_toolkit-0.2.1/readme_old.md +97 -0
  19. ppms_toolkit-0.2.1/screenshots/plot_window.png +0 -0
  20. ppms_toolkit-0.2.1/src/infrastructure/db/connection +0 -0
  21. ppms_toolkit-0.2.1/src/infrastructure/db/db.py +483 -0
  22. ppms_toolkit-0.2.1/src/ppms_toolkit/__init__.py +1 -0
  23. ppms_toolkit-0.2.1/src/ppms_toolkit/measurement/__init__.py +17 -0
  24. ppms_toolkit-0.2.1/src/ppms_toolkit/measurement/base.py +74 -0
  25. ppms_toolkit-0.2.1/src/ppms_toolkit/measurement/heat_capacity.py +166 -0
  26. ppms_toolkit-0.2.1/src/ppms_toolkit/measurement/utils.py +101 -0
  27. ppms_toolkit-0.2.1/src/ppms_toolkit/measurement/vsm.py +328 -0
  28. ppms_toolkit-0.2.1/src/ppms_toolkit/sample.py +347 -0
  29. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/adapters/mpl_canvas.py +20 -0
  30. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/app.py +46 -0
  31. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/controller/header_filter_controller.py +156 -0
  32. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/controller/plot_controller.py +242 -0
  33. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/controller/sample_controller.py +94 -0
  34. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/dialogs/new_measurement_dialog.py +126 -0
  35. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/dialogs/project_dialog.py +88 -0
  36. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/dialogs/sample_dialog.py +125 -0
  37. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/main_window.py +61 -0
  38. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/models/measurement_table_model.py +147 -0
  39. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/models/sample_table_model.py +98 -0
  40. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/proxy/multi_value_filter.py +32 -0
  41. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/analysis_widget.py +4 -0
  42. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/center_widget.py +21 -0
  43. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/measurement_list_widget.py +58 -0
  44. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/plot_widget.py +128 -0
  45. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/sample_table_widget.py +59 -0
  46. ppms_toolkit-0.2.1/src/ppms_toolkit_gui/widgets/settings_widget.py +4 -0
  47. ppms_toolkit-0.2.1/src/resources/app_icon.png +0 -0
@@ -0,0 +1,9 @@
1
+ name: ppms_env
2
+ channels:
3
+ - defaults
4
+ dependencies:
5
+ - python=3.10
6
+ - numpy
7
+ - scipy
8
+ - pandas
9
+ - matplotlib
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ pip install -e .
@@ -0,0 +1,19 @@
1
+ Icon*
2
+ *.pkl
3
+ code_test.ipynb
4
+ reference_code/
5
+
6
+ # 忽略所有 __pycache__ 目录
7
+ **/__pycache__/
8
+
9
+ # 忽略所有 .pyc 和 .pyo 编译文件
10
+ **/*.pyc
11
+ **/*.pyo
12
+
13
+ *.egg-info/
14
+
15
+ ### macOS ###
16
+ # General
17
+ .DS_Store
18
+ .AppleDouble
19
+ .LSOverride
@@ -0,0 +1,5 @@
1
+ {
2
+ "python-envs.defaultEnvManager": "ms-python.python:conda",
3
+ "python-envs.defaultPackageManager": "ms-python.python:conda",
4
+ "python-envs.pythonProjects": []
5
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yunxiao Liu
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,296 @@
1
+ Metadata-Version: 2.4
2
+ Name: PPMS_Toolkit
3
+ Version: 0.2.1
4
+ Summary: Toolkit for PPMS data processing
5
+ Author-email: Yunxiao LIU <yunxiao.liu@tum.de>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Yunxiao Liu
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ License-File: LICENSE
28
+ Classifier: Operating System :: OS Independent
29
+ Classifier: Programming Language :: Python :: 3
30
+ Requires-Python: >=3.9
31
+ Requires-Dist: matplotlib>=3.4.0
32
+ Requires-Dist: numpy>=1.21.0
33
+ Requires-Dist: pandas>=1.3.0
34
+ Requires-Dist: scipy>=1.7.0
35
+ Provides-Extra: gui
36
+ Requires-Dist: pyarrow>=10.0.0; extra == 'gui'
37
+ Requires-Dist: pyside6; extra == 'gui'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # PPMS Toolkit
41
+
42
+ > ⚠️ **Development Notice**
43
+ >
44
+ > This project is currently under active development and primarily developed and tested on **macOS**.
45
+ > It is a **pure Python** application built with **Qt (PySide6)**, so it should be *cross-platform* in principle.
46
+ > However, minor GUI display issues may occur on **Windows** or **Linux** systems.
47
+
48
+ <div align="center">
49
+
50
+ [![Python](https://img.shields.io/badge/Python-3.9+-blue.svg)](https://www.python.org/downloads/)
51
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
52
+ [![PySide6](https://img.shields.io/badge/GUI-PySide6-green.svg)](https://doc.qt.io/qtforpython/)
53
+
54
+ *A Python toolkit for PPMS (Physical Property Measurement System) data analysis*
55
+
56
+ [Features](#-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-documentation)
57
+
58
+ </div>
59
+
60
+ ---
61
+
62
+ ## 📖 Overview
63
+
64
+ ![Easy plot with Measurement List](screenshots/plot_window.png)
65
+
66
+ **PPMS Toolkit** is a modern, user-friendly application designed for researchers working with Quantum Design's Physical Property Measurement System (PPMS). It provides both a powerful **GUI application** and a flexible **Python library** for:
67
+
68
+ - 📂 **Data Management**: Import, organize, and manage PPMS `.dat` files with SQLite database
69
+ - 📊 **Interactive Plotting**: Visualize VSM ~~and Heat Capacity measurements~~ with Matplotlib
70
+ - ~~🔬 **Advanced Analysis**: Curie temperature fitting, background subtraction, susceptibility analysis~~
71
+ - 💾 **Efficient Storage**: Parquet-based file format for fast data loading and minimal disk usage
72
+ - 🎨 **Cross-Platform**: Built with PySide6 (Qt6) for cross-platform compatibility
73
+
74
+ ---
75
+
76
+ ## ✨ Features
77
+
78
+ ### 🖥️ GUI Application
79
+
80
+ - **Sample Management**
81
+ - Create and edit sample metadata (name, mass, orientation, chemical formula)
82
+ - Track multiple measurements per sample
83
+ - Delete samples and associated data files
84
+
85
+ - **Measurement Management**
86
+ - Batch import of `.dat` files from PPMS
87
+ - Support for VSM (Vibrating Sample Magnetometer) measurements:
88
+ - **MH mode**: Magnetization vs. Field
89
+ - **MT mode**: Magnetization vs. Temperature
90
+ - ~~Support for Heat Capacity measurements~~
91
+ - Automatic deduplication based on file content hash
92
+
93
+ - **Interactive Plotting**
94
+ - Plot multiple measurements with customizable legends
95
+ - Click-to-hide curves for easy comparison
96
+ - Switch between susceptibility (χ) and moment views
97
+ - Zoom, pan, and export plots
98
+
99
+ - **Data Filtering**
100
+ - Multi-column filtering in measurement tables
101
+ - Filter by sample, mode, field, temperature, or condition
102
+
103
+ ---
104
+
105
+ ## 🚀 Installation
106
+
107
+ ### Option 1: Conda Environment (Recommended)
108
+
109
+ ```bash
110
+ # Clone the repository
111
+ git clone https://github.com/AlbertRyu/PPMS_ToolKit.git
112
+ cd PPMS_ToolKit
113
+
114
+ # Create and activate conda environment
115
+ conda env create -f environment.yml
116
+ conda activate ppms_toolkit
117
+
118
+ # Install the package in development mode
119
+ pip install -e ".[gui]"
120
+
121
+ # Launch the GUI
122
+ ppms-toolkit
123
+ ```
124
+
125
+ ### Option 2: pip + venv
126
+
127
+ ```bash
128
+ # Clone the repository
129
+ git clone https://github.com/AlbertRyu/PPMS_ToolKit.git
130
+ cd PPMS_ToolKit
131
+
132
+ # Create virtual environment
133
+ python -m venv venv
134
+ source venv/bin/activate # On Windows: venv\Scripts\activate
135
+
136
+ # Install with GUI support
137
+ pip install -e ".[gui]"
138
+
139
+ # Launch the GUI
140
+ ppms-toolkit
141
+ ```
142
+ ---
143
+
144
+ ## 🎯 Quick Start
145
+
146
+ ### GUI Workflow
147
+
148
+ 1. **Launch Application**
149
+ ```bash
150
+ ppms-toolkit
151
+ ```
152
+
153
+ 2. **Select/Create Project**
154
+ - Choose an existing project folder or create a new one
155
+ - All data will be stored in this folder
156
+
157
+ 3. **Add Samples**
158
+ - Navigate to "Samples" tab
159
+ - Click "Add Sample" and enter metadata (name, mass, orientation)
160
+
161
+ 4. **Import Measurements**
162
+ - Go to "Plots" tab
163
+ - Click "Add Measurement"
164
+ - Select multiple `.dat` files (batch import supported)
165
+ - Choose the sample and measurement mode (MH/MT)
166
+
167
+ #### 📁 File Naming for MT Mode
168
+
169
+ The toolkit automatically detects measurement conditions from filenames:
170
+
171
+ | Filename Contains | Detected Condition |
172
+ |-------------------|-------------------|
173
+ | `ZFC` (case-insensitive) | Zero Field Cooling |
174
+ | `FC` (case-insensitive) | Field Cooling |
175
+ | Neither | Unknown Condition |
176
+
177
+ **Examples:**
178
+ ```bash
179
+ ✅ sample_ZFC_100Oe.dat → Condition: ZFC
180
+ ✅ data_FC.dat → Condition: FC
181
+ ⚠️ measurement.dat → Condition: Unknown
182
+
183
+ 5. **Visualize Data**
184
+ - Select measurements from the table
185
+ - Click "Plot" to visualize
186
+ - Use legend to toggle curves
187
+ - Toggle χ/Moment view with checkbox
188
+
189
+ ---
190
+
191
+ ## 📊 Supported Measurement Types
192
+
193
+ ### VSM (Vibrating Sample Magnetometer)
194
+
195
+ | Mode | Description | Analysis Tools |
196
+ |------|-------------|----------------|
197
+ | **MH** | Magnetization vs. Field | ~~`fit_MH()` - Coercivity extraction~~~~ |
198
+ | **MT** | Magnetization vs. Temperature | ~~`fit_MT()` - Curie temperature fitting~~|
199
+
200
+ ---
201
+
202
+ ## 🗂️ Project Structure
203
+
204
+ ```
205
+ PPMS_ToolKit/
206
+ ├── src/
207
+ │ ├── ppms_toolkit/ # Core library
208
+ │ │ ├── sample.py # Sample class
209
+ │ │ └── measurement/
210
+ │ │ ├── base.py # Base Measurement class
211
+ │ │ ├── vsm.py # VSM analysis
212
+ │ │ └── heat_capacity.py # Heat Capacity analysis
213
+ │ │
214
+ │ ├── ppms_toolkit_gui/ # GUI application
215
+ │ │ ├── app.py # Entry point
216
+ │ │ ├── main_window.py # Main window
217
+ │ │ ├── controller/ # MVC controllers
218
+ │ │ ├── widgets/ # Qt widgets
219
+ │ │ └── dialogs/ # Dialog windows
220
+ │ │
221
+ │ └── infrastructure/
222
+ │ └── db/
223
+ │ └── db.py # SQLite database wrapper
224
+
225
+ ├── examples/
226
+ │ └── code_example.ipynb # Jupyter notebook examples
227
+
228
+ ├── pyproject.toml # Project metadata & dependencies
229
+ ├── environment.yml # Conda environment specification
230
+ └── README.md # This file
231
+ ```
232
+
233
+ ---
234
+
235
+ ## 🔧 Dependencies
236
+
237
+ ### Core Dependencies
238
+ - **numpy** ≥ 1.21 - Numerical computing
239
+ - **pandas** ≥ 1.3 - Data manipulation
240
+ - **scipy** ≥ 1.7 - Scientific computing
241
+ - **matplotlib** ≥ 3.4 - Plotting
242
+
243
+ ### GUI Dependencies (Optional)
244
+ - **PySide6** ≥ 6.4 - Qt6 GUI framework
245
+ - **pyarrow** ≥ 10.0 - Parquet file I/O
246
+
247
+ ### Development Dependencies
248
+ - **ipykernel** - Jupyter notebook support
249
+ - **IPython** - Enhanced interactive shell
250
+
251
+ ---
252
+
253
+ ## 📚 Documentation
254
+
255
+ ### Database Structure
256
+
257
+ The toolkit uses SQLite for data management with two main tables:
258
+
259
+ **`samples`**
260
+ - `id`, `name`, `mass`, `chemical`, `orientation`, `created_at`, `notes`
261
+
262
+ **`measurements`**
263
+ - `id`, `sample_id` (FK), `measurement_type`, `mode`
264
+ - `const_field`, `const_temperature`
265
+ - `original_filepath`, `data_filepath`, `processed_data_filepath`
266
+ - `content_hash` (for deduplication)
267
+ - `extra_parameters` (JSON), `comment`, `created_at`
268
+ ---
269
+
270
+ ## 📄 License
271
+
272
+ This project is licensed under the **MIT License**.
273
+
274
+ You are free to use, modify, and distribute this software, provided that:
275
+ - You include the original copyright notice and license text in any copies
276
+ - You do not hold the author liable for any damages
277
+
278
+ See [LICENSE](LICENSE) file for full details.
279
+
280
+ ---
281
+
282
+ ## 🙏 Acknowledgments
283
+
284
+ - Built with [PySide6](https://doc.qt.io/qtforpython/) (Qt for Python)
285
+ - Data storage powered by [Apache Arrow](https://arrow.apache.org/) (Parquet format)
286
+ - Scientific computing with [NumPy](https://numpy.org/), [SciPy](https://scipy.org/), and [pandas](https://pandas.pydata.org/)
287
+
288
+ ---
289
+
290
+ <div align="center">
291
+
292
+ **[⬆ Back to Top](#ppms-toolkit)**
293
+
294
+ Made with ❤️ for the research community
295
+
296
+ </div>
@@ -0,0 +1,28 @@
1
+ name: ppms_toolkit
2
+ channels:
3
+ - conda-forge
4
+ - defaults
5
+ dependencies:
6
+ # Python 版本(3.12 性能更好,支持周期更长)
7
+ - python=3.12.0
8
+
9
+ # 包管理工具
10
+ - pip=23.3.1
11
+
12
+ # 科学计算核心库(版本确保兼容 Python 3.12)
13
+ - numpy=1.26.2 # >= 1.26.0 支持 Python 3.12
14
+ - scipy=1.11.4 # >= 1.11.2 支持 Python 3.12
15
+ - pandas=2.1.4 # >= 2.1.0 支持 Python 3.12
16
+ - matplotlib=3.8.2 # >= 3.8.0 支持 Python 3.12
17
+
18
+ # 数据存储
19
+ - pyarrow=14.0.1 # Parquet 文件读写
20
+
21
+ # 开发工具
22
+
23
+
24
+ # 通过 pip 安装的包(conda 版本可能不稳定)
25
+ - pip:
26
+ - PySide6==6.7.2 # Qt6 GUI 框架(>= 6.5.0 支持 Python 3.12)
27
+ - ipykernel==6.27.1 # Jupyter Notebook 支持
28
+ - ipython==8.18.1 # 增强交互式 shell