Skip to main content

Integrated Tools for Electronic, Cryogenic and Magnetic Measurements

Project description

pyflexlab 🔬

Python 3.11+ PyMeasure QCoDeS License: MIT

An integrated package for scientific data collection, processing, and visualization

pyflexlab is an integrated package based on PyMeasure and QCoDeS, designed for collecting, processing, and plotting experimental data.

Why pyflexlab instead of QCoDeS/PyMeasure? While QCoDeS/PyMeasure provides excellent out-of-box experience for experiments, pyflexlab offers a more flexible, lower-level interface that enables direct control over instruments, as if sitting right beside them. This approach allows researchers to implement highly customized experimental workflows. More to mention, the drivers of QCoDeS or PyMeasure alone are not complete. It's often the case one needs to assemble different versions of drivers.

Brief Summary of What it does: Utilize the basic interface of PyMeasure & QCoDeS to manipulate instruments and encapsulate similar instruments with unified interface, thus providing basic modules for measurement workflow.

📋 Table of Contents

✨ Key Features

  • 🔧 Flexible Architecture: Lower-level interface and modularized components, enabling flexible composition of complex functionalities
  • 🎛️ Unified Control: Seamless interface for instruments control
  • 💾 Automatic File Organization: Structured data storage with automatic file organization
  • 📊 Live Visualization: Real-time visualization and data recording (Jupyter / Dash web interface)
  • 📈 Data Analysis: Comprehensive tools for data analysis and processing

🚀 Installation

Ensure you have Python 3.11 or higher installed. Virtual environment is recommended. You can install it through pypi or local package downloaded here (add [gui] option for using GUI):

# local package installation
cd ${PACKAGE_DIR}  # replace with folder path
python -m pip install . 
# pypi installation
python -m pip install pyflexlab 

📖 Usage

Set Environmental Variables

  • PYLAB_DB_LOCAL: the path to the local database, storing rarely changing data like measure_type.json
  • PYLAB_DB_OUT: the path to the out database, storing the main experimental data and records

(set them via os.environ or directly in the system setting, the suffixes of the env vars do not matter, like PYLAB_DB_OUT and PYLAB_DB_OUT_User are the same. The package will automatically choose the first one found in alphabetic order)

Configure Local Setting Files

measure_types.json is used for automatically naming data files. This highly depends on personal preferences and research needs. A template is provided. assist_measure.ipynb and assist_post.ipynb are jupyter notebook files used for convenience of measurements. The program will automatically retrieve them from local database path and paste them to the measurement directory.

These files should be placed in the local database directory specified by PYLAB_DB_LOCAL.

Also, templates for them are provided with the package, run follow command to initialize the local database folder:

import pyflexlab
pyflexlab.initialize_with_templates()

Start Measurement

Detailed examples of a few typical measurements have been demonstrated in assist_measure.ipynb. But just as the reason why this package exists, the measurement workflow can be easily established via basic python knowledge and understanding of instruments.

Provided GUIs

  • 🔄 gui-coor-trans: A GUI for coordinate transformation used to locate objects using two reference points on a flat surface (linear transform solver)
  • 🎨 gui-pan-color: A color palette for choosing colors

🔌 Supported Instruments

Currently supported instruments are listed here (some are directly from or modified from PyMeasure/QCoDeS; others are self-written):

  • Meters: Keithley 2182a/2400/2401/2450/6221/6430/6500; SR830
  • Temperature Controllers: Oxford ITC503, Oxford Mercury ITC
  • Magnet Controllers: Oxford IPS
  • Other Instruments: Probe Rotator (need C++ interface WJ_API.dll)

Custom instrument drivers can be easily added referring to the abstract classes in equip_wrapper.py. Drivers with good universality will be contributed back to PyMeasure or QCoDeS, hopefully.

⚠️ Known Issues

  • The memory management of plotly drawing remains a problem for long-time measurement. (be careful when number of points exceeds 50k)
  • The driver of the rotator is not working properly due to weird interaction between C++ dll and python
  • Currently no keyboard interruption actions implemented, if the measurement is interrupted, the meters would be left in the last state (data is saved in real-time, interruption won't affect data)
  • The dash app in Chrome would crash from time to time. (won't affect anything, just refresh the page)

📦 Dependencies

  • Python >= 3.11 (earlier version is not tested)
  • Required packages:
    • numpy
    • pandas
    • matplotlib
    • plotly >= 5.24.1
    • kaleido == 0.1.0.post1
    • pyvisa
    • pyvisa-py
    • pymeasure >= 0.14.0
    • qcodes >= 0.47.0
    • jupyter
    • dash
  • Optional packages:
    • PyQt6

Built with ❤️ for scientific research

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

pyflexlab-1.0b1.tar.gz (107.2 kB view details)

Uploaded Source

Built Distribution

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

pyflexlab-1.0b1-py3-none-any.whl (109.8 kB view details)

Uploaded Python 3

File details

Details for the file pyflexlab-1.0b1.tar.gz.

File metadata

  • Download URL: pyflexlab-1.0b1.tar.gz
  • Upload date:
  • Size: 107.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for pyflexlab-1.0b1.tar.gz
Algorithm Hash digest
SHA256 95bca0e90a929bcabf7834c1a72e67abd1b399eb1a10d9b4cedf2bac63b9706a
MD5 b66b14a00107a3ef444a0c0d88a36d95
BLAKE2b-256 9eb84fb57adddc5337d139ec03eb95678014197254aa252faf9e9320e52e4edf

See more details on using hashes here.

File details

Details for the file pyflexlab-1.0b1-py3-none-any.whl.

File metadata

  • Download URL: pyflexlab-1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 109.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for pyflexlab-1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 2335650a0db75f17c8c7a74efd12f4014d0e3a821e19c0264d883a89e7fca287
MD5 8e6f920d72b34e500c2db56d28c74466
BLAKE2b-256 053d1148c84b61864a037f2842c5249bef475e79595484376565995bf7b4b8ac

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