Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Implementation of the Observer pattern for NumPy arrays

Project Description

Implementation of the Observer pattern for NumPy arrays.

Example

from numpy import array
from ndarray_listener import ndarray_listener as ndl

a = ndl(array([-0.5, 0.1, 1.1]))

class Observer(object):
  def __init__(self):
    self.called_me = False

  def __call__(self, _):
    self.called_me = True

o = Observer()
a.talk_to(o)
print(o.called_me)
a[0] = 1.2
print(o.called_me)

The output should be

False
True

Install

The recommended way of installing it is via conda

conda install -c conda-forge ndarray-listener

An alternative way would be via pip

pip install ndarray-listener

Running the tests

After installation, you can test it

python -c "import ndarray_listener; ndarray_listener.test()"

as long as you have pytest.

Authors

License

This project is licensed under the MIT License - see the License file for details.

Release History

Release History

This version
History Node

1.0.26

History Node

1.0.25

History Node

1.0.24

History Node

1.0.23

History Node

1.0.22

History Node

1.0.21

History Node

1.0.20

History Node

1.0.19

History Node

1.0.18

History Node

1.0.17

History Node

1.0.16

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ndarray_listener-1.0.26-py2-none-any.whl (6.5 kB) Copy SHA256 Checksum SHA256 py2 Wheel Sep 3, 2017
ndarray_listener-1.0.26-py3-none-any.whl (6.5 kB) Copy SHA256 Checksum SHA256 py3 Wheel Sep 3, 2017
ndarray-listener-1.0.26.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source Sep 3, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting