Skip to main content

ezmsg-neo

Load and stream data from neo files into ezmsg.

Installation

pip install ezmsg-neo

Or install the latest development version:

pip install git+https://github.com/ezmsg-org/ezmsg-neo@dev

Dependencies

Usage

ezmsg-neo modules are available under import ezmsg.neo

Add the NeoIteratorUnit to your ezmsg graph as a data source. You may be interested in other ezmsg extensions for processing the data, such as ezmsg-sigproc and ezmsg-event.

import ezmsg.core as ez
from ezmsg.neo.source import NeoIteratorUnit
from ezmsg.util.messages.key import FilterOnKey
from ezmsg.util.debuglog import DebugLog
from ezmsg.event.rate import EventRate


comps = {
    "NEO": NeoIteratorUnit(filepath="path/to/file", chunk_dur=0.05),
    "FILTER": FilterOnKey(key="spike"),
    "RATE": EventRate(bin_duration=0.05),
    "LOG": DebugLog()  # Print the output to the console
}
conns = (
    (comps["NEO"].OUTPUT_SIGNAL, comps["FILTER"].INPUT_SIGNAL),
    (comps["FILTER"].OUTPUT_SIGNAL, comps["RATE"].INPUT_SIGNAL),
    (comps["RATE"].OUTPUT_SIGNAL, comps["LOG"].INPUT),
)
ez.run(components=comps, connections=conns)

Standalone

The NeoIterator class can be used outside ezmsg for offline processing:

from ezmsg.neo.source import NeoIterator, NeoIteratorSettings
from ezmsg.util.messages.axisarray import AxisArray

settings = NeoIteratorSettings(filepath="data.nev", chunk_dur=0.05)
neo_iter = NeoIterator(settings)

# Filter messages by key (e.g., "ns3" for analog signals, "spike" for spikes)
sig_msgs = [msg for msg in neo_iter if msg.key.startswith("ns")]

# Concatenate all chunks into a single AxisArray
full_signal = AxisArray.concatenate(*sig_msgs, dim="time")

NeoIterator Messages

The NeuoIteratorUnit and NeoIterator objects, when called, return AxisArray messages with a key attribute identifying the signal type:

  • Analog signals - Key matches the stream name (e.g., "ns3"). Data shape: (n_samples, n_channels)
  • Spike trains - Key is "spike". Data is a sparse array with shape (n_units, n_samples)
  • Events - Key is "events". Data contains event labels and its time axis is irregular (CoordinateAxis) with timestamps associated with each event.

Development

  1. Clone this repo and cd into it
  2. uv sync to setup your environment
  3. uv run pytest tests to run the tests
  4. (Optional) Install pre-commit hooks: uv run pre-commit install

Download files

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

Source Distribution

ezmsg_neo-0.7.0.tar.gz (6.7 MB view details)

Uploaded Source

Built Distribution

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

ezmsg_neo-0.7.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ezmsg_neo-0.7.0.tar.gz.

File metadata

  • Download URL: ezmsg_neo-0.7.0.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ezmsg_neo-0.7.0.tar.gz
Algorithm Hash digest
SHA256 312e81ef29fb55e704735eab9fdd7eb1b7a271f0678321bb9b87b2edc877f6c2
MD5 d38ce1316dfd566be6e5ebd2f63c3c29
BLAKE2b-256 7338a92d3598aa9e51205e0c2f47f01b10e04372d975e0a318c620c3c6426964

See more details on using hashes here.

File details

Details for the file ezmsg_neo-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: ezmsg_neo-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ezmsg_neo-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9eac5002a2de0371058f27aefd2617b22f2dc0f235dede723cffcc8b1f6a87ed
MD5 74cf39d11f58139ac37e0fb8b25878b0
BLAKE2b-256 acd132dda3d00f8143cbd77bfcf4163ee5f51d9820cb561f01febbfe27141310

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3

2 files

0.2

2 files

0.1

2 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