Distribution Stats & Timer for Testing Non-deterministic Value Generators
Project description
MonkeyTimer 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.7 or later.
- Cython:
pip install Cython
- Python3 developer environment, setuptools etc.
- Modern C++17 Compiler and Standard Library.
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 Examples
$ python3
Python 3.7.3
>>> import MonkeyScope
>>> import random
>>> MonkeyScope.timer(random.randint, 1, 10)
Typical Timing: 1282 ± 29 ns
>>>
>>> MonkeyScope.distribution(random.randint, 1, 10)
Statistics of 1024 samples:
Minimum: 1
Median: 5
Maximum: 10
Mean: 5.5419921875
Std Deviation: 2.876777674890822
Distribution of 102400 samples:
1: 9.91796875%
2: 9.935546875%
3: 9.9697265625%
4: 10.10546875%
5: 9.9404296875%
6: 10.044921875%
7: 10.0380859375%
8: 9.9072265625%
9: 10.15234375%
10: 9.98828125%
>>>
>>> MonkeyScope.distribution_timer(random.randint, 1, 10)
Output Analysis: Random.randint(1, 10)
Typical Timing: 1125 ± 32 ns
Statistics of 1024 samples:
Minimum: 1
Median: 6
Maximum: 10
Mean: 5.48046875
Std Deviation: 2.8314684291544103
Distribution of 102400 samples:
1: 10.150390625%
2: 10.1259765625%
3: 9.990234375%
4: 10.0419921875%
5: 9.90234375%
6: 10.0810546875%
7: 9.87109375%
8: 9.947265625%
9: 9.9443359375%
10: 9.9453125%
>>>
ToDo List:
- Improve Documentation
- Concoct Examples
- Derive Tests
- Refactor Inception
Development Log:
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-0.1.2.tar.gz
(65.6 kB
view details)
Built Distribution
File details
Details for the file MonkeyScope-0.1.2.tar.gz
.
File metadata
- Download URL: MonkeyScope-0.1.2.tar.gz
- Upload date:
- Size: 65.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e100970eeee9ca7292246601ed52305fcfc372878115dbe6f24e8d8f3438fc2 |
|
MD5 | 646c53c70004cce9e5216f3326600c87 |
|
BLAKE2b-256 | b14c2b6807377c28523c3e68473971e87cb8d5a554ad5d3d5a26e9bd32384f2f |
File details
Details for the file MonkeyScope-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: MonkeyScope-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 54.2 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.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8229fadc35cfe17c5d7d65f7e273de4ddf445507074f750537cc65687f0e873a |
|
MD5 | a2f138cd74018eb1aa57882ab6cbac22 |
|
BLAKE2b-256 | 4880006724532e4446fa01289752b63df75260bbb006ff6a1ed0dab02efc412a |