From 06e85d220cef8f335b78b3eef5e97af29ffaedc9 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 31 May 2024 17:24:56 +0100 Subject: [PATCH] add simple benchmark --- benchmarks/benchmarks/brainglobe_atlasapi.py | 19 +++++++++++++++++++ .../brainglobe_atlasapi/__init__.py | 0 .../brainglobe_atlasapi/create_mouse_atlas.py | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 benchmarks/benchmarks/brainglobe_atlasapi.py create mode 100644 brainglobe_workflows/brainglobe_atlasapi/__init__.py create mode 100644 brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py diff --git a/benchmarks/benchmarks/brainglobe_atlasapi.py b/benchmarks/benchmarks/brainglobe_atlasapi.py new file mode 100644 index 00000000..43443ec9 --- /dev/null +++ b/benchmarks/benchmarks/brainglobe_atlasapi.py @@ -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() diff --git a/brainglobe_workflows/brainglobe_atlasapi/__init__.py b/brainglobe_workflows/brainglobe_atlasapi/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py b/brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py new file mode 100644 index 00000000..9410b233 --- /dev/null +++ b/brainglobe_workflows/brainglobe_atlasapi/create_mouse_atlas.py @@ -0,0 +1,10 @@ +from brainglobe_atlasapi import BrainGlobeAtlas + + +def create_mouse_atlas(): + atlas = BrainGlobeAtlas("allen_mouse_100um") + print(atlas.name) + + +if __name__ == "__main__": + create_mouse_atlas()