diff --git a/nes/methods/horizontal_interpolation.py b/nes/methods/horizontal_interpolation.py index ec3c2a9dcf76c9ba74ee32144d700581004b38fe..897327fb04b2f6b288a939e868a5568a6e7c0518 100644 --- a/nes/methods/horizontal_interpolation.py +++ b/nes/methods/horizontal_interpolation.py @@ -330,13 +330,13 @@ def get_weights_idx_xy_axis(self, dst_grid, weight_matrix_path, kind, n_neighbou else: weight_matrix = True if kind in NEAREST_OPTS: - if len(weight_matrix.lev['data']) != n_neighbours: - warn("The selected weight matrix does not have the same number of nearest neighbours." + - "Re-calculating again but not saving it.") - if self.master: + if self.master: + if len(weight_matrix.lev['data']) != n_neighbours: + warn("The selected weight matrix does not have the same number of nearest neighbours." + + "Re-calculating again but not saving it.") weight_matrix = create_nn_weight_matrix(self, dst_grid, n_neighbours=n_neighbours) - else: - weight_matrix = True + else: + weight_matrix = True else: if kind in NEAREST_OPTS: if self.master: