N-dimensional arrays of partial functions.
Project description
Multipartial
Multipartial is a library for constructing N-dimensional arrays of partial
functions. For example, the following snippet shows how to make a 2x3 grid of
partial functions where the a
argument varies by row, the b
argument varies
by column, the c
argument is always the same, and the d
argument is
specified at call-time:
>>> from multipartial import multipartial, dim
>>> def f(a, b, c, d):
... return a, b, c, d
...
>>> grid = multipartial(f, a=dim[0](1, 2), b=dim[1](3, 4, 5), c=6)
>>> grid[0][0](d=7)
(1, 3, 6, 7)
>>> grid[0][1](d=8)
(1, 4, 6, 8)
>>> grid[0][2](d=9)
(1, 5, 6, 9)
>>> grid[1][0](d=10)
(2, 3, 6, 10)
>>> grid[1][1](d=11)
(2, 4, 6, 11)
>>> grid[1][2](d=12)
(2, 5, 6, 12)
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
File details
Details for the file multipartial-0.1.0.tar.gz
.
File metadata
- Download URL: multipartial-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1db84873e663e1847dd8531a7050328702f01844f0867dcb293aa5a25caf09b2 |
|
MD5 | 9c9947812b4df3ecb46fd1d1f7a5c8ef |
|
BLAKE2b-256 | 634805ce60f31fe9b27495f06e04fd2e5cd810ebe6c7af82ce40dc8dea157954 |
Provenance
The following attestation bundles were made for multipartial-0.1.0.tar.gz
:
Publisher:
release.yml
on kalekundert/multipartial
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
multipartial-0.1.0.tar.gz
- Subject digest:
1db84873e663e1847dd8531a7050328702f01844f0867dcb293aa5a25caf09b2
- Sigstore transparency entry: 147409827
- Sigstore integration time:
- Predicate type:
File details
Details for the file multipartial-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: multipartial-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ce85b7980fa510c4f470995d92c7e62f92c4369584fa296269a7a1fb19e3da |
|
MD5 | 527fe29c6e1e05bf4875d65c2447b8bd |
|
BLAKE2b-256 | 6f73603953ad7aa3b5e65b3e289ae17022d8f0043146aa2fc39cd373f4d33fcf |
Provenance
The following attestation bundles were made for multipartial-0.1.0-py3-none-any.whl
:
Publisher:
release.yml
on kalekundert/multipartial
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
multipartial-0.1.0-py3-none-any.whl
- Subject digest:
00ce85b7980fa510c4f470995d92c7e62f92c4369584fa296269a7a1fb19e3da
- Sigstore transparency entry: 147409828
- Sigstore integration time:
- Predicate type: