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.2.0.tar.gz
.
File metadata
- Download URL: multipartial-0.2.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a22dbf8b4544002763c23a3f1eb5f4147d256f49d0727df9835bec40a92709f |
|
MD5 | 4a35de24e9cbf52aa8a8fd184bfb0807 |
|
BLAKE2b-256 | 7c13a6bb514ec214524e6e9fcdc73a45d6029db29450e42e2dccc7af6635fa81 |
Provenance
The following attestation bundles were made for multipartial-0.2.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.2.0.tar.gz
- Subject digest:
9a22dbf8b4544002763c23a3f1eb5f4147d256f49d0727df9835bec40a92709f
- Sigstore transparency entry: 147651999
- Sigstore integration time:
- Predicate type:
File details
Details for the file multipartial-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: multipartial-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 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 | b2dcc4a389d94c779d1c187e7209e56c2c410a193ead448c05f4d7f9a78b4adc |
|
MD5 | d1e30d0cda040a7af6616600e7e7813f |
|
BLAKE2b-256 | 27f1b2d01338ae5357eae79575aff9be92a515fdeaa71a22446fb6572077c53f |
Provenance
The following attestation bundles were made for multipartial-0.2.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.2.0-py3-none-any.whl
- Subject digest:
b2dcc4a389d94c779d1c187e7209e56c2c410a193ead448c05f4d7f9a78b4adc
- Sigstore transparency entry: 147652003
- Sigstore integration time:
- Predicate type: