Module with C functions. No precise purpose yet.
Project description
cpyquickhelper: python + C++ in different ways
cpyquickhelper is a template to create a module with C functions in different ways. It implements function measure_time:
from cpyquickhelper.numbers import measure_time from math import cos res = measure_time(lambda: cos(0.5)) print(res)
{'average': 3.909366205334663e-06, 'deviation': 6.238702219064397e-07, 'min_exec': 3.635883331298828e-06, 'max_exec': 5.776062607765198e-06, 'repeat': 10, 'number': 50, 'context_size': 240}
It also implements an event profiler: it logs the timestamp for every event such as functions call or returns, memory allocations.
import io import numpy from cpyquickhelper.profiling import EventProfiler def custom_array(N): a = numpy.zeros((N, N)) a[:, 0] = 1 a[0, :] = 1 return a ev = EventProfiler(impl='c') ev.start() custom_array(3) ev.stop() df = ev.retrieve_results() # DataFrame st = io.StringIO() df.to_csv(st, index=False) print(st.getvalue().replace("\r", ""))
time,value1,value2,event,name,mod,lineno,from_name,from_mod,from_line 822467345556400,0,0,return,_setup_profiler,cpyquickhelper/profiling/event_profiler.py,153,start,cpyquickhelper/profiling/event_profiler.py,126 822467345566700,0,0,c_call,_profiling_register_pyinstance,cpyquickhelper.profiling._event_profiler_c,109,_profiling_register_pyinstance,k.py,19 822467345569000,0,0,c_return,_profiling_register_pyinstance,cpyquickhelper.profiling._event_profiler_c,109,_profiling_register_pyinstance,k.py,19 822467345569700,0,0,return,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345575100,0,0,call,custom_array,k.py,5,<module>,k.py,19 822467345579600,0,0,c_call,zeros,numpy,5,zeros,k.py,19 822467345584300,2698130437280,32,malloc,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345590500,0,0,c_return,zeros,numpy,5,zeros,k.py,19 822467345598200,0,0,free,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345600400,0,0,free,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345600900,0,0,return,ndarray,numpy,5,ndarray,k.py,19 822467345603200,0,0,call,stop,cpyquickhelper/profiling/event_profiler.py,128,<module>,k.py,19 822467345604900,0,0,call,_restore_profiler,cpyquickhelper/profiling/event_profiler.py,168,stop,cpyquickhelper/profiling/event_profiler.py,151 822467345605600,0,0,c_call,setprofile,sys,168,setprofile,cpyquickhelper/profiling/event_profiler.py,151
Links:
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
Built Distributions
File details
Details for the file cpyquickhelper-0.3.412.tar.gz
.
File metadata
- Download URL: cpyquickhelper-0.3.412.tar.gz
- Upload date:
- Size: 213.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d03b3547f31c5753af82e12222537d92caee0241285b60fe5cc4468a9cbb749 |
|
MD5 | 5745f95ff0a8872e217580dbb27af7b1 |
|
BLAKE2b-256 | 2c9fd9f65165cc8a273e5a6e8cc0e838f601988fe1c84ef00a7cf9f43187fa46 |
File details
Details for the file cpyquickhelper-0.3.412-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 811.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c990acbdb2027d5aa548e4a2ed5490932c2829d31bed4e52126dd5eb3045a0a |
|
MD5 | 0f0de341d34dd5718353a8d9de948ba1 |
|
BLAKE2b-256 | d2e3a8e5ee7b0196302da3da0a562336238d7091a6f1fcd0a559c37119aee24f |
File details
Details for the file cpyquickhelper-0.3.412-cp310-cp310-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp310-cp310-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 10.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d9951a1f773c45a55a1b01066e94c78f39d7da8ac6e6d171e1b08c8501fc637 |
|
MD5 | 8ca921da61c90e4f9e80bf2b8f936bcd |
|
BLAKE2b-256 | 7370ae1a42f4b24f0c99da4667c02fc0abf11257be1654da6d662c8aa06a9979 |
File details
Details for the file cpyquickhelper-0.3.412-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83099d5d6ea782588a05ff9803e703230a4065481ed36368e2fda45fa852b86c |
|
MD5 | db5f95807035eeed752b94e2001553a3 |
|
BLAKE2b-256 | e284a1d2e374d3ea6f1b3bb6009e1f84b35d4e12a91a23276ab6761b53a55eb8 |
File details
Details for the file cpyquickhelper-0.3.412-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 802.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1f122b720889cca09d742495a121f594fbe3d8d58394e0942c8ef718d87608 |
|
MD5 | 843df471528e2c880c0d034594d7fb16 |
|
BLAKE2b-256 | adec81d3b7f171bb57150265b6cfa0801e7f6ea3f8b7aff1a6ea08b0f4be136e |
File details
Details for the file cpyquickhelper-0.3.412-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 10.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f126af31e4359985571255fc0c90bc4f26f7432c0fd41248738ef5de91255635 |
|
MD5 | afbcc1a403ee86ed3e33379afcb9ebe8 |
|
BLAKE2b-256 | d89288a2baef0530915961ce3d7e6e505a7283f327c5d2e51418d32a1fa0860d |
File details
Details for the file cpyquickhelper-0.3.412-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d11238e7ace92d03c3394b20998e30efd24361c9f53feb52457d0ac38e74ea |
|
MD5 | dc4c6a83d1e8ba538fee56e64bda98a1 |
|
BLAKE2b-256 | e7a7d2d30cce1fd49efec586f3caf364752e657dfa1b7338aa8f5c8b4a84e062 |
File details
Details for the file cpyquickhelper-0.3.412-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 811.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 519eb6c433566440f49489bf76029a2e5156b55de8b3b5667cc41e6f32e945db |
|
MD5 | e86f58e94befb48a99b8d8596789e289 |
|
BLAKE2b-256 | c6c32dda44fd5161acb7760d4417b5f5d57254338189b7b9b71112dbdb1d727b |
File details
Details for the file cpyquickhelper-0.3.412-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 10.6 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8e0907f6d503b204cd50b97003e449d7b1e0231b6f9e8d52dd30daada83fdb3 |
|
MD5 | 341f94a427459c14878cce7195010408 |
|
BLAKE2b-256 | 655c47aa0c0dc7bcfa34b0692426c6af14dda115f95957ae0be71e3a4f5b19a5 |
File details
Details for the file cpyquickhelper-0.3.412-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 735b345f15fe7c90905d9adbc9491881328eb380c4895144e47e4c645d6cf73e |
|
MD5 | 6f6a462755ab840ea43220c674e72837 |
|
BLAKE2b-256 | f30e52f9da1123e672f8fed99ebd8df3e4146a51e231a3e51be0bedc457f3b4c |
File details
Details for the file cpyquickhelper-0.3.412-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 10.8 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaf9967f07b624f8e661b1669f40a155c868b82576c9c2127adb3a554c35ed83 |
|
MD5 | 7803374b7cc4d5c6ac8e73978781d039 |
|
BLAKE2b-256 | 97a25681a0fd5b7a8d3f133084098f13b992f0376b914eeba6f70a96b48af0db |
File details
Details for the file cpyquickhelper-0.3.412-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: cpyquickhelper-0.3.412-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e182acd932d4413928e2f65acaf90e4bf4810925255e27ee316dc9e64e3568b |
|
MD5 | a6b1c990dda38195f4d2bea4abcaf8f9 |
|
BLAKE2b-256 | 42b12040dffdc22e04e8165d6f24b0dee89d4395d1ebc47c3159bf3a06dd82d9 |