Skip to main content

Distributions & Timer for Non-deterministic Value Generators

Project description

MonkeyScope

Distribution Tests & Performance Timer for Non-deterministic Functions

Sister Project:

Quick Install $ pip install MonkeyScope

Installation may require the following:

  • 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 Specifications

  • 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.

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: 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%

Development Log:

MonkeyScope 1.4.4
  • Resolves bug caused by attempting to generate a distribution of non-numeric values.
MonkeyScope 1.4.3
  • Updates calling signature of distribution and distribution_timer
MonkeyScope 1.3.4
  • Adds toml file to aid installation
MonkeyScope 1.3.3
  • Documentation Update
MonkeyScope 1.3.2
  • MonkeyScope no longer requires C++17 compiler. Any C++ compiler should work.
MonkeyScope 1.3.1
  • Documentation Update
  • Nano second precision enabled with time_ns
MonkeyScope 1.3.0
  • No longer requires numpy
  • Requires Python3.7 or later
MonkeyScope 1.2.8
  • Internal Performance Update
  • Final 3.6 release
MonkeyScope 1.2.7
  • Docs update
MonkeyScope 1.2.6
  • Installer Update, will properly install numpy as needed.
MonkeyScope 1.2.5
  • Fixed Typos
MonkeyScope 1.2.4
  • More minor typos fixed
MonkeyScope 1.2.3
  • Minor typos fixed.
MonkeyScope 1.2.2
  • MonkeyScope is now compatible with python notebooks.
MonkeyScope 1.2.1
  • Documentation update
MonkeyScope 1.2.0
  • Minor performance improvement.
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


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.4.4.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

MonkeyScope-1.4.4-cp310-cp310-macosx_10_9_universal2.whl (86.6 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file MonkeyScope-1.4.4.tar.gz.

File metadata

  • Download URL: MonkeyScope-1.4.4.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for MonkeyScope-1.4.4.tar.gz
Algorithm Hash digest
SHA256 2f5d9c51b3014451993c03960c97f9a9771c867e4908bf6b7fbcc493f391f0aa
MD5 4843dbdecf370221f1f9afb400e1e701
BLAKE2b-256 27d5060d22f48eb3c6690cd37909f04c2ceda28ed7f1676233a839daeb28a265

See more details on using hashes here.

File details

Details for the file MonkeyScope-1.4.4-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

  • Download URL: MonkeyScope-1.4.4-cp310-cp310-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 86.6 kB
  • Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for MonkeyScope-1.4.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0d0a7cbb46749105a5bfa8ae989944a0ab919cf34df94ff6702db3a569e078ec
MD5 a3feb2ab42f2326faf791522a0c2b73e
BLAKE2b-256 247b48cfe907d351773fa9492ee73e2acb3b79474e016cdad4e4fe1cec8db5a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page