neurodata / hyppo

Python package for multivariate hypothesis testing
https://hyppo.neurodata.io/
Other
218 stars 88 forks source link

Figure out a solution for warnings for jit compiler #380

Closed ebridge2 closed 1 year ago

ebridge2 commented 1 year ago

Every time you run hyppo, you get nreps* of a warning about @jit being deprecated. It looks like:

/usr/local/lib/python3.9/site-packages/umap_learn-0.5.3-py3.9.egg/umap/distances.py:1063: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()

For instance:

import numpy as np
from graspologic.simulations import sbm
from graphbook_code import dcsbm
from copy import deepcopy
# the block matrix for the neurons before learning
B0 = 0.05*np.ones((3, 3))
np.fill_diagonal(B0, 0.4)
B_learned = deepcopy(B0)
B_learned[0,1] = B_learned[1,0] = 0.3

nk = 30
ns = np.repeat(nk, 3)

theta = np.tile(np.linspace(np.sqrt(2), np.sqrt(2) - 1, nk), 3)
zs = np.repeat([1,2,3], nk)

T = 12
networks = np.array([sbm(ns, B0) if (t < 6 or t > 8) else dcsbm(zs, theta, B0) for t in range(T)])

and:

from graspologic.inference import latent_position_test
#import warnings

#warnings.filterwarnings('ignore')
pvalues = [latent_position_test(networks[t], networks[t + 1], n_components=3, n_bootstraps=1000, workers=-1)[1] for t in range(T-1)]

produces the error.

Version information