Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: ASV Benchmark for High Resolution MPAS Atmosphere Grids #958

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
40 changes: 40 additions & 0 deletions benchmarks/mpas_dyamond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from asv_runner.benchmarks.mark import skip_benchmark_if, timeout_class_at

import uxarray as ux
import os



# TODO: ...
grid_path_dict = {"30km": "/glade/campaign/cisl/vast/uxarray/data/dyamond/30km/grid.nc",
"15km": "/glade/campaign/cisl/vast/uxarray/data/dyamond/15km/grid.nc",
"7.5km": "/glade/campaign/cisl/vast/uxarray/data/dyamond/7.5km/grid.nc",
"3.75km":"/glade/campaign/cisl/vast/uxarray/data/dyamond/3.75km/grid.nc"}

# TODO: ...
data_path_dict = ...

# TODO: ...
all_paths_exist = True
for file_path in grid_path_dict.values():
all_paths_exist = all_paths_exist and os.path.exists(file_path)


class BaseGridBenchmark:
"""Base class for Grid Benchmarks across the four supported resolutions
(30km, 15km, 7.5km, 3.75km)"""
param_names = ['resolution']
params = [['30km', '15km', '7.5km', '3.75km'],]

def setup(self, resolution, **kwargs):
self.uxgrid = ux.open_grid(grid_path_dict[resolution])

def teardown(self, resolution, **kwargs):
del self.uxgrid


@timeout_class_at(1000)
class GeoDataFrameConversion(BaseGridBenchmark):
@skip_benchmark_if(not all_paths_exist)
def time_to_geodataframe(self, resolution):
self.uxgrid.to_geodataframe(exclude_antimeridian=True)
Loading