Skip to content

Commit 2d5d300

Browse files
authored
aspect: added benchmarks (#640)
1 parent 0ed4819 commit 2d5d300

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

benchmarks/benchmarks/aspect.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from xrspatial import aspect
2+
from .common import get_xr_dataarray
3+
4+
5+
class Aspect:
6+
params = ([100, 300, 1000, 3000, 10000], ["numpy", "cupy"])
7+
param_names = ("nx", "type")
8+
9+
def setup(self, nx, type):
10+
ny = nx // 2
11+
self.xr = get_xr_dataarray((ny, nx), type)
12+
13+
def time_aspect(self, nx, type):
14+
aspect(self.xr)

0 commit comments

Comments
 (0)