From ee877536704c17e7e50951f615802eb866dc6973 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Fri, 6 Sep 2024 17:28:42 +0200 Subject: [PATCH] Only replace the fill_value in the returned connectivity if it's different from the internal FILL_VALUE --- xugrid/ugrid/ugridbase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xugrid/ugrid/ugridbase.py b/xugrid/ugrid/ugridbase.py index c72e0700..77c940f8 100644 --- a/xugrid/ugrid/ugridbase.py +++ b/xugrid/ugrid/ugridbase.py @@ -485,7 +485,8 @@ def _prepare_connectivity( def _set_fillvalue(self, connectivity: IntArray) -> IntArray: c = connectivity.copy() - c[c == FILL_VALUE] = self.fill_value + if self.fill_value != FILL_VALUE: + c[c == FILL_VALUE] = self.fill_value return c def _precheck(self, multi_index):