pnnl / HyperNetX

Python package for hypergraph analysis and visualization.
https://hypernetx.readthedocs.io
Other
500 stars 86 forks source link

TeX in docstrings causes DeprecationWarning. #128

Closed drj11 closed 6 months ago

drj11 commented 7 months ago

Describe the bug

On Python 3.11 when i import hypernetx i get a few warnings:

>>> import hypernetx as hnx
/Users/drj/prj/HyperNetX/hypernetx/algorithms/homology_mod2.py:1: DeprecationWarning: invalid escape sequence '\{'
  """
/Users/drj/prj/HyperNetX/hypernetx/algorithms/homology_mod2.py:544: DeprecationWarning: invalid escape sequence '\m'
  """
/Users/drj/prj/HyperNetX/hypernetx/algorithms/homology_mod2.py:737: DeprecationWarning: invalid escape sequence '\{'
  """
/Users/drj/prj/HyperNetX/hypernetx/algorithms/laplacians_clustering.py:42: DeprecationWarning: invalid escape sequence '\g'
  """

These are causes by the TeX code appearing inside Python docstrings. Probably the simplest approach would be to make the docstrings raw by changing """ to r""" at the beginning of the affected docstrings [edit: as has been done in s_centrality_measures.py for example].

In addition the affected docstring in laplacians_clustering.py looks like it needs some dollar signs, but i am not familiar with your post-processing documentation tools.

Whilst i found this during my review for JOSS, i do not require it to be fixed for acceptance.

Environment (please complete the following information):

bonicim commented 6 months ago

Fixed in v2.1.3.