From 0c36a9d28a4a6403576a2da2a050eef10db2068b Mon Sep 17 00:00:00 2001 From: Daniel King Date: Tue, 5 Mar 2024 01:13:23 -0800 Subject: [PATCH] ignored --- scispacy/candidate_generation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scispacy/candidate_generation.py b/scispacy/candidate_generation.py index 7e9ae89..c988fcd 100644 --- a/scispacy/candidate_generation.py +++ b/scispacy/candidate_generation.py @@ -271,14 +271,14 @@ def nmslib_knn_with_zero_vectors( neighbors, distances = zip( *[(x[0].tolist(), x[1].tolist()) for x in original_neighbours] ) - neighbors = list(neighbors) - distances = list(distances) + neighbors = list(neighbors) # type: ignore + distances = list(distances) # type: ignore # neighbors need to be converted to an np.array of objects instead of ndarray of dimensions len(vectors)xk # Solution: add a row to `neighbors` with any length other than k. This way, calling np.array(neighbors) # returns an np.array of objects - neighbors.append([]) - distances.append([]) + neighbors.append([]) # type: ignore + distances.append([]) # type: ignore # interleave `neighbors` and Nones in `extended_neighbors` extended_neighbors[empty_vectors_boolean_flags] = numpy.array( neighbors, dtype=object