Skip to main content

Module with C functions. No precise purpose yet.

Project description

https://github.com/sdpython/cpyquickhelper/blob/master/_doc/sphinxdoc/source/phdoc_static/project_ico.png?raw=true

cpyquickhelper: python + C++ in different ways

Build status Build Status Windows https://circleci.com/gh/sdpython/cpyquickhelper/tree/master.svg?style=svg https://dev.azure.com/xavierdupre3/cpyquickhelper/_apis/build/status/sdpython.cpyquickhelper https://badge.fury.io/py/cpyquickhelper.svg MIT License https://codecov.io/github/sdpython/cpyquickhelper/coverage.svg?branch=master GitHub Issues Notebook Coverage Downloads size Forks Stars

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpyquickhelper-0.3.404.tar.gz (162.9 kB view details)

Uploaded Source

Built Distributions

cpyquickhelper-0.3.404-cp310-cp310-win_amd64.whl (686.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

cpyquickhelper-0.3.404-cp310-cp310-manylinux_2_24_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

cpyquickhelper-0.3.404-cp310-cp310-macosx_10_9_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

cpyquickhelper-0.3.404-cp39-cp39-win_amd64.whl (725.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

cpyquickhelper-0.3.404-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cpyquickhelper-0.3.404-cp39-cp39-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

cpyquickhelper-0.3.404-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cpyquickhelper-0.3.404-cp38-cp38-macosx_10_9_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

cpyquickhelper-0.3.404-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cpyquickhelper-0.3.404-cp37-cp37m-macosx_10_9_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file cpyquickhelper-0.3.404.tar.gz.

File metadata

  • Download URL: cpyquickhelper-0.3.404.tar.gz
  • Upload date:
  • Size: 162.9 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

Hashes for cpyquickhelper-0.3.404.tar.gz
Algorithm Hash digest
SHA256 199cb53180230c3207cbb654d76503176d487a762ea473b5bf8f4730d9cfcac8
MD5 bcb1c990abcc769920f2a2eea4e0f085
BLAKE2b-256 3ee59e771e91726320a7706f6839e96d876a4e304630e2db0d4cf17e4fae85de

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 686.1 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

Hashes for cpyquickhelper-0.3.404-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9ee383e17503adf9a1a02041431bea97f27292609775e6657d1bc900933a4683
MD5 9987c00d13f75d901b43cf47fd6252fe
BLAKE2b-256 37c5b1b82ba852f8267cdcafea227fdeb70f5c2b1b9a30cd8ec1126d12db2e78

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp310-cp310-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 8.9 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

Hashes for cpyquickhelper-0.3.404-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 222af94debf3e1bf631c6c89abe511eb9f8f289ba5e55a7eaa305f3e8a0c22e3
MD5 b8544abe6ed537b4fb82c0c73a26297b
BLAKE2b-256 def10c08f4b44b14ca6032a5a77d0692bb7b70ba1780dea2ba3749dda8a4a082

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.1 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

Hashes for cpyquickhelper-0.3.404-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f269e55a898f4ba748834d1fd7a09dd60cc67a8f7d022d4e19af25e08cab2ecf
MD5 e2aca0f88af3493b8ecdaff45c7cef87
BLAKE2b-256 835c63f4ea7f33a1afb16a97a09863fcd0b38a1421471bafd2182379ec5264e3

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 725.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

Hashes for cpyquickhelper-0.3.404-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 78297c9d8c1a260544c3e53f72d5226f0f1dd6be84596975f6323da07d8e07d5
MD5 039541428153d432a77f26542fb3f55d
BLAKE2b-256 cc485d1a0be2a5898125fe012592be82013e3bc5df42d27514584f4af3d7cc60

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cpyquickhelper-0.3.404-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3104dc8f302b68bffb820bec8345515f75390a632a6b13cfbea98147ec4a61ff
MD5 b4ab6be318481fe59fbed2f98ce8c794
BLAKE2b-256 f651855016e95fe0a437e8b693842899b1ee98d94512947547f05dec1d589313

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.3 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

Hashes for cpyquickhelper-0.3.404-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0e10b5aaec41afcbcf2d7d632642c3a9504d9cbe6af877eea90c1a19ac73f1cd
MD5 c03e3d0b17fa3d2385299f59c79cdf5e
BLAKE2b-256 a6ed421cc0bb2d3ee8dd2c964e9e4fbd5cbdc3e157fc7facabf0c4003c7cd184

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cpyquickhelper-0.3.404-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f809370d27ac4ef28479a10f06825a4659fc78e5e75bb86ae59af0db0c76465f
MD5 47224b2d42b69b55d459a264d1066f08
BLAKE2b-256 c6741f37cd9350236a2d1e63bdfce6be5cdd00341dd800427dabcf71c9be658c

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.1 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

Hashes for cpyquickhelper-0.3.404-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 abfe8f9a3583b1687276912ba948726af7babf980d93deb5bf294fabe44694f4
MD5 9d705eeaf79eca04d9499d20400208bf
BLAKE2b-256 a2349117d878826e8d89f649ff1f3dffff7ab0bcc94bd177d550f12edcba45c4

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cpyquickhelper-0.3.404-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5ed86e9c33419d98bbda25a8dd8978e0c01b29bd4435562b945ff104055fc67
MD5 9eb6e8c4690d2e606369c8301876794a
BLAKE2b-256 d8f0f05e9accf4156c137abe558e73d8bfe92c60ffdfd461fbc9e2df25dad977

See more details on using hashes here.

File details

Details for the file cpyquickhelper-0.3.404-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cpyquickhelper-0.3.404-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.1 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

Hashes for cpyquickhelper-0.3.404-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1102e30ad3b3a3518d7a3148fc5dd766813aa06f26ba91270d561d57294ccd0d
MD5 46bca4755417ee009788d7a0ef9635c7
BLAKE2b-256 29fd42813db919babf759c217214f0d18c985729b61fccc0bea42b6c76d35648

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