Distribution Stats & Timer for Testing Non-deterministic Value Generators
Project description
MonkeyScope Beta
Distribution Timer for Non-deterministic Value Generators
Sister Projects:
- Fortuna: Collection of abstractions to make custom random value generators. https://pypi.org/project/Fortuna/
- Pyewacket: Complete drop-in replacement for the Python3 random module. https://pypi.org/project/Pyewacket/
- RNG: Python3 API for the C++ Random Library. https://pypi.org/project/RNG/
Support these and other random projects: https://www.patreon.com/brokencode
Quick Install
$ pip install MonkeyScope
$ python3
>>> import MonkeyScope
Installation may require the following:
- Python 3.6 or later with dev tools (setuptools, pip, etc.)
- Cython:
pip install Cython
- Modern C++17 compiler and standard library for your platform.
MonkeyScope Specifications
MonkeyScope.distribution_timer(func: staticmethod, *args, **kwargs) -> None
- Logger for the statistical analysis of non-deterministic output.
- @param func :: function, method or lambda to analyze.
func(*args, **kwargs)
- @optional_kw num_cycles=10000 :: Total number of samples to use for analysis.
- @optional_kw post_processor=None :: Used to scale a large set of data into a smaller set of groupings for better visualization of the data, esp. useful for distributions of floats. For many functions in quick_test(), math.floor() is used, for others round() is more appropriate. For more complex post processing - lambdas work nicely. Post processing only affects the distribution, the statistics and performance results are unaffected.
MonkeyScope.distribution(func: staticmethod, *args, **kwargs) -> None
- Stats and distribution.
MonkeyScope.timer(func: staticmethod, *args, **kwargs) -> None
- Just the function timer.
MonkeyScope Terminal Example
$ python3
Python 3.7.3
>>> import MonkeyScope, random
>>> MonkeyScope.timer(random.random)
Typical Timing: 45 ± 7 ns
MonkeyScope Script Example
import MonkeyScope, random
x, y, z = 1, 10, 2
MonkeyScope.distribution_timer(random.randint, x, y)
MonkeyScope.distribution_timer(random.randrange, x, y)
MonkeyScope.distribution_timer(random.randrange, x, y, z)
Typical Script Output
Output Analysis: Random.randint(1, 10)
Typical Timing: 1312 ± 89 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5
Maximum: 10
Mean: 5.434
Std Deviation: 2.9475977222701766
Distribution of 100000 samples:
1: 9.914%
2: 10.032%
3: 10.014%
4: 10.083%
5: 9.891%
6: 10.021%
7: 9.956%
8: 9.994%
9: 10.128%
10: 9.967%
Output Analysis: Random.randrange(1, 10)
Typical Timing: 1115 ± 11 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5
Maximum: 9
Mean: 4.988
Std Deviation: 2.5734176649892024
Distribution of 100000 samples:
1: 11.182%
2: 11.107%
3: 10.943%
4: 11.287%
5: 11.061%
6: 11.123%
7: 11.118%
8: 11.237%
9: 10.942%
Output Analysis: Random.randrange(1, 10, 2)
Typical Timing: 1382 ± 66 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5
Maximum: 9
Mean: 5.028
Std Deviation: 2.7244519886829788
Distribution of 100000 samples:
1: 19.999%
3: 19.954%
5: 20.077%
7: 19.971%
9: 19.999%
Development Log:
MonkeyScope 1.2.0
- Replaced stats module with numpy
MonkeyScope 1.1.5
- Public Release
MonkeyScope Beta 0.1.5
- Installer Update
MonkeyScope Beta 0.1.4
- Minor Bug Fix
MonkeyScope Beta 0.1.3
- Continued Development
MonkeyScope Beta 0.1.2
- Renamed to MonkeyScope
MonkeyTimer Beta 0.0.2
- Changed to c++ compiler
MonkeyTimer Beta 0.0.1
- Initial Project Setup
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
MonkeyScope-1.2.0.tar.gz
(61.1 kB
view details)
Built Distribution
File details
Details for the file MonkeyScope-1.2.0.tar.gz
.
File metadata
- Download URL: MonkeyScope-1.2.0.tar.gz
- Upload date:
- Size: 61.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176d307e1c4d888611d28569d1da3a22358c0374a71d9fbdccefacdfeb0e7d59 |
|
MD5 | b70c3729c722eb6846cd1dca5e8c0234 |
|
BLAKE2b-256 | 6028d09d408e8fd008259dfe6af4cc3e06d56645124c07b77122a6132b6cc088 |
File details
Details for the file MonkeyScope-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: MonkeyScope-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 49.3 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cafda8b66cee5b06649e3e5f055f67800b2bbe35f8a2bddd8fe3da35dbd22f5e |
|
MD5 | 0d91ecf26c99837f62b06b0c15f1801a |
|
BLAKE2b-256 | 1f0416ec04f1f0dadc93fd3cebfd1109288479a327e5e1c09aaf8f16a14ade66 |