From 0b62548ad76c709dac24d4d04bab0ec73ce90abe Mon Sep 17 00:00:00 2001 From: Levi John Wolf Date: Thu, 15 Aug 2024 10:57:09 +0100 Subject: [PATCH] add cast to W for current mvlisa implementation --- esda/moran_local_mv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esda/moran_local_mv.py b/esda/moran_local_mv.py index eb781d78..087bae12 100644 --- a/esda/moran_local_mv.py +++ b/esda/moran_local_mv.py @@ -79,6 +79,8 @@ def __init__( """ self._mvquads = mvquads y = np.asarray(y).reshape(-1, 1) + if hasattr(W, "to_W"): + W = W.to_W() W.transform = "r" y = y - y.mean() if unit_scale: @@ -307,6 +309,8 @@ def __init__( X /= X.std(axis=0) self.y = y self.X = X + if hasattr(W, "to_W"): + W = W.to_W() W.transform = "r" self.W = W y_filtered_ = self.y_filtered_ = self._part_regress_transform(y, X)