Measurement code for condensed matter groups at UW based on QCoDeS.
Project description
MeasureIt 
Measurement software based on QCoDeS, developed in University of Washington physics.
Community information
High-Level Design
MeasureIt is a measurement software package built on top of QCoDeS for physics experiments. The architecture follows these key patterns:
Core Architecture
- Sweep-based Measurement System: The core abstraction is the
BaseSweepclass with specialized implementations (Sweep0D,Sweep1D,Sweep2D) for different dimensional measurements - Qt-based Threading: Uses PyQt5 with separate threads for data acquisition (
RunnerThread) and plotting (PlotterThread) - Driver Layer: Custom instrument drivers in the
Drivers/module that interface with various lab equipment - Notebook Workflow: Designed for Jupyter/CLI usage; PyQt5 powers background threading and signaling
- Data Management: Integration with QCoDeS for data storage and experiment management
Key Components
- Base Classes:
BaseSweepprovides the foundation with parameter following, measurement creation, and thread management - Measurement Types:
- 0D (time-based measurements)
- 1D (single parameter sweep)
- 2D (dual parameter sweep)
- Queue System:
SweepQueuefor batch experiment execution - Real-time Plotting: Live data visualization during measurements
- Station Management: QCoDeS Station integration for instrument management
Package Structure
src/measureit/
sweep/ # Measurement implementations
base_sweep.py # Core sweep functionality
tools/ # Data utilities and sweep helpers
Drivers/ # Instrument drivers
visualization/ # Plotting helpers
Quick Start
Prerequisites
- Python 3.8+
- Git
- NI DAQmx drivers: http://www.ni.com/en-us/support/downloads/drivers/download/unpackaged.ni-daqmx.291872.html
- NI VISA package: http://www.ni.com/download/ni-visa-18.5/7973/en/
Installation
Using pip (recommended)
pip install qmeasure
Note: The package is installed as qmeasure, but you import it as measureit:
import measureit # Import name stays the same
From source
git clone https://github.com/nanophys/MeasureIt.git
cd MeasureIt
pip install -e .
Data Directory Configuration
MeasureIt (installed as qmeasure) stores databases, logs, and configuration files. You have three options:
Option 1: Use defaults
Data is automatically stored in OS-appropriate locations:
- Linux:
~/.local/share/measureit/ - macOS:
~/Library/Application Support/measureit/ - Windows:
C:\Users\<username>\AppData\Local\measureit\
Option 2: Set environment variable (recommended)
export MEASUREIT_HOME="/path/to/your/data" # Linux/macOS
set MEASUREIT_HOME="C:\path\to\data" # Windows
Option 3: Programmatic configuration
import measureit
measureit.set_data_dir('/custom/path')
Updating MeasureIt (development version)
cd /path/to/MeasureIt
git pull
pip install -e . --upgrade
Known Issues
ipykernel7.0.x has a dormant event-loop bug that prevents the Qt/pyqtgraph plotter from updating. Stick toipykernel>=6.29(or the newer 7.1+ series).
Installation & Updating
It is useful to first create a conda environment to manage all the required packages for this package to work. First, download some form of conda (Miniforge3 is strongly recommended since it comes with mamba):
- Download Miniforge: https://github.com/conda-forge/miniforge
- Download Anaconda: https://www.anaconda.com/download/
- Download Miniconda: https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html
Basic Usage
Programmatic Usage
import measureit
from qcodes import Station
# Create a station and add instruments
station = Station()
# ... add your instruments ...
# Choose where databases should be stored (optional)
measureit.set_data_dir("/path/to/measureit-data")
# Create a 1D sweep
sweep = measureit.Sweep1D(
set_param=dac.voltage,
start=0,
stop=1,
step=0.01,
inter_delay=0.1
)
# Follow parameters to measure
sweep.follow_param(dmm.voltage, lockin.x)
# Start the measurement
sweep.start()
Sweep Logging
-
All sweeps and the
SweepQueuenow log status messages to timestamped files in the MeasureIt data directory'slogs/folder (see Data Directory Configuration above). Each run creates a file namedsweeps_YYYYMMDD_HHMMSS.logthat captures info/warning/error messages. -
To mirror those messages inside Jupyter notebooks, attach the notebook handler once per kernel:
from measureit import attach_notebook_logging attach_notebook_logging()
The handler safely marshals log output from background Qt threads back into the notebook cell output, so database switches and sweep transitions are visible while the queue runs.
Documentation
Building Documentation
# Install documentation dependencies
uv pip install -e ".[docs]" # or pip install -e ".[docs]"
# Build HTML documentation
cd docs/source
make html
The documentation is located in the docs/source directory. The built documentation will be in docs/source/_build/html/.
Online Documentation
Visit our online documentation for detailed guides and API reference.
Testing
MeasureIt includes a comprehensive test suite to ensure reliability and correctness.
Running Tests Locally
# Install development dependencies
pip install -e ".[dev,jupyter]"
# Run all tests
pytest
# Run with coverage report
pytest --cov=src/measureit --cov-report=html
# Run specific test categories
pytest tests/unit -v # Unit tests only
pytest tests/integration -v # Integration tests only
pytest -m "not slow" # Skip slow tests
# Run tests with Qt debugging
export PYTEST_QT_API=pyqt5
export QT_LOGGING_RULES="*.debug=true"
pytest tests/integration -v -s
Test Organization
tests/unit/: Fast, isolated unit tests for individual componentstests/integration/: Tests for component interactions (Qt threads, signals)tests/e2e/: End-to-end tests for complete workflowstests/stress/: Performance and stress tests
Test Infrastructure
MeasureIt uses:
- pytest with pytest-qt for Qt event loop handling
- pytest-cov for coverage reporting
- Mock QCoDeS instruments for hardware-independent testing
- Temporary databases and isolated MEASUREIT_HOME per test
Continuous Integration
All tests run automatically on:
- Multiple Python versions (3.8-3.12)
- Multiple operating systems (Linux, Windows, macOS)
- Every push and pull request
See TODO_CI_test_plan.md for detailed testing strategy.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed information about:
- Setting up a development environment
- Code quality standards and tools
- Testing guidelines
- Documentation standards
- Submitting pull requests
For quick development setup:
# Clone and set up development environment
git clone https://github.com/nanophys/MeasureIt
cd MeasureIt
uv pip install -e ".[dev,docs,jupyter]" # or pip install -e ".[dev,docs,jupyter]"
# Run tests to verify setup
pytest tests/unit -v
External links and active known users
Seattle
Cambridge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qmeasure-1.1.2.tar.gz.
File metadata
- Download URL: qmeasure-1.1.2.tar.gz
- Upload date:
- Size: 131.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6faa11d6979035cc0e568e7b006a86019d9aea0c512b055b27bad0c87ac1d67
|
|
| MD5 |
bf0e5f73c1a32206eb60d5dbd23b5ca0
|
|
| BLAKE2b-256 |
1b12f51b35cdcfac0d8c4c4a30dc0aee7e22482410b2754d212b1275e4f1be26
|
File details
Details for the file qmeasure-1.1.2-py3-none-any.whl.
File metadata
- Download URL: qmeasure-1.1.2-py3-none-any.whl
- Upload date:
- Size: 149.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a99d68dbab79bf8793cb2385e1e7939691cb846959fe51497877bdacb61900a6
|
|
| MD5 |
c093e20ef694416b1c77f437e87df7f0
|
|
| BLAKE2b-256 |
4bd9c827c585a1a4813437b34f724ff558661c1d53e9c9b59b74a0ddc2b2d0fc
|