semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

Fix deprecation warnings due to invalid escape sequences. #143

Closed tirkarthi closed 3 years ago

tirkarthi commented 3 years ago

Fixes below warnings using pyupgrade : https://github.com/asottile/pyupgrade#invalid-escape-sequences

find . -iname '*.py' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}                   
./core/utils.py:4164: DeprecationWarning: invalid escape sequence \(
  perc = cfg.reSCP.findall('percentile\(#?(.*?)#?\)',expression)
./core/utils.py:4146: DeprecationWarning: invalid escape sequence \(
  perc = cfg.reSCP.findall('percentile\((.*?)\)',expression)
./core/utils.py:4057: DeprecationWarning: invalid escape sequence \*
  bandNums = cfg.reSCP.findall(cfg.variableBandsetName + '\*b#?(.*?)#?"', expression)
./core/utils.py:4072: DeprecationWarning: invalid escape sequence \(
  perc = cfg.reSCP.findall('percentile\(#?(.*?)#?\)',expression)
./core/utils.py:4045: DeprecationWarning: invalid escape sequence \(
  perc = cfg.reSCP.findall('percentile\(#?(.*?)#?\)',expression.replace(' ', ''))
./core/utils.py:4176: DeprecationWarning: invalid escape sequence \(
  g = cfg.reSCP.findall('nodata\(\"#?(.*?)#?\"\)',expression)
./core/utils.py:146: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if redirect is not 'No':
./maininterface/bandcalcTab.py:483: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if text is not 'No':
semiautomaticgit commented 3 years ago

Thank you very much!