Utility to efficiently explore functions on their domains
Project description
Cartesian Explorer
A handy tool to map functions over their domains.
Works:
Map over cartesian product of arguments: pass arrays of values for function argument
Built-in caching
Handy plotting utilities
Resolving dependencies between functions that require and provide variables
Usage
Map
from cartesian_explorer import Explorer
explorer = Explorer()
def my_function(x, y):
return x+y
data = explorer.map(my_function, x=range(5), y=range(3))
print(data)
assert data.shape == (5, 3)
assert data[1, 2] == my_function(1, 2)
Cache
from cartesian_explorer import Explorer
explorer = Explorer()
mock = MagicMock()
my_function = mock.my_function
wrapped = explorer.cache_function(my_function)
wrapped(a=1, b=2)
wrapped(a=1, b=2)
my_function.assert_called_once_with(a=1, b=2)
History
0.0.1 (2020-09-23)
First release on PyPI.
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
Close
Hashes for cartesian_explorer-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987bc2ed157816b4b74659bc5b3dc4abf968e5ae964fb50a02c9ebcbbb0b9560 |
|
MD5 | ef743ed28a6a74d94c111bb2df1bab7f |
|
BLAKE2b-256 | b0485aa94a4e3bbaf2f37d3f0c8ae816774a7562eb1c71fbc06e0d0a1278135f |