Metadata-Version: 2.1
Name: stablerandom
Version: 0.4.27
Summary: Create stable/repeatable numpy.random applications
Author: John Heintz
Author-email: john@gistlabs.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: numpy (>=1.22,<2.0)
Description-Content-Type: text/markdown

# stablerandom
stablerandom provides a stable and repeatable implementation of 
the NumPy random number generator (numpy.random). With this package, 
you can generate the same sequence of random numbers across different 
platforms and Python environments, ensuring reproducibility 
in scientific computing, machine learning, and unit testing.

stablerandom can decorate any function or method and provide a 
call-stack scoped seeded random generator. It is thread safe and 
supports nested scopes.

## Example
Using the `@stablerandom` decorator to get a stable output for numpy.random.triangular

 ```
import numpy.random
from stablerandom import stablerandom

@stablerandom
def random_triangular(samples):
    return numpy.random.triangular(1, 5, 10, samples)

print(random_triangular(3))
>>> [1.99882862 7.95097645 7.68974243]
print(random_triangular(3))
>>> [1.99882862 7.95097645 7.68974243]
```

## Installing
```bash
$ pip install stablerandom
```
The source code is currently hosted on GitHub at 
https://github.com/GistLabs/stablerandom
and published in PyPI at https://pypi.org/project/stablerandom/ 

The versioning scheme currently used is {major}.{minor}.{auto build number}
from `git rev-list --count HEAD`. 

We recommend picking a version like:

`stablerandom = "^0.3"`

## Dependencies
This library has been tested with [NumPy](https://www.numpy.org) back to version 1.22

## Community guidelines
We welcome contributions and questions. Please head over to github and 
send us pull requests or create issues!

