Distribution Tests & Performance Timer for Non-deterministic Functions
- Fortuna: Collection of abstractions to make custom random generators. https://pypi.org/project/Fortuna/
- Python 3.7 or later with dev tools (setuptools, pip, etc.)
- Cython: Bridge from C/C++ to Python.
- Modern C++ compiler and Standard Library. Clang or GCC.
-
MonkeyScope.distribution_timer(func: staticmethod, *args, **kwargs) -> None
- Logger for the statistical analysis of non-deterministic generators.
- @param func :: function, method or lambda to analyze. Evaluated as
func(*args, **kwargs)
- @optional_kw num_cycles=10000 :: Total number of samples to use for analysis.
- @optional_kw post_processor=None staticmethod :: 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.
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)
Output Analysis: Random.randint(1, 10)
Typical Timing: 1270 ± 88 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5.0
Maximum: 10
Mean: 5.425
Std Deviation: 2.867468395641005
Distribution of 100000 samples:
1: 10.0%
2: 10.073%
3: 10.046%
4: 10.07%
5: 10.032%
6: 9.991%
7: 9.978%
8: 10.115%
9: 9.836%
10: 9.859%
Output Analysis: Random.randrange(1, 10)
Typical Timing: 1135 ± 69 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5.0
Maximum: 9
Mean: 5.028
Std Deviation: 2.605228588819031
Distribution of 100000 samples:
1: 11.281%
2: 11.098%
3: 11.04%
4: 11.119%
5: 10.999%
6: 11.176%
7: 11.206%
8: 11.091%
9: 10.99%
Output Analysis: Random.randrange(1, 10, 2)
Typical Timing: 1332 ± 55 ns
Statistics of 1000 samples:
Minimum: 1
Median: 5.0
Maximum: 9
Mean: 5.068
Std Deviation: 2.771890329720857
Distribution of 100000 samples:
1: 19.868%
3: 20.025%
5: 20.001%
7: 19.811%
9: 20.295%
- Resolves bug caused by attempting to generate a distribution of non-numeric values.
- Updates calling signature of
distribution
anddistribution_timer
- Adds toml file to aid installation
- Documentation Update
- MonkeyScope no longer requires C++17 compiler. Any C++ compiler should work.
- Documentation Update
- Nano second precision enabled with time_ns
- No longer requires numpy
- Requires Python3.7 or later
- Internal Performance Update
- Final 3.6 release
- Docs update
- Installer Update, will properly install numpy as needed.
- Fixed Typos
- More minor typos fixed
- Minor typos fixed.
- MonkeyScope is now compatible with python notebooks.
- Documentation update
- Minor performance improvement.
- Public Release
- Installer Update
- Minor Bug Fix
- Continued Development
- Renamed to MonkeyScope
- Changed to c++ compiler
- Initial Project Setup