Skip to main content

An oscilloscope for python that just works™

Project description

Oscilloscope

An oscilloscope for python that just works™

It's fucking simple to use

This

import random
from time import sleep

from oscilloscope import Osc


osc = Osc()

@osc.signal
def random_signal(update):
    while True:
        update(random.random())
        sleep(0.1)

osc.start()

Gives you this

Parallel compute

Each osc.signal gets it's own process.

This

import random
from time import sleep

from oscilloscope import Osc


osc = Osc(nrows=2, ncols=3)

@osc.signal
def signal1(update):
    while True:
        update(random.random())
        sleep(0.1)

@osc.signal
def signal2(update):
    while True:
        update(random.random(), row=1, col=2)
        sleep(0.1)

osc.start()

Gives you this

Automatic normalization

This

import random
from time import sleep

from oscilloscope import Osc


# increase the time scale so we can see clearly
osc = Osc(time_axis_sec=10)

@osc.signal
def irregular_signal(update):
    for _ in range(10):
        update(random.randint(0, 1))
        sleep(0.1)

    update(0.5)

    print("so I'm totally gonna fuck up after 5 sec")
    sleep(5)

    while True:
        update(random.randint(0, 1000))
        sleep(0.1)

osc.start()

Gives you this

After the 5 sec pause, the signal range changes drastically, but the graph still retains its coherence!

(The Y-axis is basically the % of the max value encountered at the time)

Install

pip install oscilloscope[pyqt5]

Install using the pyQt5 backend. (tkinter by default)

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

oscilloscope-0.0.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

oscilloscope-0.0.1-py2.py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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