From e41c20c591e0c40d7a70cf494c54e995089971ed Mon Sep 17 00:00:00 2001 From: ojeda-e Date: Mon, 4 Jul 2022 17:54:54 -0400 Subject: [PATCH] Added initial AVS benchmark --- benchmarks/__init__.py | 0 benchmarks/asv.conf.json | 47 +++++++++++++++++++++++++++++++++ benchmarks/membranecurvature.py | 16 +++++++++++ 3 files changed, 63 insertions(+) create mode 100644 benchmarks/__init__.py create mode 100644 benchmarks/asv.conf.json create mode 100644 benchmarks/membranecurvature.py diff --git a/benchmarks/__init__.py b/benchmarks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json new file mode 100644 index 0000000..b22713c --- /dev/null +++ b/benchmarks/asv.conf.json @@ -0,0 +1,47 @@ +{ + // The version of the config file format. Do not change, unless + // you know what you are doing. + "version": 1, + + // The name of the project being benchmarked + "project": "membranecurvature", + + // The URL of the source code repository for the project being + // benchmarked + "repo": "..", + "dvcs": "git", + "repo_subdir":".", + "branches": ["main"], + + // The base URL to show information about a particular commit. + "show_commit_url": "https://github.com/MDAnalysis/membrane-curvature/commit/", + + // The Pythons you'd like to test against. If not provided, defaults + // to the current version of Python used to run `asv`. + "pythons": ["3.8"], + // The matrix of dependencies to test. Each key is the name of a + // package (in PyPI) and the values are version numbers. An empty + // list indicates to just test against the default (latest) + // version. + "conda_channels": ["conda-forge"], + "matrix": { + "numpy": [], + "scipy": [], + "pytest": [], + "MDAnalysisTests": [], + }, + // The directory (relative to the current directory) that benchmarks are + // stored in. If not provided, defaults to "benchmarks" + "benchmark_dir": ".", + // The directory (relative to the current directory) to cache the Python + // environments in. If not provided, defaults to "env" + "env_dir": "virtualenv", + "environment_type": "conda", + // The directory (relative to the current directory) that raw benchmark + // results are stored in. If not provided, defaults to "results". + "results_dir": "results", + // The directory (relative to the current directory) that the html tree + // should be written to. If not provided, defaults to "html". + "html_dir": "html" + +} \ No newline at end of file diff --git a/benchmarks/membranecurvature.py b/benchmarks/membranecurvature.py new file mode 100644 index 0000000..acfa98c --- /dev/null +++ b/benchmarks/membranecurvature.py @@ -0,0 +1,16 @@ +import MDAnalysis as mda +from membrane_curvature.tests.datafiles import GRO_PO4_SMALL +from membrane_curvature.base import MembraneCurvature + + +class MembraneCurvatureBenchmark(): + """ + Benchmark for MembraneCurvature class + """ + + def setup(self): + self.u = mda.Universe(GRO_PO4_SMALL) + self.sel = mda.select_atoms('name PO4') + + def time_surface(self): + MembraneCurvature(self.u, select=self.sel).run()