Skip to content

Commit

Permalink
add simple benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed May 31, 2024
1 parent 86c292c commit 06e85d2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
19 changes: 19 additions & 0 deletions benchmarks/benchmarks/brainglobe_atlasapi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from brainglobe_workflows.brainglobe_atlasapi.create_mouse_atlas import (
create_mouse_atlas,
)


class TimeBenchmark:
# Timing attributes
timeout = 3600 # default: 60 s
version = (
None # benchmark version. Default:None (i.e. hash of source code)
)
warmup_time = 0.1 # seconds
rounds = 2
repeat = 0
sample_time = 0.01 # default: 10 ms = 0.01 s;
min_run_count = 2 # default:2

def time_create_mouse_atlas(self):
create_mouse_atlas()
Empty file.
10 changes: 10 additions & 0 deletions brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from brainglobe_atlasapi import BrainGlobeAtlas

Check warning on line 1 in brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py

View check run for this annotation

Codecov / codecov/patch

brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py#L1

Added line #L1 was not covered by tests


def create_mouse_atlas():
atlas = BrainGlobeAtlas("allen_mouse_100um")
print(atlas.name)

Check warning on line 6 in brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py

View check run for this annotation

Codecov / codecov/patch

brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py#L4-L6

Added lines #L4 - L6 were not covered by tests


if __name__ == "__main__":
create_mouse_atlas()

Check warning on line 10 in brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py

View check run for this annotation

Codecov / codecov/patch

brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py#L9-L10

Added lines #L9 - L10 were not covered by tests

0 comments on commit 06e85d2

Please sign in to comment.