Skip to content

Commit

Permalink
Deprecated kcdf density from gsva fixing numba issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PauBadiaM committed Aug 5, 2024
1 parent 0a24fa9 commit 0b3d9a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions decoupler/method_gsva.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ def mat_d(mat, pre_cdf):


def density(mat, kcdf=False):
if kcdf:
pre_cdf = init_cdfs()
mat = mat_d(mat, pre_cdf)
else:
mat = mat_ecdf(mat)
#if kcdf:
# pre_cdf = init_cdfs()
# mat = mat_d(mat, pre_cdf)
#else:
mat = mat_ecdf(mat)
return mat


@nb.njit(nb.types.Tuple((nb.f4[:, :], nb.i8[:, :]))(nb.f4[:, :]), parallel=True, cache=True)
def nb_get_D_I(mat):
n = mat.shape[1]
rev_idx = np.abs(np.arange(n, stop=0, step=-1, dtype=nb.f4) - n / 2)
rev_idx = np.abs(np.arange(n, 0, -1, nb.f4) - n / 2)
Idx = np.zeros(mat.shape, dtype=nb.i8)
for i in nb.prange(mat.shape[0]):
Idx[i] = np.argsort(-mat[i])
Expand Down

0 comments on commit 0b3d9a9

Please sign in to comment.