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

From command line, enter

pip install ndarray-listener

Running the tests

Install dependencies

pip install -U pytest pytest-pep8

then run

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

Authors

License

This project is licensed under the MIT License.

Release History

This version
History Node

1.1.1

History Node

1.1.0

History Node

1.0.29

History Node

1.0.28

History Node

1.0.27

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 the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
ndarray_listener-1.1.1.tar.gz
(5.1 kB) Copy SHA256 Hash SHA256
Source None Feb 22, 2018

Supported By

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 Google Google Cloud Servers DreamHost DreamHost Log Hosting