What is measurer?
Measurer is easy to use python package for examining and comparing callable objects.
Installing
This package distributes by Python Packaging Index, aka PyPI, so you can install measurer using pip:
py -m pip install function_measurer
Quick start
Let's examine using of this package on a little example:
from measurer import setTesting
@setTesting(2, 2)
def summ(a: int, b: int):
return a + b
We have function and we want to test it. We use decorator setTesting for it. Arguments given to setTesting passes to summ.
Let's save this file with name sample.py. After that we open powerShell or cmd and enter this command into the shell:
py -m measurer sample.py 3 memory
And we get this:
--------------------------------------------------------
| Tests.|Functions.|Iteration 1|Iteration 2|Iteration 3|
--------------------------------------------------------
|runtime| summ| 0.0| 0.0| 0.0|
--------------------------------------------------------
First column is tests those we have given to our package. In this case we have given only one test. That is runtime. When we give runtime test tester runs testing functions and prints their runtimes. The next column shows functions we have tested. Other columns show the results of the testing.
Detailed description of using.
The first argument in our example is the path to a file that you want to test. The second is the amount of times the functions will be tested. The third argument is test that we want to do with our functions. We can also pass more than one test to this argument and will get a table with results of those tests.
| Test | Description |
|---|---|
| runtime | Measures the runtime of function. |
| memory | Measures the occupied memory. |
Also you can write all data into configuration file. If you named the file config.cfg you can just add --config argument when you are starting module. In other way you must add name of configure file after this argument.
This is an example of this file:
[MEASURER_DATA]
module = sample.py
iters = 3
tests = runtime, memory
If you did not understand something try to use -h option. If you found some mistakes in this docs, please make a pull request with correcting of found mistake.
Metadata
Release files for function-measurer 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| function_measurer-0.3.2.tar.gz | 7.4 kB | Without provenance | Details for function_measurer-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| function_measurer-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for function_measurer-0.3.2-py3-none-any.whl |
Total release size: 14.7 kB
Release files / function_measurer-0.3.2.tar.gz
| Download URL | function_measurer-0.3.2.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10d0fa140ac1f2f0a8d9f5b34bf0e4c3ea5d3a87e5c787d11ac4af1eefca43b4
|
|
BLAKE2b-256 checksum How to use checksums |
bce0b4a9234c55a2cdcc0b9aa17194a885228478b51317de5512ac2534d828bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.6
|
Release files / function_measurer-0.3.2-py3-none-any.whl
| Download URL | function_measurer-0.3.2-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
751ef230c38cb00e7ee6e8b9bee24de8d5e057aeb05334304d74c080a8258dab
|
|
BLAKE2b-256 checksum How to use checksums |
9700111a155a4447f4e49427640e9b106265b66740e895b33d90263769123c95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.6
|
Security for function-measurer 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.