Metadata-Version: 2.1
Name: seedbank
Version: 0.2.0b2
Summary: Common infrastructure for seeding random number generators.
Author-email: Michael Ekstrand <mdekstrand@drexel.edu>
License: Copyright (c) 2021–2023 Boise State University
        Copyright (c) 2023-2024 Drexel University and contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        > The above copyright notice and this permission notice shall be included in
        > all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://seedbank.lenksit.org
Project-URL: GitHub, https://github.com/lenskit/seedbank
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: numpy>=1.17
Requires-Dist: typing-extensions~=4.8
Provides-Extra: dev
Requires-Dist: setuptools>=64; extra == "dev"
Requires-Dist: setuptools_scm>=8; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: build==1.*; extra == "dev"
Requires-Dist: ruff>=0.2; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: copier==9.*; extra == "dev"
Requires-Dist: unbeheader~=1.3; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: pyproject2conda; extra == "dev"
Requires-Dist: sphinx-autobuild; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-doctestplus; extra == "test"
Requires-Dist: pytest-cov>=2.12; extra == "test"
Requires-Dist: coverage>=5; extra == "test"
Requires-Dist: pyyaml; extra == "test"
Requires-Dist: toml; extra == "test"
Provides-Extra: doc
Requires-Dist: sphinx>=4.2; extra == "doc"
Requires-Dist: sphinxext-opengraph>=0.5; extra == "doc"
Requires-Dist: furo; extra == "doc"
Provides-Extra: numba
Requires-Dist: numba; extra == "numba"
Provides-Extra: torch
Requires-Dist: torch; extra == "torch"
Provides-Extra: cupy
Requires-Dist: cupy; extra == "cupy"
Provides-Extra: cuda11x
Requires-Dist: cupy-cuda11x; extra == "cuda11x"
Provides-Extra: tf
Requires-Dist: tensorflow<3,>=2; extra == "tf"

# 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:

```python
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

The easiest way to set up your environment to develop seedbank is to install
`uv` and `just`, and run:

    uv venv create
    just install-dev

You can also set up dev dependencies with `pip`:

    pip install -e '.[dev,test,doc]

## 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.
