Implementation of the Observer pattern for NumPy arrays
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ndarray_listener-2.0.2.tar.gz.
File metadata
- Download URL: ndarray_listener-2.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46fefc573b1b8f681502649beb349771de67a114a17f4b9c48836d8fba18a936
|
|
| MD5 |
de83dbb9219b37890d711e40aed974f3
|
|
| BLAKE2b-256 |
345f246873b4d6d92453fe949e9914a5a0ad85cf72ecd50e9d11ad13956d7146
|
Provenance
The following attestation bundles were made for ndarray_listener-2.0.2.tar.gz:
Publisher:
release.yml on limix/ndarray-listener
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ndarray_listener-2.0.2.tar.gz -
Subject digest:
46fefc573b1b8f681502649beb349771de67a114a17f4b9c48836d8fba18a936 - Sigstore transparency entry: 159303082
- Sigstore integration time:
-
Permalink:
limix/ndarray-listener@2d00e0c7693714c7a2023b3118da15e76dccc078 -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/limix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d00e0c7693714c7a2023b3118da15e76dccc078 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ndarray_listener-2.0.2-py3-none-any.whl.
File metadata
- Download URL: ndarray_listener-2.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f963fdb36abd87334cf7eff299c10396064ac82e4f2ff41d8b23bc0e1ce2805
|
|
| MD5 |
09c31d3242272773f02784c74d4679b7
|
|
| BLAKE2b-256 |
91cf70e70b7d5deab6bfbc8d667d316fb6b757d9fd38739f96b475b728858b80
|
Provenance
The following attestation bundles were made for ndarray_listener-2.0.2-py3-none-any.whl:
Publisher:
release.yml on limix/ndarray-listener
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ndarray_listener-2.0.2-py3-none-any.whl -
Subject digest:
6f963fdb36abd87334cf7eff299c10396064ac82e4f2ff41d8b23bc0e1ce2805 - Sigstore transparency entry: 159303083
- Sigstore integration time:
-
Permalink:
limix/ndarray-listener@2d00e0c7693714c7a2023b3118da15e76dccc078 -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/limix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d00e0c7693714c7a2023b3118da15e76dccc078 -
Trigger Event:
push
-
Statement type: