Skip to main content

JupyterLab extension for QMeasure/MeasureIt sweep management

Project description

QMeasure Jupyter

PyPI

A JupyterLab extension providing a beginner-friendly GUI for the MeasureIt sweep measurement package.

The extension is written with claude code. A TODO plan history is provided.

Features

Sweep Creation

  • 📊 Complete Sweep Support - Forms for Sweep0D, Sweep1D, Sweep2D, and SimulSweep
  • Fast Sweeps - Quick templates for Sweepto and GateLeakage measurements
  • 📝 Smart Code Templates - Generates production-ready Python code with proper syntax
  • 🔧 Flexible Validation - Client-side validation that won't block code generation
  • 🎯 Custom Parameters - Add arbitrary keyword arguments to sweep constructors

Queue Manager

  • 📋 Build Sweep Queues - Add sweeps to execution queues with database integration
  • ✏️ Edit Queue Entries - Modify queued sweeps with form auto-fill
  • 🔄 Reorder & Organize - Drag/reorder queue entries, duplicate sweeps
  • 💾 Database Integration - Supports both inline and variable DatabaseEntry references
  • 🚀 Export Queue Scripts - Generate complete, runnable queue code

Advanced Analytics

  • 🔍 Cross-Cell Tracking - Detects sweeps and queue entries across all notebook cells
  • 📊 Queue Position Display - Shows "Position X of Y" for queued sweeps
  • 🔁 Loop Context Detection - Identifies sweeps defined in FOR/WHILE loops
  • ⚙️ Function Context - Tracks sweeps inside function definitions
  • 🌳 Tree-Sitter Parser - Robust AST parsing for accurate code analysis

User Experience

  • 💾 Form Persistence - Automatically saves form inputs to localStorage
  • 🔄 Reset to Defaults - Clear saved values with one click
  • Inline Help - Hover over (?) icons to see parameter descriptions
  • 🎨 Visual Feedback - Badges for queued sweeps, fast sweeps, loop/function context

Requirements

  • JupyterLab >= 4.0.0
  • Python >= 3.8
  • qmeasure (MeasureIt)

Development Install

Note: You will need NodeJS to build the extension package.

# Clone the repo to your local environment
cd qmeasure-jupyter

# Install package in development mode
pip install -e ".[dev]"

# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

# Server extension must be manually installed in develop mode
jupyter server extension enable qmeasure_jupyter

# Rebuild extension TypeScript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch

# Run JupyterLab in another terminal
jupyter lab

Quick Start

Basic Usage

  1. Open JupyterLab and create or open a notebook
  2. Find "Sweep Manager" in the left sidebar
  3. Select sweep type using the tabs (Sweep0D, 1D, 2D, or SimulSweep)
  4. Fill in parameters - hover over (?) icons for help
  5. Click "Generate Code" to insert into the active cell
  6. Run the cell (Shift+Enter) to execute your sweep

Example: Creating a 1D Gate Sweep

# 1. In the Sweep1D tab, fill in:
Name: gate_sweep
Set Parameter: station.dac.ch1
Start: -1
Stop: 1
Step: 0.1
Follow Parameters: station.dmm.voltage, station.lockin.X

# 2. Click "Generate Code" - this is inserted:
set_param = station.dac.ch1

gate_sweep = Sweep1D(
    set_param=set_param,
    start=-1,
    stop=1,
    step=0.1,
    save_data=True,
    plot_data=True
)

gate_sweep.follow_param(station.dmm.voltage)
gate_sweep.follow_param(station.lockin.X)

gate_sweep.start()

# 3. Run the cell to execute the sweep

Next Steps

  • Check the Table of Contents at the bottom of the Sweep Manager to see all detected sweeps
  • Click on any sweep name to view its details in the right sidebar
  • Use "Reset to Defaults" button to clear saved form values
  • See USAGE.md for comprehensive documentation

Documentation

  • USAGE.md - Comprehensive user guide with examples
  • DEVELOPMENT.md - Development setup and contribution guidelines
  • TODO.md - Development roadmap and progress tracking

Supported Sweep Types

Sweep Type Use Case Example
Sweep0D Point measurements without sweeping Measure current at fixed voltage
Sweep1D 1D parameter sweeps Gate voltage sweep from -1V to 1V
Sweep2D 2D nested sweeps Gate voltage vs. magnetic field map
SimulSweep Simultaneous multi-parameter sweeps Sweep two gates while maintaining ratio

Key Features Explained

Follow Parameters

Measure additional parameters at each sweep point without controlling them:

# Follow parameters are measured but not swept
gate_sweep.follow_param(station.dmm.voltage)
gate_sweep.follow_param(station.lockin.X)

Custom Parameters

Pass arbitrary keyword arguments to sweep constructors:

# Add custom metadata or configuration
s_1D = Sweep1D(
    ...,
    temperature=300,      # Custom parameter
    sample_name="DeviceA" # Custom parameter
)

Form Persistence

Your form inputs are automatically saved to browser localStorage and restored when you reopen JupyterLab. Click "Reset to Defaults" to clear saved values.

Table of Contents

The extension automatically detects sweep objects in your notebook using tree-sitter parsing. Click any sweep in the ToC to view its configuration in the right sidebar.

Contributing

See DEVELOPMENT.md for development guidelines.

License

MIT License - see LICENSE file for details.

Acknowledgments

Built for the MeasureIt measurement framework, developed at the University of Washington.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qmeasure_jupyter-1.0.0.tar.gz (53.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qmeasure_jupyter-1.0.0-py3-none-any.whl (204.1 kB view details)

Uploaded Python 3

File details

Details for the file qmeasure_jupyter-1.0.0.tar.gz.

File metadata

  • Download URL: qmeasure_jupyter-1.0.0.tar.gz
  • Upload date:
  • Size: 53.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for qmeasure_jupyter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b5b4bd1b1a675d564870433c7e38b8387f82bc0c8902aa2ad2dc9b12939e7be7
MD5 51598ff412a93332da1872730e348966
BLAKE2b-256 f70fce3a19f5911514cf3377d94e1c46e48eccef5b50a0781d2a3b3e0b85fbed

See more details on using hashes here.

File details

Details for the file qmeasure_jupyter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qmeasure_jupyter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b65a0923b64c3aa06e0a3b54871665d2cfb6042243a30e273309ad29d4dab2ea
MD5 0450c2638e665175ca5eecf8d9520bdc
BLAKE2b-256 9cc005fbca8734dffc23edfcdf4e0a3f019cbae937d763b76189decb038f9815

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page