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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| ndarray_listener-2.0.2.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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