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()) - cupy (with
cupy.random.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
[conda-lock][] can help you set up a Conda environment (replace linux-64 with your platform):
# install conda-lock in base environment
# alternatively: pip install conda-lock
conda install -c conda-forge conda-lock
# create the lock file
conda-lock -p linux-64 -f pyproject.toml
# create the environment
conda env create -n seedbank -f conda-linux-64.lock
Acknowledgements
This material is based upon work supported by the National Science Foundation under Grant No. IIS 17-51278. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Metadata
Release files for seedbank 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seedbank-0.1.3.tar.gz | 13.0 kB | Without provenance | Details for seedbank-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seedbank-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for seedbank-0.1.3-py3-none-any.whl |
Total release size: 21.5 kB
Release files / seedbank-0.1.3.tar.gz
| Download URL | seedbank-0.1.3.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a859761f1a7545c8cf24a6c19af80c25b90294723a9a20f6c220cac2b6084586
|
|
BLAKE2b-256 checksum How to use checksums |
6fc1e15d9b91ed9de8231efaafddfccbc03ddef1a300b4eb4e191a7e43db1969
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / seedbank-0.1.3-py3-none-any.whl
| Download URL | seedbank-0.1.3-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37c6fd38a4d5c8c826637b21084487f56cb0fb4756bc91447400720b7a9182aa
|
|
BLAKE2b-256 checksum How to use checksums |
1ed3469072928837fdee5ce3f079295c7f868cdba2d684d54f7d228526b0e3bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Security for seedbank 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.