gruenewald-lab / CGsmiles

Coarse-Grained Smiles (CGsmiles) for representing abitrarily complex molecules using a compact line notation
5 stars 2 forks source link

Use raw strings in `PATTERNS` #8

Closed ricalessandri closed 7 months ago

ricalessandri commented 7 months ago

Currently, I'd get these SyntaxWarnings:

/Users/alessandri/CGsmiles/cgsmiles/read_cgsmiles.py:6: SyntaxWarning: invalid escape sequence '\['
  PATTERNS = {"bond_anchor": "\[\$.*?\]",
/Users/alessandri/CGsmiles/cgsmiles/read_cgsmiles.py:7: SyntaxWarning: invalid escape sequence '\['
  "place_holder": "\[\#.*?\]",
/Users/alessandri/CGsmiles/cgsmiles/read_cgsmiles.py:8: SyntaxWarning: invalid escape sequence '\|'
  "annotation": "\|.*?\|",
/Users/alessandri/CGsmiles/cgsmiles/resolve.py:183: SyntaxWarning: invalid escape sequence '\d'
  order = re.findall("[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?", bonding[0])

Making those raw strings fixes this.