Skip to content

Commit

Permalink
ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg committed Mar 5, 2024
1 parent 4fd0d32 commit 0c36a9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scispacy/candidate_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c36a9d

Please sign in to comment.