{ "info": { "author": "Gertjan van den Burg", "author_email": "gertjanvandenburg@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "=======\nSyncRNG\n=======\nA synchronized Tausworthe RNG usable in R and Python.\n\nWhy?\n====\n\nThis program was created because it was desired to have the same random \nnumbers in both R and Python programs. Although both languages implement a \nMersenne-Twister RNG, the implementations are so different that it is not \npossible to get the same random numbers with the same seed.\n\nSyncRNG is a Tausworthe RNG implemented in ``syncrng.c``, and linked to both R \nand Python. Since both use the same underlying C code, the random numbers will \nbe the same in both languages, provided the same seed is used.\n\nHow\n===\n\nFirst install the packages as stated under Installation. Then, in Python you \ncan do::\n\n from SyncRNG import SyncRNG\n\n s = SyncRNG(seed=123456)\n for i in range(10):\n print(s.randi())\n\nSimilarly, after installing the R library you can do in R::\n\n library(SyncRNG)\n\n s <- SyncRNG(seed=123456)\n for (i in 1:10) {\n cat(s$randi(), '\\n')\n }\n\nYou'll notice that the random numbers are indeed the same.\n\nInstallation\n============\n\nInstalling the R package can be done through CRAN::\n\n install.packages('SyncRNG')\n\nThe Python package can be installed using pip::\n\n pip install syncrng\n\n\nUsage\n=====\n\nIn both R and Python the following methods are available for the ``SyncRNG`` \nclass:\n\n1. ``randi()``: generate a random integer on the interval [0, 2^32).\n2. ``rand()``: generate a random floating point number on the interval [0.0, \n 1.0)\n3. ``randbelow(n)``: generate a random integer below a given integer ``n``.\n4. ``shuffle(x)``: generate a permutation of a given list of numbers ``x``.\n\nNotes\n=====\n\nThe random numbers are uniformly distributed on ``[0, 2^32 - 1]``.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GjjvdBurg/SyncRNG", "keywords": "RNG R Python", "license": "GPL v2", "maintainer": "", "maintainer_email": "", "name": "SyncRNG", "package_url": "https://pypi.org/project/SyncRNG/", "platform": "", "project_url": "https://pypi.org/project/SyncRNG/", "project_urls": { "Homepage": "https://github.com/GjjvdBurg/SyncRNG" }, "release_url": "https://pypi.org/project/SyncRNG/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "A synchronized Tausworthe RNG for Python and R", "version": "1.2.1" }, "last_serial": 2402204, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "9fc62af2a591ee2ce3316823bbe1d32f", "sha256": "482475e0886c217b67f2fbcce7d54cc15a04bc09dc6ea982ccc14ba15d59c332" }, "downloads": -1, "filename": "SyncRNG-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9fc62af2a591ee2ce3316823bbe1d32f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5177, "upload_time": "2016-10-12T19:28:36", "url": "https://files.pythonhosted.org/packages/95/93/e4e9755b9e0eac18b47d79af84c468cb73d9f65b3da32c1568da5fa338d6/SyncRNG-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "4f1fe9457699250f3ad79c044317afa1", "sha256": "4fd55b360730e382852a196428839a96280b4e2a64fcf3aec8caf594b0b04cef" }, "downloads": -1, "filename": "SyncRNG-1.1.1.tar.gz", "has_sig": false, "md5_digest": "4f1fe9457699250f3ad79c044317afa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5027, "upload_time": "2016-10-14T20:22:28", "url": "https://files.pythonhosted.org/packages/29/88/5fc7af005c1d960fb253eb95b99d914b47b4efc4230aa11d045db2b3c31c/SyncRNG-1.1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "a5fe13516425b869ce8ad87cd19a9f55", "sha256": "65cbe9826bcd819f06e32b49812471805d961aa6edd9d523db0a077c8aaa6513" }, "downloads": -1, "filename": "SyncRNG-1.2.1.tar.gz", "has_sig": false, "md5_digest": "a5fe13516425b869ce8ad87cd19a9f55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5032, "upload_time": "2016-10-16T10:53:49", "url": "https://files.pythonhosted.org/packages/39/0c/b1446dd7c9b6c2769d04a27e8a375387558cb6beb4d503f143b9b89d2b44/SyncRNG-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a5fe13516425b869ce8ad87cd19a9f55", "sha256": "65cbe9826bcd819f06e32b49812471805d961aa6edd9d523db0a077c8aaa6513" }, "downloads": -1, "filename": "SyncRNG-1.2.1.tar.gz", "has_sig": false, "md5_digest": "a5fe13516425b869ce8ad87cd19a9f55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5032, "upload_time": "2016-10-16T10:53:49", "url": "https://files.pythonhosted.org/packages/39/0c/b1446dd7c9b6c2769d04a27e8a375387558cb6beb4d503f143b9b89d2b44/SyncRNG-1.2.1.tar.gz" } ] }