njsmith / colorspacious

A powerful, accurate, and easy-to-use Python library for doing colorspace conversions
MIT License
169 stars 16 forks source link

comparison.py:11: SyntaxWarning: invalid escape sequence '\D' #32

Open averyfreeman opened 3 months ago

averyfreeman commented 3 months ago

Hi, looks like your :math:\\Din the docstring ofcomparison.pyis throwing my interpreter, I'm onPython 3.12.3` Arch Linux OS

❯ python plot_color_gradients.py
/usr/lib/python3.12/site-packages/colorspacious/comparison.py:11: SyntaxWarning: invalid escape sequence '\D'
  """Computes the :math:`\Delta E` distance between pairs of colors.

I put a second backslash behind every single backslash in the docstring, and I can use the library now. I am not familiar with the :math: escapes, so I am not sure what that does to your document formatting.

I found discussion concerning the issue I faced on stackoverflow.com

If double-escapes break formatting for sphinx, maybe put the docstring in a separate file (?)