diff --git a/megaman/geometry/geometry.py b/megaman/geometry/geometry.py index 2787d62..f00cb58 100644 --- a/megaman/geometry/geometry.py +++ b/megaman/geometry/geometry.py @@ -155,10 +155,11 @@ def compute_adjacency_matrix(self, copy=False, **kwargs): if self.X is None: raise ValueError(distance_error_msg) - self.adjacency_kwds.update(kwargs) + kwds = self.adjacency_kwds.copy() + kwds.update(kwargs) self.adjacency_matrix = compute_adjacency_matrix(self.X, self.adjacency_method, - **self.adjacency_kwds) + **kwds) if copy: return self.adjacency_matrix.copy() else: @@ -186,10 +187,11 @@ def compute_affinity_matrix(self, copy=False, **kwargs): if self.adjacency_matrix is None: self.compute_adjacency_matrix() - self.affinity_kwds.update(kwargs) + kwds = self.affinity_kwds.copy() + kwds.update(kwargs) self.affinity_matrix = compute_affinity_matrix(self.adjacency_matrix, self.affinity_method, - **self.affinity_kwds) + **kwds) if copy: return self.affinity_matrix.copy() else: @@ -221,11 +223,12 @@ def compute_laplacian_matrix(self, copy=True, return_lapsym=False, **kwargs): if self.affinity_matrix is None: self.compute_affinity_matrix() - self.laplacian_kwds.update(kwargs) - self.laplacian_kwds['full_output'] = return_lapsym + kwds = self.laplacian_kwds.copy() + kwds.update(kwargs) + kwds['full_output'] = return_lapsym result = compute_laplacian_matrix(self.affinity_matrix, self.laplacian_method, - **self.laplacian_kwds) + **kwds) if return_lapsym: (self.laplacian_matrix, self.laplacian_symmetric,