Skip to main content

lazy RecursiveSequence with optional caching

Project description

lazyRecursion

Usage Example:

>>> from lazyRecursion import RecursiveSequence
>>> 
>>> fibonacci = RecursiveSequence(
...     induction_start={0: 1, 1:1},
...     relative_indices=[-2,-1],
...     recursion_function=lambda x1,x2: x1+x2,
...     cache_file='fib_cache.json' # (optional) deactivates caching if missing
... )
>>> fibonacci[:10]
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
>>> linear = RecursiveSequence(
...     induction_start={0:0},
...     relative_indices=[-1],
...     recursion_function=lambda x: x+5,
... )
>>> linear[:5]
[0, 5, 10, 15, 20]

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

lazyRecursion-0.1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazyRecursion-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file lazyRecursion-0.1.1.tar.gz.

File metadata

  • Download URL: lazyRecursion-0.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lazyRecursion-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88b7f50de8d028825bd808d4a2f7c5118d8eaf87a83558703c0be1423d51766b
MD5 c86ed7354e73c418a3070dc3cb2af934
BLAKE2b-256 fa707628473a9deda8420cdd388778bb429cde15da2fabf4933be9ce7cde76b0

See more details on using hashes here.

File details

Details for the file lazyRecursion-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lazyRecursion-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lazyRecursion-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf4b44a7bda03ddf7a23b1ef0f548bb63732d60c46a519df1427d550f2ca096f
MD5 fdfb9fe07e108b9fe4410ea518765f7b
BLAKE2b-256 58f04a8d1e3bbbc463cb0d3c1efa82530b7abc3e05481c9fa6de8336b16f5f68

See more details on using hashes here.

Supported by

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