Skip to content

Commit 069ca2e

Browse files
Readme updated
1 parent 4f1131e commit 069ca2e

1 file changed

Lines changed: 76 additions & 153 deletions

File tree

README.md

Lines changed: 76 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
![PICA CI](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/python-package.yml/badge.svg)
1+
![PICA CI](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/python-app.yml/badge.svg)
22
[![codecov](https://codecov.io/gh/prathameshnium/PICA-Python-Instrument-Control-and-Automation/branch/main/graph/badge.svg)](https://codecov.io/gh/prathameshnium/PICA-Python-Instrument-Control-and-Automation)
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4+
[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-brightgreen.svg)](https://www.python.org/downloads/)
35

46
<p align="center">
5-
<img src="_assets/LOGO/PICA_LOGO_NBG.png" alt="PICA Logo" width="150"/>
7+
<img src="./assets/LOGO/PICA_LOGO_NBG.png" alt="PICA Logo" width="150"/>
68
</p>
9+
710
<h1 align="center">PICA: Python-based Instrument Control and Automation</h1>
11+
812
<p align="center">
9-
A modular software suite for automating laboratory measurements in physics research.
10-
</p>
11-
<p align="center">
12-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
13-
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.9+-brightgreen.svg" alt="Python 3.9+"></a>
14-
<a href="https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/joss_tests.yml"><img src="https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/joss_tests.yml/badge.svg" alt="Run PICA JOSS Tests"></a>
15-
<a href="https://codecov.io/gh/prathameshnium/PICA-Python-Instrument-Control-and-Automation"><img src="https://codecov.io/gh/prathameshnium/PICA-Python-Instrument-Control-and-Automation/branch/main/graph/badge.svg" alt="codecov"></a>
16-
<a href="https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/codeql.yml"><img src="https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation/actions/workflows/codeql.yml/badge.svg" alt="CodeQL"></a>
13+
<strong>A modular software suite for automating laboratory measurements in physics research.</strong>
1714
</p>
1815

1916
---
@@ -22,186 +19,144 @@
2219

2320
**PICA (Python-based Instrument Control and Automation)** is a software suite designed to provide a robust framework for automating laboratory instruments in materials science and condensed matter physics research. The suite features a central graphical user interface (GUI), the **PICA Launcher**, which serves as a dashboard for managing and executing a variety of characterization experiments.
2421

25-
A key architectural feature is the use of isolated process execution for each measurement module via Python's `multiprocessing` library, ensuring high stability and preventing inter-script conflicts. This platform is built to streamline data acquisition, enhance experimental reproducibility, and accelerate research workflows.
26-
27-
PICA is designed with a clear separation between the user interface (GUI) and the instrument control logic (backend). This modular approach makes the system easy to maintain, extend, and debug.
22+
A key architectural feature is the use of **isolated process execution** for each measurement module via Python's `multiprocessing` library. This ensures high stability, prevents inter-script conflicts, and allows the main dashboard to remain responsive during long-running experiments.
2823

29-
**A Note on Recent Updates and Testing:**
30-
31-
> This software suite is actively used for daily laboratory measurements and is regularly tested on the physical instruments. Recently, a suite of automated tests has been integrated to improve code quality and stability. While these tests validate the core logic, the changes made to support them require a new round of thorough manual testing on the hardware to identify and resolve any practical bugs that may have been introduced. This process is currently underway, and further updates will be provided upon its completion.
32-
33-
<p align="center">
34-
<img src="_assets/Images/PICA_Launcher_v6.png" alt="PICA Launcher Screenshot" width="800"/>
35-
</p>
36-
37-
---
38-
39-
## Architecture
40-
41-
The core design philosophy of PICA is the separation of concerns, implemented through a distinct **GUI-Backend** architecture for each measurement module.
42-
43-
- **GUI (Frontend):** Each measurement has a dedicated GUI script (e.g., `IV_K2400_GUI_v5.py`) built with `Tkinter`. It is responsible for all user interaction, parameter input, and data visualization (live plotting). It runs in the main process to remain responsive.
44-
- **Backend:** The instrument control logic is encapsulated in a separate class (e.g., `Keithley2400_Backend`). This class handles all `PyVISA` communication, instrument configuration, and data acquisition commands.
45-
- **Process Isolation:** When a measurement is started, the GUI launches its corresponding backend logic in a separate, isolated process using Python's `multiprocessing` library. This is the key to PICA's stability: a crash or error in one measurement script will not affect the main launcher or any other running experiments.
46-
- **Communication:** The frontend and backend communicate via `multiprocessing.Queue` for thread-safe data exchange. The backend performs a measurement and places the data into a queue, which the frontend then reads to update plots and save to a file.
24+
> **⚠️ Important Note on Testing & Validation**
25+
>
26+
> This software is actively used for daily laboratory measurements and has been verified on physical instruments (Keithley, Lakeshore, etc.).
27+
>
28+
> Recently, significant updates were made to the codebase to integrate **Automated CI/CD Testing** (simulations and logic checks). While these automated tests pass successfully, the refactoring required for them may have introduced subtle timing or hardware-specific regressions. **A comprehensive round of manual validation on the physical instruments is currently underway** to ensure full operational stability.
4729
4830
---
4931

5032
## Table of Contents
5133

34+
- [Architecture](#architecture)
5235
- [Core Features](#core-features)
53-
- [Tech Stack & Dependencies](#tech-stack--dependencies)
54-
- [Available Measurement Modules](#available-measurement-modules)
5536
- [Instrument Specifications](#instrument-specifications)
56-
- [Getting Started](#getting-started)
57-
- [Resources & Documentation](#resources--documentation)
58-
- [How to Cite](#how-to-cite)
59-
- [Contributing](#contributing)
60-
- [Authors & Acknowledgments](#authors--acknowledgments)
37+
- [Getting Started](#-getting-started)
38+
- [Running Tests](#-running-tests)
39+
- [Resources & Documentation](#-resources--documentation)
40+
- [Citation](#citation)
6141
- [License](#license)
42+
- [Authors & Acknowledgments](#authors--acknowledgments)
6243

6344
---
6445

65-
## Core Features
66-
67-
- **Centralized Control Dashboard:** A comprehensive GUI for launching all measurement modules.
68-
- **Isolated Process Execution:** Each script operates in a discrete process, guaranteeing application stability and preventing resource conflicts.
69-
- **Integrated VISA Instrument Scanner:** An embedded utility for discovering, identifying, and troubleshooting GPIB/VISA instrument connections.
70-
- **Modular Architecture:** Each experimental setup is encapsulated in a self-contained module with direct access to its scripts and data directories.
71-
- **Embedded Documentation:** In-application viewer for essential project documentation.
72-
- **System Console Log:** A real-time log provides status updates, confirmations, and error diagnostics for all operations.
73-
74-
---
75-
76-
## Tech Stack & Dependencies
77-
78-
The core of PICA is built with a stack of robust and widely-used Python libraries.
46+
## Architecture
7947

80-
- **Primary Language:** **Python 3.9+**
81-
- **Graphical User Interface:** **Tkinter**
82-
- **Instrument Communication:** **PyVISA** (a Python wrapper for the NI-VISA library)
83-
- **Numerical Operations:** **NumPy**
84-
- **Data Visualization:** **Matplotlib**
85-
- **Concurrency:** **Multiprocessing** (a native Python library for process isolation)
48+
The core design philosophy of PICA is the separation of concerns, implemented through a distinct **GUI-Backend** architecture for each measurement module.
8649

87-
All required packages are listed in the `requirements.txt` file for easy one-step installation.
50+
- **GUI (Frontend):** Each measurement has a dedicated GUI script (e.g., `IV_K2400_GUI_v5.py`) built with `Tkinter`. It is responsible for user interaction, parameter input, and real-time data visualization using `Matplotlib`.
51+
- **Backend:** The instrument control logic is encapsulated in separate classes (e.g., `Keithley2400_Backend`). This layer handles all `PyVISA` communication, SCPI command parsing, and data retrieval.
52+
- **Process Isolation:** When a measurement starts, the GUI launches the backend logic in a separate, isolated process. This prevents a hardware timeout or script error from crashing the entire application suite.
53+
- **Inter-Process Communication:** The frontend and backend communicate via thread-safe `multiprocessing.Queues`, allowing for high-speed data transfer without race conditions.
8854

8955
---
90-
## Available Measurement Modules
91-
92-
The PICA suite is organized into modules, each containing a frontend GUI application and its corresponding backend logic for instrument control.
93-
94-
#### Low Resistance (Keithley 6221 / 2182)
95-
* **Delta Mode I-V Sweep**
96-
* **Delta Mode R vs. T (Active Control)**
97-
* **Delta Mode R vs. T (Passive Sensing)**
98-
99-
#### Mid Resistance (Keithley 2400)
100-
* **I-V Sweep**
101-
* **R vs. T (Active Control)**
102-
* **R vs. T (Passive Sensing)**
10356

104-
#### Mid Resistance, High Precision (Keithley 2400 / 2182)
105-
* **I-V Sweep**
106-
* **R vs. T (Active Control)**
107-
* **R vs. T (Passive Sensing)**
108-
109-
#### High Resistance (Keithley 6517B)
110-
* **I-V Sweep**
111-
* **R vs. T (Active Control)**
112-
* **R vs. T (Passive Sensing)**
113-
114-
#### Pyroelectric Measurement (Keithley 6517B)
115-
* **PyroCurrent vs. T**
116-
117-
#### Capacitance (Keysight E4980A)
118-
* **C-V Measurement**
57+
## Core Features
11958

120-
#### Temperature Utilities (Lakeshore 350)
121-
* **Temperature Ramp**
122-
* **Temperature Monitor**
59+
- **Centralized Control Dashboard:** A comprehensive GUI for launching all measurement modules.
60+
- **Integrated VISA Instrument Scanner:** An embedded utility for identifying and troubleshooting GPIB/VISA connections via the NI-VISA backend.
61+
- **Modular Design:** Each experimental setup is a self-contained module, making the codebase easy to extend.
62+
- **Embedded Documentation:** In-application viewer for technical manuals and project guides.
63+
- **System Console Log:** A real-time logging system that provides status updates and error diagnostics.
12364

12465
---
12566

12667
## Instrument Specifications
12768

128-
12969
### Advanced Cryogenic Transport Measurement System
13070

131-
**Overview**
132-
This facility provides users with a comprehensive, modular system for characterizing the full spectrum of electronic transport properties in cryogenic environments. The setup integrates multiple high-precision instruments to cover the entire resistance scale, from superconductors to perfect insulators.
133-
134-
* **Temperature Range:** 80 K to 320 K.
135-
* **Complete Resistance Range:** $10 n\Omega$ to $10 P\Omega$, i.e., covering 24-orders-of-magnitude.
136-
137-
**Measurement Modules**
71+
This software controls a facility designed for characterizing the full spectrum of electronic transport properties in cryogenic environments (80 K to 320 K). The setup integrates multiple high-precision instruments to cover a resistance range spanning 24 orders of magnitude.
13872

13973
| Module | Configuration / Instrument | Use Case | Resistance Range |
14074
| :--- | :--- | :--- | :--- |
141-
| **1. Low-Resistance (Delta Mode)** | **Keithley 6221** (Current Source) + **K2182** (Nanovoltmeter) | For superconductors & metallic films; actively cancels thermal offsets. | $10 n\Omega$ to $100 M\Omega$ |
142-
| **2. Mid-Resistance (Standard)** | **Keithley 2400** Source Meter | For semiconductors, oxides. | $100 \mu\Omega$ to $200 M\Omega$ |
143-
| **3. Mid-Resistance (High-Precision)** | **Keithley 2400** (Source) + **K2182** (Nanovoltmeter) | Detects subtle phase transitions in semiconductors, oxides. | $1 \mu\Omega$ to $100 M\Omega$ |
144-
| **4. High-Resistance** | **Keithley 6517B** Electrometer | Measures dielectrics, polymers, & ceramics. | $1 \Omega$ to $10 P\Omega$ ($10^{16}\Omega$) |
75+
| **1. Low-Resistance (Delta Mode)** | **Keithley 6221** (Current Source) + **K2182** (Nanovoltmeter) | Superconductors & metallic films; actively cancels thermal EMFs. | $10 n\Omega$ to $100 M\Omega$ |
76+
| **2. Mid-Resistance (Standard)** | **Keithley 2400** SourceMeter | Semiconductors, oxides, general transport. | $100 \mu\Omega$ to $200 M\Omega$ |
77+
| **3. Mid-Resistance (High-Precision)** | **Keithley 2400** + **K2182** | Detecting subtle phase transitions. | $1 \mu\Omega$ to $100 M\Omega$ |
78+
| **4. High-Resistance** | **Keithley 6517B** Electrometer | Dielectrics, polymers, & ceramics. | $1 \Omega$ to $10^{16} \Omega$ |
14579

14680
---
14781

14882
## 🚀 Getting Started
14983

15084
### Prerequisites
15185

152-
1. **Python:** Python 3.9 or newer is recommended.
153-
2. **NI-VISA Driver:** You must install the [National Instruments VISA Driver](https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html) for your operating system. This is required for Python's `pyvisa` library to communicate with the instruments.
86+
1. **Python:** Python 3.10 or newer is recommended.
87+
2. **NI-VISA Driver:** You must install the [National Instruments VISA Driver](https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html) or an equivalent backend. This is required for the `pyvisa` library to communicate with the instruments.
15488

15589
### Installation Steps
15690

15791
1. **Clone the Repository**
15892
```bash
159-
git clone https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git
93+
git clone [https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation.git)
16094
cd PICA-Python-Instrument-Control-and-Automation
16195
```
16296

16397
2. **Create a Virtual Environment**
164-
Using a virtual environment is strongly recommended to avoid conflicts with other Python projects.
98+
Recommended to verify dependencies and avoid conflicts.
16599
```bash
166100
# Create the virtual environment
167101
python -m venv venv
168102
169-
# Activate the environment
170-
# On Windows:
103+
# Activate (Windows)
171104
venv\Scripts\activate
172-
# On macOS/Linux:
105+
# Activate (macOS/Linux)
173106
source venv/bin/activate
174107
```
175108

176109
3. **Install Dependencies**
177-
This project uses a `requirements.txt` file to manage all necessary packages.
178110
```bash
179111
pip install -r requirements.txt
180112
```
181113

182114
4. **Launch the Application**
183-
Execute the main launcher script from the project's root directory.
184115
```bash
185116
python PICA_v6.py
186117
```
187118

188119
---
189120

190-
## 📚 Resources & Documentation
121+
## 🧪 Running Tests
191122

192-
**Comprehensive Documentation:**
193-
For detailed setup instructions, hardware interfacing guides, and troubleshooting, please refer to the **[PICA User Manual](docs/User_Manual.md)** located in the `docs/` directory.
123+
This repository includes a robust test suite using `pytest`. It mocks hardware interactions and GUI components, allowing the logic to be verified in a headless environment (CI).
194124

195-
**Instrument Manuals:**
196-
A collection of official instrument manuals is provided within the `_assets/Manuals/` directory for technical reference.
125+
To run the tests locally:
126+
127+
1. **Install Test Dependencies:**
128+
```bash
129+
pip install pytest pytest-cov flake8
130+
```
131+
132+
2. **Run the Test Suite:**
133+
```bash
134+
python -m pytest
135+
```
136+
137+
3. **Generate Coverage Report:**
138+
```bash
139+
# Generates an HTML report in the htmlcov/ directory
140+
python -m pytest --cov=. --cov-report=html
141+
```
142+
143+
The testing pipeline verifies:
144+
* **Package Integrity:** Ensures all scripts compile and import correctly.
145+
* **GUI Layouts:** Validates that `Tkinter` and `Matplotlib` widgets initialize without errors (using mocked graphics).
146+
* **Backend Logic:** Simulates measurement loops (e.g., Temperature Ramps) to verify logic flow without needing physical instruments connected.
197147

198148
---
199149

200-
## How to Cite
150+
## 📚 Resources & Documentation
151+
152+
* **User Manual:** Detailed setup and troubleshooting guides are available in [docs/User_Manual.md](docs/User_Manual.md).
153+
* **Instrument Manuals:** Original PDF manuals for the supported hardware are located in `assets/Manuals/`.
201154

202-
If you use this software in your research, please cite it. This helps to credit the work involved in creating and maintaining this resource.
155+
---
156+
157+
## Citation
203158

204-
#### BibTeX Entry
159+
If you use this software in your research, please cite it using the following BibTeX entry:
205160

206161
```bibtex
207162
@software{Deshmukh_PICA_2023,
@@ -211,37 +166,5 @@ If you use this software in your research, please cite it. This helps to credit
211166
year = 2023,
212167
publisher = {GitHub},
213168
version = {14.1.0},
214-
url = {https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation}
215-
}
216-
```
217-
218-
Alternatively, you can use the `CITATION.cff` file in the root of the repository for automatic parsing by modern reference managers.
219-
220-
---
221-
222-
## 🤝 How to Contribute
223-
224-
Contributions are welcome! If you have suggestions for improvements or want to add a new instrument module, please feel free to:
225-
226-
1. Fork the repository.
227-
2. Create a new branch (`git checkout -b feature/YourFeature`).
228-
3. Commit your changes (`git commit -m 'Add some feature'`).
229-
4. Push to the branch (`git push origin feature/YourFeature`).
230-
5. Open a Pull Request.
231-
232-
Please open an issue first to discuss any major changes you would like to make.
233-
234-
---
235-
236-
## Authors & Acknowledgments
237-
238-
<p align="center">
239-
<img src="_assets/LOGO/UGC_DAE_CSR_NBG.jpeg" alt="UGC DAE CSR Logo" width="150">
240-
</p>
241-
242-
- **Lead Developer:** **[Prathamesh Deshmukh](https://prathameshdeshmukh.site/)**
243-
- **Principal Investigator:** **[Dr. Sudip Mukherjee](https://www.researchgate.net/lab/Sudip-Mukherjee-Lab)**
244-
- **Affiliation:** *[UGC-DAE Consortium for Scientific Research, Mumbai Centre](https://www.csr.res.in/Mumbai_Centre)*
245-
246-
#### Funding
247-
Financial support for this work was provided under SERB-CRG project grant No. CRG/2022/005676 from the Anusandhan National Research Foundation (ANRF), a statutory body of the Department of Science & Technology (DST), Government of India.
169+
url = {[https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation](https://github.com/prathameshnium/PICA-Python-Instrument-Control-and-Automation)}
170+
}

0 commit comments

Comments
 (0)