Skip to content

Commit 6bb3f04

Browse files
committed
removing unused imports
1 parent 7c93e97 commit 6bb3f04

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

wordllama/algorithms/deduplicate_helpers.pyx

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True
22
# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
3-
# deduplicate_helpers.pyx
43

54
import numpy as np
65
cimport numpy as np
7-
from libc.stdlib cimport malloc, free
8-
from cython cimport boundscheck, wraparound
9-
from cython cimport floating
10-
from cython cimport cdivision
11-
from wordllama.algorithms.vector_similarity cimport vector_similarity
6+
from .vector_similarity cimport vector_similarity
127

138
cdef extern from "math.h":
149
double sqrt(double)
@@ -17,7 +12,7 @@ ctypedef fused embedding_dtype:
1712
np.float32_t
1813
np.uint64_t
1914

20-
def deduplicate_embeddings(np.ndarray[embedding_dtype, ndim=2] doc_embeddings,
15+
def deduplicate_embeddings(np.ndarray[embedding_dtype, ndim=2] doc_embeddings,
2116
double threshold, int batch_size):
2217
"""
2318
Identify duplicate document indices based on vector similarity.

wordllama/algorithms/find_local_minima.pyx

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
import numpy as np
55
cimport numpy as np
6-
from libc.math cimport abs as c_abs
7-
from libcpp.vector cimport vector
8-
from math import factorial
96

107
ctypedef np.float32_t DTYPE_t
118

wordllama/algorithms/vector_similarity.pyx

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
33

44
import numpy as np
5-
cimport numpy as cnp
5+
cimport numpy as np
66
from numpy cimport (
77
uint64_t,
88
float32_t,
99
uint32_t,
10-
PyArrayObject,
11-
PyArray_DIMS,
10+
uint8_t
1211
)
13-
from libc.stdint cimport int32_t, uint64_t, uint8_t
14-
from cython cimport boundscheck, wraparound
15-
cimport cython
1612

17-
cnp.import_array()
13+
np.import_array()
1814

1915
cdef extern from *:
2016
"""

0 commit comments

Comments
 (0)