Skip to main content

Common infrastructure for initializing random number generators.

Project description

Python Seed Manager

Python programs, particularly data science applications, often need to interact with multiple different random number generators.

This package provides a unified interface to seeding them, along with APIs for deriving additional RNG seeds in a predictable way (using NumPy 1.17's new random infrastructure) and constructing random generators.

Quick Start

To get started, just use the seedbank.initialize() function to seed all available random number generators:

import seedbank
seedbank.initialize(65000)

SeedBank will seed all of the known generators that will be available, including:

  • Python standard random
  • NumPy legacy random numpy.random
  • PyTorch (with torch.manual_seed())
  • Numba’s NumPy random
  • TensorFlow (with tf.random.set_seed())

In addition, it will initialize a root seed for constructing new-style NumPy Generator instances.

If SeedBank doesn’t support your RNG yet, please submit a pull request!

Developing SeedBank

SeedBank uses Flit for managing dependencies. To set up in a fresh virtual environment:

python -m pip install flit
flit install --pth-file

If you want to use a Conda environment for development, use:

python build-tools/flit-conda --create-env --python-version 3.8

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

seedbank-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

seedbank-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: seedbank-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for seedbank-0.1.1.tar.gz
Algorithm Hash digest
SHA256 61ff49a20442c07f016cf947275976dad3c1b5eb7735d26ff8bb824db685421a
MD5 0ce0e181a700890d376a421d9aaadf1c
BLAKE2b-256 72203cb16f34f13d6a2e66d60e626e22cca1d1d2c546f23a33b3afce064c345d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: seedbank-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for seedbank-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d79e0a2cea6da43a58c7c253b2027e259c1af1f82a389fa93b5ecb6f82196f85
MD5 0f5c408f200bff40800af06680c44627
BLAKE2b-256 ac251c88cb490f554312058636b4a30bcdcf2cd2190d3321635b98fa3fb27cbd

See more details on using hashes here.

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