Skip to main content

Morelia

logo

Introduction

GitHub license GitHub repo size GitHub issues GitHub pull requests GitHub last commit GitHub commit activity

Morelia is a free, open-source Python application programming interface (API) for Pinnacle Technology, Inc. data acquisition POD devices. Morelia core modules, usage examples, and supporting documentation can be found here on GitHub and are available freely under the New BSD License.

Currently, the API supports 8206-HR, 8401-HR, 8229, 8480-SC, and 8274-D POD devices. In the future, we will offer support to other Pinnacle devices.

You can find extensive documentation for the package here.

Installation

Create and activate a virtual environment, then install with pip:

  • Windows: python -m venv venv then venv\Scripts\activate
  • Linux / WSL: python3 -m venv venv then source venv/bin/activate

Then run:

pip install ptech-morelia

ptech-morelia depends on pypvfs (Pinnacle PVFS bindings). Until pypvfs 0.1.0 (or newer) is published on PyPI with the full pvfs_tools implementation, install it from a local checkout first:

pip install -e /path/to/pypvfs
pip install ptech-morelia

To install from a local clone: pip install . (or pip install .[plot] to include plotting support)

Development install (editable mode)

If you are modifying the source or building a derivative application, use an editable install:

pip install -e .
pip install -e .[plot]        # with plotting support

A normal pip install . copies your source files into the virtual environment's site-packages directory. Python imports from that copy, so any edits you make to the source are not visible until you run pip install . again. The -e flag (short for --editable) skips the copy and links site-packages back to your working directory instead. Python then imports directly from your source tree, so edits take effect the next time you import the module with no additional steps.

If you are using conda for the Qt stack on ARM or other platforms, install Morelia in editable mode after the conda dependencies:

conda install -c conda-forge pyqtgraph pyqt numpy
pip install -e .

Live plotting (optional)

Live EEG-style plotting requires Qt libraries that are not included in the base install. To add plotting support:

pip install ptech-morelia[plot]

This installs pyqtgraph and PyQt6.

Platform Install command Notes
Windows / macOS pip install ptech-morelia[plot] Works out of the box
Ubuntu / Debian / WSL bash install_ubuntu.sh && pip install ptech-morelia[plot] System libraries needed first
ARM Linux (RPi, etc.) See conda instructions below pip may fail to build Qt

Ubuntu / Debian / WSL: Run install_ubuntu.sh before installing the plot extra to get the required system libraries. If the plotting examples (e.g. 8206_plot_stream.py) still fault after that, install the xcb libraries:

sudo apt install libxcb-xinerama0 libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0

With WSLg (WSL 2), the plot window will appear on your Windows desktop. Older versions of WSL do not support graphics — in that case, use the non-plot examples.

ARM Linux or other platforms where pip cannot build Qt: Install Miniforge (a lightweight conda distribution), then use conda for the Qt stack and pip for Morelia:

conda init bash && source ~/.bashrc   # only needed once after installing conda
conda create -n morelia python=3.11
conda activate morelia
conda install -c conda-forge pyqtgraph pyqt numpy
pip install ptech-morelia

All non-plotting features (streaming, file recording, data conversion, etc.) work without the plot extra installed.

Sink performance and the GIL

Morelia’s streaming pipeline uses DataFlow workers implemented as separate Python processes. Each worker has its own Python Global Interpreter Lock (GIL), but within a worker all sinks and RxPy threads share a single GIL.

  • Default sinks (in-process): Sinks like PvfsSink(output_path, pod) run entirely inside the worker process. This is simple and efficient when a sink runs alone (e.g. 8206_pvfs_stream.py).

  • Threaded sinks (observe_on_scheduler): Some sinks can request observe_on_scheduler="thread_pool" so their flush() runs on a thread-pool thread instead of the emission thread. This helps when a sink occasionally does extra Python work, but still shares the same GIL as other sinks in that worker.

  • Writer-process sinks (use_writer_process=True): PvfsSink can offload all PVFS I/O into a dedicated child process:

    from Morelia.Stream.sink import PvfsSink
    
    # Record only (single sink)
    pvfs_sink = PvfsSink(output_path, pod)
    
    # Plot + record at high sample rates – keeps PlotSink responsive
    pvfs_sink = PvfsSink(output_path, pod, use_writer_process=True)
    

    In this mode, PvfsSink.flush() in the worker is very lightweight (it just enqueues values to a multiprocessing queue), and a separate writer process handles all PVFS disk I/O under its own GIL. This is recommended for “plot + record” examples like 8401_plot_and_save_stream.py at high sample rates.

For “record only” tools (such as 8206_pvfs_stream.py), the default in-process PvfsSink is usually preferred: there is no competing sink to starve, and the simpler single-process path is both easier to debug and slightly more efficient.

PVFS native libraries

PVFS recording uses the pypvfs package (Pinnacle PVFS file support). It is installed automatically with pip install ptech-morelia and provides native libraries for Windows and Linux (including WSL) when using published wheels.

If you are developing or building from source on Linux/WSL and the bundled .so files are incompatible, rebuild them from the pypvfs repository:

git clone https://github.com/Pinnacle-Technology-Inc/pypvfs.git
cd pypvfs/src/pvfs_tools/Core
./build_linux.sh
pip install -e ../../..

Requires cmake and a C++17 compiler (e.g. g++). Use pip install -e path/to/pypvfs in the same environment as Morelia until a matching pypvfs release is on PyPI.

Standalone PVFS tools (EDF / WebM / CLI)

PVFS-only utilities (EDF converter, WebM exporter, synthetic file CLI) live in the pypvfs repo under examples/. See the pypvfs README.

Release files for ptech-morelia 1.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ptech-morelia 1.8.2
File Size Uploaded
ptech_morelia-1.8.2.tar.gz 13.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ptech-morelia 1.8.2
File Interpreter ABI Platform
ptech_morelia-1.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 MB

Release files / ptech_morelia-1.8.2.tar.gz

Download URL ptech_morelia-1.8.2.tar.gz
Size 13.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c5f1778488af6bce5fb5ef025a0824ae91af23b9fcee218e8e7724c67445926d
BLAKE2b-256 checksum
How to use checksums
2331e5d173f67687499184546ff2cc30b5c6338946b61bea9b57311bdabb19b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release files / ptech_morelia-1.8.2-py3-none-any.whl

Download URL ptech_morelia-1.8.2-py3-none-any.whl
Size 132.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edd039b62e75e8fb28c95492d061053297a0e272c2076356e41c266eae839fb5
BLAKE2b-256 checksum
How to use checksums
4f51bda9b13d70b526ac4bf53edbea67374de7b5233bc5ae3da65f17da20fb63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.2 This release

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.3

2 release files

1.6.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page