From 9031ad3da0798dd97877f58f16279e652042eec8 Mon Sep 17 00:00:00 2001 From: ctena Date: Thu, 2 Mar 2023 16:23:35 +0100 Subject: [PATCH] Horizontal interpolation bug solved. --- nes/methods/horizontal_interpolation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nes/methods/horizontal_interpolation.py b/nes/methods/horizontal_interpolation.py index ec3c2a9..897327f 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: -- GitLab