Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

auto detect time units in kernprof -v output #113

Open
wants to merge 74 commits into
base: master
Choose a base branch
from

Conversation

uweschmitt
Copy link

Output now looks like this:

line #      Hits            Time     Per Hit   % Time  Line Contents
====================================================================
    11                                                 @profile
    12                                                 def main():
    13         1        13.0[µs]    13.0[µs]      0.0      wait(0)
    14         1       102.1[ms]   102.1[ms]      8.5      wait(0.1)
    15         1         1.1[s]      1.1[s]      91.5      wait(1.1)

@uweschmitt
Copy link
Author

Line #      Hits          Time   Per Hit   % Time  Line Contents
================================================================
    11                                             @profile
    12                                             def main():
    13         1        14.0µs    14.0µs      0.0      wait(0)
    14         1       100.7ms   100.7ms      8.4      wait(0.1)
    15         1         1.1s      1.1s      91.6      wait(1.1)

Hanaasagi and others added 29 commits April 17, 2019 15:53
Use the production version instead of the prerelease version.
Travis CI: Upgrade to Python 3.8.0
Add badges
Update links in readme
Add 3.8 support to multibuild
Scikit-build + Wheels + GPG + PyPI
Erotemic and others added 29 commits April 23, 2021 09:16
* Upload coverage in CI

* did CCI break?
* Changed coverage to create xml and replaced codecove-python with action

* Moved coverage config to pyproject.toml and deleted .coveragerc

* Update pyproject.toml

Removed omitted patterns specific to a different project.

* Update pyproject.toml

removed old-source in coverage config

Co-authored-by: Jon Crall <[email protected]>
* Add better error message

* Add note about the Gohlke win32 wheels in README

* Kernprof now maintains its own version and we test that it agrees with line_profiler

* Add coverage badge
* Fix for 3.5

* version bump
* Include c source files in manifest

* update changelog
* Add tests that builds from the source dist

* Add pyproject.toml and pyx files to manifest

* Remove experimental version augmentation
* Changed workflow to use joerick/cibuildwheel for building and testing

* Added non-native architectures on Linux

* Split up architectures for quicker runs

* Splitup built targets to more workers for faster overall built time

* Moved linting step to python-publish.yml

* Added local built artifacts to .gitignore

* Only emulate architectures on Linux if it isn't 'auto'

* Removed python-test.yml and renamed python-publish.yml to tests.yml

To get the coverage upload on linux to work properly there were some 'hacks' needed since the linux build and tests run inside docker.
Those hack are:
- temporary renaming kernprof.py so tests only use the installed one
- replacing the file paths inside the .coverage files, so they will be valid in the host environment (needed for coverage combine)
- copying the .coverage file to the wheel output directory, so they are available on the host

* Moved python-sdist-test.yml code to tests.yml

Since  the  sdist test is manly to ensure that all needed files are included in the sdist, IMHO it is enought to hest it with one python version, since the coplebility test is done by the wheel tests.

* Made deploy only run on tags

* Removed branch restrictions

* Added back 'test_version_agreement'

* Update cibuildwheel to 1.11.0

* Added dependabot config to to check github actions for updates
This:

    kernprof -v profile_me.py

Produces this trace back
    Wrote profile results to profile_me.py.prof
    Traceback (most recent call last):
    File ".../bin/kernprof", line 11, in <module>
        sys.exit(main())
    File "...site-packages/kernprof.py", line 243, in main
        prof.print_stats(output_unit=options.unit, stripzeros=options.skip_zero)
    TypeError: print_stats() got an unexpected keyword argument 'output_unit'

While:

    kernprof -v -l profile_me.py

works.
* Update to 3.3.0

* Update manylinux1 for python 3.5

* keep 3.5 support for a little while longer

* Update native_mb_python_tag
Bumps [joerick/cibuildwheel](https://github.com/joerick/cibuildwheel) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/joerick/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: joerick/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Profiling in Jupyter Notebooks or Jupyter Lab with recent ipykernel
versions (>= 6), resulted in the following error message:

    Could not find file /tmp/ipykernel_8298/3242911465.py
    Are you sure you are running this program from the same
    directory that you ran the profiler from?
    Continuing without the function's contents.

The timing output then does not include source code lines.

The problem is that line_profiler tries to determine when it runs in
side IPython/Jupyter using a simple heuristic based on the reported
filename. New ipykernel versions changed this filename pattern and broke
our test.

As a quick fix, amend the test so it continues working. Longer term, a
more robust solution would be desirable.

Fixes pyutils/line_profiler#86
* Add CHANGELOG note related to rkern#93

* Bump to version 3.3.1
* Add CHANGELOG note related to rkern#93

* Bump to version 3.3.1
* wip

* wip

* wip

* wip

* Add note about new GPG keys

* wip

* Remove debug configurations
Test the publish on the PR branch with the test.pypi server.
Now support Xeus-python
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.