## Simple library for gathering results from stochastic functions
![size](https://img.shields.io/github/languages/code-size/aonodensetsu/r_repeat) ![files](https://img.shields.io/github/directory-file-count/aonodensetsu/r_repeat)
![py dep](https://img.shields.io/pypi/pyversions/r-repeat) [![version](https://img.shields.io/pypi/v/r-repeat)](https://pypi.org/project/r-repeat/0.3.6/)
![license](https://img.shields.io/pypi/l/r-repeat) [![downloads](https://img.shields.io/badge/releases-here-green?logo=pypi)](https://pypi.org/project/r-repeat/#history)
[![downloads](https://img.shields.io/badge/wiki-here-pink)](https://github.com/Aonodensetsu/r_repeat/blob/main/WIKI.md) [![downloads](https://img.shields.io/badge/changelog-here-pink)](https://github.com/Aonodensetsu/r_repeat/blob/main/CHANGELOG.md)
# Usage:
1. `pip install r_repeat`
2. Open up [the wiki](https://github.com/Aonodensetsu/r_repeat/blob/main/WIKI.md) to see how everything works or check the examples
3. Enjoy
# Example:
```python
from r_repeat import repeat, seed
@repeat(n=1e6) # run this function 1000000 times
@seed(kwarg=['rng1', 'rng2']) # insert random numbers into rng1 and rng2
def f(rng1, bias, rng2):
return (rng1 + bias) >= rng2
g = f(bias=0.078) # pass remaining arguments
sum = g.collect() # gather all results
print(f'{sum} wins and {len(g)-sum} losses')
```
Output:
```
22%|██▏ | 217913/1000000 [00:21<01:18, 9952.1it/s] (while working)
574945 wins and 425055 losses (after finished)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Aonodensetsu/r_repeat",
"name": "r-repeat",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "repeat,probability,random",
"author": "Remigiusz Do\u0144czyk",
"author_email": "donczyk.remigiusz@gmail.com",
"download_url": "",
"platform": null,
"description": "## Simple library for gathering results from stochastic functions\r\n\r\n![size](https://img.shields.io/github/languages/code-size/aonodensetsu/r_repeat) ![files](https://img.shields.io/github/directory-file-count/aonodensetsu/r_repeat) \r\n![py dep](https://img.shields.io/pypi/pyversions/r-repeat) [![version](https://img.shields.io/pypi/v/r-repeat)](https://pypi.org/project/r-repeat/0.3.6/) \r\n![license](https://img.shields.io/pypi/l/r-repeat) [![downloads](https://img.shields.io/badge/releases-here-green?logo=pypi)](https://pypi.org/project/r-repeat/#history) \r\n[![downloads](https://img.shields.io/badge/wiki-here-pink)](https://github.com/Aonodensetsu/r_repeat/blob/main/WIKI.md) [![downloads](https://img.shields.io/badge/changelog-here-pink)](https://github.com/Aonodensetsu/r_repeat/blob/main/CHANGELOG.md) \r\n\r\n# Usage:\r\n1. `pip install r_repeat`\r\n2. Open up [the wiki](https://github.com/Aonodensetsu/r_repeat/blob/main/WIKI.md) to see how everything works or check the examples\r\n3. Enjoy\r\n\r\n# Example:\r\n```python\r\nfrom r_repeat import repeat, seed\r\n@repeat(n=1e6) # run this function 1000000 times\r\n@seed(kwarg=['rng1', 'rng2']) # insert random numbers into rng1 and rng2\r\ndef f(rng1, bias, rng2):\r\n\treturn (rng1 + bias) >= rng2\r\n\r\ng = f(bias=0.078) # pass remaining arguments\r\nsum = g.collect() # gather all results\r\nprint(f'{sum} wins and {len(g)-sum} losses')\r\n```\r\nOutput:\r\n```\r\n22%|\u2588\u2588\u258f | 217913/1000000 [00:21<01:18, 9952.1it/s] (while working)\r\n574945 wins and 425055 losses (after finished)\r\n```\r\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Create a palette preview image by using a simple config file",
"version": "0.3.7",
"project_urls": {
"Homepage": "https://github.com/Aonodensetsu/r_repeat"
},
"split_keywords": [
"repeat",
"probability",
"random"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f621a677456a9b3f4ee99cc653624e6fa8dde66aafb2a2f91aca7276b2f26dfb",
"md5": "1faab1be1506fa936bd64a7a6e249d3d",
"sha256": "8d29b2522ab54da97251f48f7a63b40a25dff45bb44772189df5a54dd9321d32"
},
"downloads": -1,
"filename": "r_repeat-0.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1faab1be1506fa936bd64a7a6e249d3d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 3928,
"upload_time": "2023-09-18T17:47:28",
"upload_time_iso_8601": "2023-09-18T17:47:28.901725Z",
"url": "https://files.pythonhosted.org/packages/f6/21/a677456a9b3f4ee99cc653624e6fa8dde66aafb2a2f91aca7276b2f26dfb/r_repeat-0.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-18 17:47:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Aonodensetsu",
"github_project": "r_repeat",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "r-repeat"
}