spacetelescope / poppy

Physical Optics Propagation in Python
https://poppy-optics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
211 stars 69 forks source link

Minor: quiet two syntax warnings about string escape sequences #616

Closed mperrin closed 4 months ago

mperrin commented 4 months ago

Minor change in some string outputs; no functional change in code or math implementation. This PR quiets those with some tiny edits that fix a couple bits of string formatting.

Running in python 3.12 yielded some syntax warnings about invalid escape sequence. These are valid warnings about minor errors; it seems like somebody improved the string parser upstream to be more informative or check more.

WARNING - /Users/mperrin/Dropbox/Documents/software/poppy/poppy/utils.py:1339: SyntaxWarning: invalid escape sequence '\*'
WARNING - /Users/mperrin/Dropbox/Documents/software/poppy/poppy/zernike.py:103: SyntaxWarning: invalid escape sequence '\s'
  return "\sqrt{%d}* ( %s ) * \\cos(%d \\theta)" % (2 * (n + 1), outstr, m)
WARNING - /Users/mperrin/Dropbox/Documents/software/poppy/poppy/zernike.py:105: SyntaxWarning: invalid escape sequence '\s'
  return "\sqrt{%d}* ( %s ) * \\sin(%d \\theta)" % (2 * (n + 1), outstr, m)
mperrin commented 4 months ago

@BradleySappington this is a fairly trivial PR and does not really need much review; would you be able to take a look and hopefully approve, please?