Skip to main content

A tiny package for seeding all the RNGs in numerical experiments

Project description

omnipyseed

Omnipyseed is a minimal Python package that seeds all the basic Random Number Generators (RNGs) in a Python script. The purpose of omnipyseed is to simplify the process of seeding numerical simulations which use packages such as Numpy and Pytorch.

Dependencies

omnipyseed does not depend on any non-essential Python package.

Installation

You can install omnipyseed using pip:

pip3 (or pip) install omnipyseed

Or you can clone this repository to any of your local directories and install it from there.

$ git clone https://github.com/gdetor/omnipyseed.git
$ cd omnipyseed/
$ pip install .

How to use

import numpy as np
from omnipyseed import seeding      # import the seeding module from omnipyseed


if __name__ == '__main__':
    seeding.universal_seed(13)      # call the universal_seed function to seed
                                    # Python and Numpy
    x = np.linspace(-1, 1, 10)
    y = np.sin(2*np.pi*5*x)
    print(y)

Caveat

Please do not use omnipyseed if you'd like to use different random states for different random parts of your project. Instead you should instantiate generator objects with a seed and pass it around (e.g., numpy.random.default_rng(seed)).

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

omnipyseed-0.0.3.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

omnipyseed-0.0.3-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file omnipyseed-0.0.3.tar.gz.

File metadata

  • Download URL: omnipyseed-0.0.3.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.60.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for omnipyseed-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d42b77f7231c30f944d07b7e536448e29fec797e550d14132a9393cdb3d1133c
MD5 d52dd5239e1a65d4769b58f865c1a8e8
BLAKE2b-256 21ff56a05dd3f341299ff1740d71b65140399e7a4cd8e53a4e1a48c20d3db640

See more details on using hashes here.

File details

Details for the file omnipyseed-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: omnipyseed-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.60.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for omnipyseed-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ace9c2fde0d9b64cc9976b0395f423e379ed0ab3e2bb13437abd5999935d444e
MD5 add93ff6eea6cde364e6506129071050
BLAKE2b-256 d0f25611f58549f280f5bfb6505175568fd6551cbadc90ce291e88d72051989d

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