Skip to content

Commit

Permalink
Added initial AVS benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ojeda-e committed Jul 4, 2022
1 parent ab0d652 commit e41c20c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
Empty file added benchmarks/__init__.py
Empty file.
47 changes: 47 additions & 0 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
@@ -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"

}
16 changes: 16 additions & 0 deletions benchmarks/membranecurvature.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit e41c20c

Please sign in to comment.