diff --git a/asv.conf.base.json b/asv.conf.base.json index 98fd876..5c4d42c 100644 --- a/asv.conf.base.json +++ b/asv.conf.base.json @@ -8,9 +8,11 @@ "matrix": { "req": { "numpy": ["", null], - }, + "pip+asv-bench-memray": [">=0.1.2"], + "asv": [">=0.6.2"] + } }, "env_dir": ".asv/env", "results_dir": ".asv/results", - "html_dir": ".asv/html", + "html_dir": ".asv/html" } diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index 858326f..0e2aec2 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -1,18 +1,12 @@ -from asv_samples.benchme import add_arr - - -class TimeSuite: - """ - Benchmark that times various operations, including custom summation of - lists. - """ - - def setup(self): - self.list1 = [i for i in range(500)] - self.list2 = [i for i in range(500, 1000)] - - def time_add_arr(self): - """ - Time the add_arr function with two lists of numbers. - """ - add_arr(self.list1, self.list2) +from asv_runner.benchmarks.mark import SkipNotImplemented + +class MemrayBenchmarks: + params = [10, int(2e4)] + + def ray_sum(self, n): + try: + import numpy as np + except ImportError: + raise SkipNotImplemented("Can't run without NumPy") + self.data = np.random.rand(n) + np.sum(self.data) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..54a908c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ "hatch-vcs", "hatchling" ] + +[tool.hatch.build.hooks.vcs] +version-file = "_version.py" + +[tool.hatch.build] +include = [ "asv_samples/**/*.py", "asv_samples/*.py" ] + +[project] +name = "asv_samples" +version = "0.1.0" +description = "A set of asv samples" +authors = [ + {name = "Rohit Goswami", email = "rgoswami@ieee.org"}, +] +license = {file = "LICENSE"} +readme = "readme.md" + +[project.urls] +repository = "https://github.com/HaoZeke/asv_samples"