From dd7a9a505a37aa290baf2542799a05c4df76c473 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)