From 0af197985840a715c3566b6bdb5f355b21224e92 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:55:51 +0200 Subject: [PATCH] Add ASV for datatree.from_dict (#9459) --- asv_bench/benchmarks/datatree.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 asv_bench/benchmarks/datatree.py diff --git a/asv_bench/benchmarks/datatree.py b/asv_bench/benchmarks/datatree.py new file mode 100644 index 00000000000..6e504bed296 --- /dev/null +++ b/asv_bench/benchmarks/datatree.py @@ -0,0 +1,11 @@ +import xarray as xr +from xarray.core.datatree import DataTree + + +class Datatree: + def setup(self): + run1 = DataTree.from_dict({"run1": xr.Dataset({"a": 1})}) + self.d = {"run1": run1} + + def time_from_dict(self): + DataTree.from_dict(self.d)