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.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

multipartial-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for multipartial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1db84873e663e1847dd8531a7050328702f01844f0867dcb293aa5a25caf09b2
MD5 9c9947812b4df3ecb46fd1d1f7a5c8ef
BLAKE2b-256 634805ce60f31fe9b27495f06e04fd2e5cd810ebe6c7af82ce40dc8dea157954

See more details on using hashes here.

Provenance

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

Publisher: release.yml on kalekundert/multipartial

Attestations:

File details

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

File metadata

File hashes

Hashes for multipartial-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00ce85b7980fa510c4f470995d92c7e62f92c4369584fa296269a7a1fb19e3da
MD5 527fe29c6e1e05bf4875d65c2447b8bd
BLAKE2b-256 6f73603953ad7aa3b5e65b3e289ae17022d8f0043146aa2fc39cd373f4d33fcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for multipartial-0.1.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