Skip to main content

PyPI-Status Conda-Forge-Status Conda-Downloads

Build-Status Codacy-Grade License-Badge Doc-Status

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 files for ndarray-listener 1.0.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ndarray-listener 1.0.26
File Size Uploaded
ndarray-listener-1.0.26.tar.gz 5.3 kB Details

Release files / ndarray-listener-1.0.26.tar.gz

Download URL ndarray-listener-1.0.26.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44a18bba0a6353440f7831782e01ede253078144d17b8b8a48a8936347e1538d
BLAKE2b-256 checksum
How to use checksums
e7614c80218e4e3aec0474dcf94a43ef704510f39e628f27cec761c18a8b49b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.0.2

2 release files

2.0.1

2 release files

2.0.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.29

1 release file

1.0.28

1 release file

1.0.27

1 release file

This release

1.0.26 This release

1 release file

1.0.25

1 release file

1.0.24

1 release file

1.0.23

1 release file

1.0.22

1 release file

1.0.21

1 release file

1.0.20

1 release file

1.0.19

1 release file

1.0.18

1 release file

1.0.17

1 release file

1.0.16

1 release file

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