Skip to main content

ndarray-listener

Implementation of the Observer pattern for NumPy arrays.

Example

from numpy import array
from ndarray_listener import 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 pytest

then run

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

Documentation

Documentation

Authors

License

This project is licensed under the MIT License.

Metadata

Release files for ndarray-listener 2.0.2

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 2.0.2
File Size Uploaded
ndarray_listener-2.0.2.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ndarray-listener 2.0.2
File Interpreter ABI Platform
ndarray_listener-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / ndarray_listener-2.0.2.tar.gz

Download URL ndarray_listener-2.0.2.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
46fefc573b1b8f681502649beb349771de67a114a17f4b9c48836d8fba18a936
BLAKE2b-256 checksum
How to use checksums
345f246873b4d6d92453fe949e9914a5a0ad85cf72ecd50e9d11ad13956d7146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2025.

Transparency log

Release files / ndarray_listener-2.0.2-py3-none-any.whl

Download URL ndarray_listener-2.0.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f963fdb36abd87334cf7eff299c10396064ac82e4f2ff41d8b23bc0e1ce2805
BLAKE2b-256 checksum
How to use checksums
91cf70e70b7d5deab6bfbc8d667d316fb6b757d9fd38739f96b475b728858b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.2 This release

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

1.0.26

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