Skip to main content

N-dimensional arrays of partial functions.

Project description

Multipartial

Last release Python version Documentation Test status Test coverage Last commit

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multipartial-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

multipartial-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for multipartial-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9a22dbf8b4544002763c23a3f1eb5f4147d256f49d0727df9835bec40a92709f
MD5 4a35de24e9cbf52aa8a8fd184bfb0807
BLAKE2b-256 7c13a6bb514ec214524e6e9fcdc73a45d6029db29450e42e2dccc7af6635fa81

See more details on using hashes here.

Provenance

The following attestation bundles were made for multipartial-0.2.0.tar.gz:

Publisher: release.yml on kalekundert/multipartial

Attestations:

File details

Details for the file multipartial-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for multipartial-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2dcc4a389d94c779d1c187e7209e56c2c410a193ead448c05f4d7f9a78b4adc
MD5 d1e30d0cda040a7af6616600e7e7813f
BLAKE2b-256 27f1b2d01338ae5357eae79575aff9be92a515fdeaa71a22446fb6572077c53f

See more details on using hashes here.

Provenance

The following attestation bundles were made for multipartial-0.2.0-py3-none-any.whl:

Publisher: release.yml on kalekundert/multipartial

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page