8000 Allow easy call single benchmark by Czaki · Pull Request #7145 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow easy call single benchmark #7145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Conversation

Czaki
Copy link
Collaborator
@Czaki Czaki commented Jul 31, 2024

References and relevant issues

extracted from #7144

Description

This PR allows calling a single benchmark method without whole setup asv. It simplifies debugging.

It is a simple change and may not support all asv options (for example, it does not allow running functional benchmark)

Example call python napari/benchmarks/benchmark_shapes_layer.py Shapes3DSuite.time_get_value

@Czaki Czaki added this to the 0.5.2 milestone Jul 31, 2024
@Czaki Czaki added the maintenance PR with maintance changes, label Jul 31, 2024
@Czaki Czaki changed the title allow easy call single benchmark Allow easy call single benchmark Jul 31, 2024
Copy link
codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.88%. Comparing base (382964a) to head (5d1f4bc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7145      +/-   ##
==========================================
- Coverage   92.98%   92.88%   -0.11%     
==========================================
  Files         619      619              
  Lines       56653    56653              
==========================================
- Hits        52677    52620      -57     
- Misses       3976     4033      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brisvag
Copy link
Contributor
brisvag commented Jul 31, 2024

would be nicer if we didn't neeed to change all the benchmark files. Maybe just have a cli in benchmarks.__main__.py that picks up the needed benchmark, and call it with:

python -m napari.benchmarks Shapes3DSuite.time_get_value

@Czaki
Copy link
Collaborator Author
Czaki commented Jul 31, 2024

But what to do with name collisions? File name is part of test identifier.

@brisvag
Copy link
Contributor
brisvag commented Jul 31, 2024

But what to do with name collisions? File name is part of test identifier.

python -m napari.benchmarks benchmark_shapes_layer.Shapes3DSuite.time_get_value ?

But feel free to ignore, not a big deal :)

@Czaki
Copy link
Collaborator Author
Czaki commented Jul 31, 2024

@brisvag done

Copy link
Contributor
@brisvag brisvag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean :)

@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label Jul 31, 2024
@Czaki Czaki merged commit fa7dc7c into napari:main Aug 2, 2024
40 checks passed
@Czaki Czaki deleted the allow_easy_run_benchmark branch August 2, 2024 16:05
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Aug 2, 2024
@jni jni added the enhancement label Aug 3, 2024
jni pushed a commit to napari/docs that referenced this pull request Aug 12, 2024
# References and relevant issues

depends on napari/napari#7145

# Description

Add documentation on how easy run benchmarks under debugger to easier
understand why benchmarks fail.

---------

Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>
Czaki added a commit to Czaki/napari that referenced this pull request Sep 6, 2024
In napari#7145 I have implemented option to call benchmarks without using asv (for debug purpose.

Hovewer I forgoten about case of benchmarks without any parameters. I also forgot about call of teardown method. This PR is fixing this.
Czaki added a commit that referenced this pull request Sep 8, 2024
# Description
In #7145 I have implemented option to call benchmarks without using asv
(for debug purpose).

However, I have forgotten about the case of benchmarks without any
parameters. I also forgot about the call of teardown method. This PR is
fixing this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement maintenance PR with maintance changes,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0