-
Notifications
You must be signed in to change notification settings - Fork 2
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
Run cellfinder benchmarks on small data #94
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #94 +/- ##
==========================================
+ Coverage 79.38% 84.45% +5.06%
==========================================
Files 18 17 -1
Lines 917 862 -55
==========================================
Hits 728 728
+ Misses 189 134 -55 ☔ View full report in Codecov by Sentry. |
This was referenced Apr 22, 2024
Merged
alessandrofelder
approved these changes
Apr 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this - just one tiny suggestion.
Co-authored-by: Alessandro Felder <[email protected]>
sfmig
force-pushed
the
smg/cellfinder-benchmarks-small
branch
from
April 30, 2024 09:53
fdc29fa
to
f800053
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is this PR
Why is this PR needed?
We are exploring a systematic way to benchmark
brainglobe
workflows usingasv
.This PR fixes some issues running the
cellfinder
workflow benchmarks (1) on a small GIN dataset and (2) on data available locally.What does this PR do?
This PR involves:
setup_cache
function of the benchmarks,To run the benchmarks locally on small dataset from GIN
Checkout this branch to get the latest version of the benchmarks locally.
Create a conda environment and pip install
asv
:Note that to run the benchmarks you do not need to install a development version of
brainglobe-workflows
, sinceasv
will create a separate Python virtual environment to run the benchmarks on it. However, for convenience we do includeasv
as part of thedev
dependencies, so you can use adev
environment to run benchmarks.For a quick check, run one iteration per benchmark with
-v --show-stderr
for a more verbose output.asv
virtual environment thebrainglobe-workflows
package from the tip of the local currently checked out branch, and run the (locally defined) benchmarks on it.To run the benchmarks (locally) on a locally available dataset
Define a config file for the workflow to benchmark. You can use the default one at
brainglobe_workflows/configs/cellfinder.json
for reference.input_data_dir
field pointing to the data of interest.signal
andbackground
subdirectories underinput_data_dir
. However, these defaults can be overwritten with thesignal_subdir
andbackground_subdir
fields.Create and activate an environment with
asv
(follow steps 1 and 2 from above).Run the benchmarks in "quick mode", passing the path to your config file as an environment variable
CONFIG_PATH
. In Unix systems:Troubleshooting
You may find that the conda environment creation is failing because of this issue. This seems to be because
asv
is assuming a conda syntax that changed with the latest release (in conda 24.3.0--force
became--yes
).A PR is on the way, as a temporary workaround you can try from base
conda install -y "conda<24.3"
.References
See issue #9.
Also related is issue #98 which I am currently investigating.
Further context
We currently have
asv
benchmarks for the three main steps involved in thecellfinder
workflow:We also have a benchmark for the full workflow.
We envisioned benchmarks being useful to developers in 3 main ways:
brainglobe_workflows/configs/cellfinder.json
).This is all explained in the README.
A reminder of how
asv
works:asv
creates a virtual environment where it installs the package to be benchmarked (in our case,brainglobe-workflows
). This virtual environment is defined in the asv config file (asv.conf.json
).asv
so that the version ofbrainglobe-workflows
that is installed in the asv-managed virtual environment is the one at the tip of the currently checked out branch (i.e., the version atHEAD
). This way developers can check if their local branch introduces regressions. Alternatively, we can choose to install a version ofbrainglobe-workflows
fetched from Github (for example, the tip of the remotemain
branch).asv
will look for benchmarks under thebenchmarks
folder (which is at the same level as theasv.conf.json
file), and run them.How has this PR been tested?
The benchmarks are checked with a CI job, rather than with explicit tests. This follows the general approach in the field - see #96 for more details.
Since we don't plan to test the benchmarks with pytest, I omitted the benchmarks from coverage.
Is this a breaking change?
No.
Does this PR require an update to the documentation?
The README has been updated to better reflect the current status.
Checklist: