Skip to content

Commit

Permalink
Add ASV benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Jun 29, 2024
1 parent 6c83fdb commit 91b54e6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions asv_bench/benchmarks/datatree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import numpy as np

import xarray as xr
from xarray.core.datatree import DataTree

from . import parameterized


class Datatree:
def setup(self):
dat1 = xr.Dataset({"a": 1})
run1 = DataTree.from_dict({"run1": dat1})
self.d = {"run1": run1}

@parameterized(["copy"], [(True, False)])
def time_from_dict(self, copy: bool):
DataTree.from_dict(self.d, copy=copy)

0 comments on commit 91b54e6

Please sign in to comment.