diff --git a/src/weather_model_graphs/create/base.py b/src/weather_model_graphs/create/base.py index f922b2d..a99510d 100644 --- a/src/weather_model_graphs/create/base.py +++ b/src/weather_model_graphs/create/base.py @@ -1,4 +1,4 @@ -""" +f""" Generic routines for creating the graph components used in the message-passing graph, and for connecting nodes across these component graphs. @@ -333,6 +333,8 @@ def _find_neighbour_node_idxs_in_source_mesh(xy_target): if max_num_neighbours is None: raise Exception( "to use `nearest_neighbours` you should set the max number with `max_num_neighbours`" + neigh_idxs = np.atleast_1d(neigh_idxs) + ) if max_dist is not None or rel_max_dist is not None: raise Exception( @@ -341,6 +343,7 @@ def _find_neighbour_node_idxs_in_source_mesh(xy_target): def _find_neighbour_node_idxs_in_source_mesh(xy_target): neigh_idxs = kdt_s.query(xy_target, max_num_neighbours)[1] + neigh_idxs = np.atleast_1d(neigh_idxs) return neigh_idxs elif method == "within_radius":