pyflexlab


Namepyflexlab JSON
Version 1.0b0 PyPI version JSON
download
home_pageNone
SummaryIntegrated Tools for Electronic, Cryogenic and Magnetic Measurements
upload_time2025-02-27 11:52:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License
keywords measurement instrumentation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyflexlab 🔬

<div align="center">

[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![PyMeasure](https://img.shields.io/badge/PyMeasure-0.14.0+-orange.svg)](https://github.com/pymeasure/pymeasure)
[![QCoDeS](https://img.shields.io/badge/QCoDeS-0.47.0+-green.svg)](https://github.com/microsoft/Qcodes)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

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

</div>

**pyflexlab** is an integrated package based on [PyMeasure](https://github.com/pymeasure/pymeasure) and [QCoDeS](https://github.com/microsoft/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

- [🚀 Installation](#-installation)
- [✨ Key Features](#-key-features)
- [📖 Usage](#-usage)
    - [Set Environmental Variables](#set-environmental-variables)
    - [Configure Local Setting Files](#configure-local-setting-files)
    - [Start Measurement](#start-measurement)
    - [Provided GUIs](#provided-guis)
- [⚠️ Known Issues](#️-known-issues)
- [📦 Dependencies](#-dependencies)

## ✨ 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):

```bash
# 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](#set-environmental-variables).

Also, templates for them are provided with the package, run follow command to initialize the local database folder:
```python
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 

## ⚠️ 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

---

<div align="center">
  <sub>Built with ❤️ for scientific research</sub>
</div>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyflexlab",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "measurement, instrumentation",
    "author": null,
    "author_email": "Dongkai <dongkai001@e.ntu.edu.sg>",
    "download_url": "https://files.pythonhosted.org/packages/b3/0b/85913a42fcafffbf9ec164052fce79ccf5cccbcb1be9f940bdb39ac39247/pyflexlab-1.0b0.tar.gz",
    "platform": null,
    "description": "# pyflexlab \ud83d\udd2c\r\n\r\n<div align=\"center\">\r\n\r\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\r\n[![PyMeasure](https://img.shields.io/badge/PyMeasure-0.14.0+-orange.svg)](https://github.com/pymeasure/pymeasure)\r\n[![QCoDeS](https://img.shields.io/badge/QCoDeS-0.47.0+-green.svg)](https://github.com/microsoft/Qcodes)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\n**An integrated package for scientific data collection, processing, and visualization**\r\n\r\n</div>\r\n\r\n**pyflexlab** is an integrated package based on [PyMeasure](https://github.com/pymeasure/pymeasure) and [QCoDeS](https://github.com/microsoft/Qcodes),\r\ndesigned for collecting, processing, and plotting experimental data.\r\n\r\n> **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.*\r\n\r\n> **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.\r\n\r\n## \ud83d\udccb Table of Contents\r\n\r\n- [\ud83d\ude80 Installation](#-installation)\r\n- [\u2728 Key Features](#-key-features)\r\n- [\ud83d\udcd6 Usage](#-usage)\r\n    - [Set Environmental Variables](#set-environmental-variables)\r\n    - [Configure Local Setting Files](#configure-local-setting-files)\r\n    - [Start Measurement](#start-measurement)\r\n    - [Provided GUIs](#provided-guis)\r\n- [\u26a0\ufe0f Known Issues](#\ufe0f-known-issues)\r\n- [\ud83d\udce6 Dependencies](#-dependencies)\r\n\r\n## \u2728 Key Features\r\n- \ud83d\udd27 **Flexible Architecture**: Lower-level interface and modularized components, enabling flexible composition of complex functionalities\r\n- \ud83c\udf9b\ufe0f **Unified Control**: Seamless interface for instruments control\r\n- \ud83d\udcbe **Automatic File Organization**: Structured data storage with automatic file organization\r\n- \ud83d\udcca **Live Visualization**: Real-time visualization and data recording (Jupyter / Dash web interface)\r\n- \ud83d\udcc8 **Data Analysis**: Comprehensive tools for data analysis and processing\r\n\r\n## \ud83d\ude80 Installation\r\n\r\nEnsure 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):\r\n\r\n```bash\r\n# local package installation\r\ncd ${PACKAGE_DIR}  # replace with folder path\r\npython -m pip install . \r\n# pypi installation\r\npython -m pip install pyflexlab \r\n```\r\n\r\n## \ud83d\udcd6 Usage\r\n\r\n### Set Environmental Variables\r\n\r\n- `PYLAB_DB_LOCAL`: the path to the local database, storing rarely changing data like `measure_type.json`\r\n- `PYLAB_DB_OUT`: the path to the out database, storing the main experimental data and records\r\n\r\n(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)\r\n\r\n### Configure Local Setting Files\r\n\r\n`measure_types.json` is used for automatically naming data files. This highly depends on personal preferences and research needs. A template is provided. \r\n`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.\r\n\r\nThese files should be placed in the local database directory specified by [PYLAB_DB_LOCAL](#set-environmental-variables).\r\n\r\nAlso, templates for them are provided with the package, run follow command to initialize the local database folder:\r\n```python\r\nimport pyflexlab\r\npyflexlab.initialize_with_templates()\r\n```\r\n\r\n### Start Measurement\r\n\r\nDetailed 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.\r\n\r\n### Provided GUIs\r\n\r\n- \ud83d\udd04 **gui-coor-trans**: A GUI for coordinate transformation used to locate objects using two reference points on a flat surface (linear transform solver)\r\n- \ud83c\udfa8 **gui-pan-color**: A color palette for choosing colors \r\n\r\n## \u26a0\ufe0f Known Issues\r\n\r\n- The memory management of plotly drawing remains a problem for long-time measurement. (be careful when number of points exceeds 50k)\r\n- The driver of the rotator is not working properly due to weird interaction between C++ dll and python\r\n- 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)\r\n- The `dash` app in Chrome would crash from time to time. (won't affect anything, just refresh the page)\r\n\r\n## \ud83d\udce6 Dependencies\r\n\r\n- Python >= 3.11 (earlier version is not tested)\r\n- Required packages:\r\n  - numpy\r\n  - pandas\r\n  - matplotlib\r\n  - plotly >= 5.24.1\r\n  - kaleido == 0.1.0.post1\r\n  - pyvisa\r\n  - pyvisa-py\r\n  - pymeasure >= 0.14.0\r\n  - qcodes >= 0.47.0\r\n  - jupyter\r\n  - dash\r\n- Optional packages:\r\n  - PyQt6\r\n\r\n---\r\n\r\n<div align=\"center\">\r\n  <sub>Built with \u2764\ufe0f for scientific research</sub>\r\n</div>\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Integrated Tools for Electronic, Cryogenic and Magnetic Measurements",
    "version": "1.0b0",
    "project_urls": null,
    "split_keywords": [
        "measurement",
        " instrumentation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "265fba2227088951c10fda892467d611c71a4bbdc44b27fff2543cac97927be2",
                "md5": "4396f3c4fc6f77a3b4a20fd6108a65d5",
                "sha256": "9a1ee231d4bc0d8b9d5cd7b8cdf9675f28a5a4d3435caf2d6f3e31360fdfd788"
            },
            "downloads": -1,
            "filename": "pyflexlab-1.0b0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4396f3c4fc6f77a3b4a20fd6108a65d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 109446,
            "upload_time": "2025-02-27T11:52:18",
            "upload_time_iso_8601": "2025-02-27T11:52:18.887748Z",
            "url": "https://files.pythonhosted.org/packages/26/5f/ba2227088951c10fda892467d611c71a4bbdc44b27fff2543cac97927be2/pyflexlab-1.0b0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b30b85913a42fcafffbf9ec164052fce79ccf5cccbcb1be9f940bdb39ac39247",
                "md5": "241e8d01b69a1a55bfe914186a30e4a3",
                "sha256": "367ef6d32409d7a9118b0e0d7baee853a8307bc39de10e33b082fcb0721d1a0e"
            },
            "downloads": -1,
            "filename": "pyflexlab-1.0b0.tar.gz",
            "has_sig": false,
            "md5_digest": "241e8d01b69a1a55bfe914186a30e4a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 106397,
            "upload_time": "2025-02-27T11:52:21",
            "upload_time_iso_8601": "2025-02-27T11:52:21.311011Z",
            "url": "https://files.pythonhosted.org/packages/b3/0b/85913a42fcafffbf9ec164052fce79ccf5cccbcb1be9f940bdb39ac39247/pyflexlab-1.0b0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-27 11:52:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyflexlab"
}
        
Elapsed time: 0.84914s