Skip to main content
Help us improve Python packaging – donate today!

Implementation of the Observer pattern for NumPy arrays

Project Description

Travis AppVeyor Read the Docs (version)

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 Release notifications

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 Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page