From b26ee4761133555570061f6a96f51bf265039c10 Mon Sep 17 00:00:00 2001 From: Mike Kryjak Date: Thu, 16 Mar 2023 13:49:19 +0000 Subject: [PATCH 1/3] Add topology to metadata --- xbout/region.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbout/region.py b/xbout/region.py index 17bf6454..154c54ce 100644 --- a/xbout/region.py +++ b/xbout/region.py @@ -1220,7 +1220,8 @@ def _create_regions_toroidal(ds): _check_connections(regions) ds = _set_attrs_on_all_vars(ds, "regions", regions) - + ds["topology"] = topology + return ds From 420415cb322956fa6b5f0c3dfc9abc2db242054f Mon Sep 17 00:00:00 2001 From: Mike Kryjak Date: Thu, 16 Mar 2023 14:19:14 +0000 Subject: [PATCH 2/3] Fix typo on topology metadata --- xbout/region.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbout/region.py b/xbout/region.py index 154c54ce..dabd6788 100644 --- a/xbout/region.py +++ b/xbout/region.py @@ -1220,7 +1220,7 @@ def _create_regions_toroidal(ds): _check_connections(regions) ds = _set_attrs_on_all_vars(ds, "regions", regions) - ds["topology"] = topology + ds.metadata["topology"] = topology return ds From e670f187e7625c08b29d8d879a353b025fd798d6 Mon Sep 17 00:00:00 2001 From: Mike Kryjak Date: Thu, 16 Mar 2023 14:45:16 +0000 Subject: [PATCH 3/3] black formatting --- xbout/region.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbout/region.py b/xbout/region.py index dabd6788..b6653824 100644 --- a/xbout/region.py +++ b/xbout/region.py @@ -1221,7 +1221,7 @@ def _create_regions_toroidal(ds): ds = _set_attrs_on_all_vars(ds, "regions", regions) ds.metadata["topology"] = topology - + return ds