fabian-sp / GGLasso

A Python package for General Graphical Lasso computation
MIT License
30 stars 14 forks source link

Warnings when running tests #27

Closed papachristoumarios closed 2 years ago

papachristoumarios commented 3 years ago

I am getting the following warnings when running the tests of the repo (all the tests pass):

gglasso/problem.py:19
  /home/mp2242/GGLasso/gglasso/problem.py:19: DeprecationWarning: invalid escape sequence \T
    """

gglasso/problem.py:472
  /home/mp2242/GGLasso/gglasso/problem.py:472: DeprecationWarning: invalid escape sequence \l
    """

gglasso/problem.py:502
  /home/mp2242/GGLasso/gglasso/problem.py:502: DeprecationWarning: invalid escape sequence \l
    """

gglasso/problem.py:690
  /home/mp2242/GGLasso/gglasso/problem.py:690: DeprecationWarning: invalid escape sequence \g
    """

gglasso/solver/admm_solver.py:17
  /home/mp2242/GGLasso/gglasso/solver/admm_solver.py:17: DeprecationWarning: invalid escape sequence \m
    """

gglasso/solver/ext_admm_solver.py:21
  /home/mp2242/GGLasso/gglasso/solver/ext_admm_solver.py:21: DeprecationWarning: invalid escape sequence \m
    """

gglasso/solver/ppdna_solver.py:154
  /home/mp2242/GGLasso/gglasso/solver/ppdna_solver.py:154: DeprecationWarning: invalid escape sequence \m
    """

gglasso/tests/test_solvers.py::test_ADMM_GGL
  /home/mp2242/GGLasso/gglasso/helper/basic_linalg.py:26: NumbaPerformanceWarning: '@' is faster on contiguous arrays, called on (array(float64, 2d, A), array(float64, 2d, A))
    res += Sdot(X[k,:,:], Y[k,:,:])

gglasso/tests/test_solvers.py::test_admm_ppdna_ggl
  /home/mp2242/GGLasso/gglasso/solver/ggl_helper.py:262: NumbaPerformanceWarning: '@' is faster on contiguous arrays, called on (array(float64, 2d, A), array(float64, 2d, F))
    ij_entry = jacobian_prox_phi(X[:,i,j] , l1 , l2, reg)

gglasso/tests/test_solvers.py::test_admm_ppdna_ggl
  /home/mp2242/GGLasso/gglasso/solver/ggl_helper.py:262: NumbaPerformanceWarning: '@' is faster on contiguous arrays, called on (array(float64, 2d, C), array(float64, 2d, A))
    ij_entry = jacobian_prox_phi(X[:,i,j] , l1 , l2, reg)

gglasso/tests/test_solvers.py::test_admm_ppdna_ggl
  /home/mp2242/GGLasso/gglasso/solver/ggl_helper.py:417: NumbaPerformanceWarning: '@' is faster on contiguous arrays, called on (array(float64, 2d, A), array(float64, 1d, A))
    r = b - hessian_Y(x, Gamma, eigQ, W, sigma_t)

gglasso/tests/test_solvers.py::test_admm_ppdna_ggl
  /home/mp2242/GGLasso/gglasso/solver/ggl_helper.py:417: NumbaPerformanceWarning: '@' is faster on contiguous arrays, called on (array(float64, 2d, F), array(float64, 2d, A))
    r = b - hessian_Y(x, Gamma, eigQ, W, sigma_t)

I think that the warnings can be easily fixed.

Thank you in advance

fabian-sp commented 3 years ago

Thanks for raising the issue. 1) I did not get the DeprecationWarning but I guess they can be fixed with an additional \? 2) Regarding the NumbaPerformanceWarning: i tried to fix these, but got the warning even when explicitly converting into an contiguous array before calling the function (which would be anyways a rather messy solution). I concluded from https://stackoverflow.com/questions/54026429/numba-raises-performance-warning-when-using-eventhough-array-are-contiguous that this could be a numba internal issue. Do you know a solution for this from prior experience?

papachristoumarios commented 3 years ago

Hi @fabian-sp,

thank you for the reply. See my responses below:

  1. I did not get the DeprecationWarning but I guess they can be fixed with an additional \?

Yes! I think it can be fixed this way.

  1. Regarding the NumbaPerformanceWarning: i tried to fix these, but got the warning even when explicitly converting into an contiguous array before calling the function (which would be anyways a rather messy solution). I concluded from https://stackoverflow.com/questions/54026429/numba-raises-performance-warning-when-using-eventhough-array-are-contiguous that this could be a numba internal issue. Do you know a solution for this from prior experience?

Since the solution becomes messy and the warning persists after you have changed, I do not see a point in changing the initial code in this occasion (we can also ask the second reviewer for that). Moreover, I do not know any solution from prior experience.

Thank you

fabian-sp commented 3 years ago

Hi @papachristoumarios ,

the issue is adressed in https://github.com/fabian-sp/GGLasso/pull/29.

Thank you for your input.