NREL / gdx-pandas

Python interface to read and write GAMS GDX files using pandas.DataFrames as the intermediate data format.
BSD 3-Clause "New" or "Revised" License
43 stars 15 forks source link

Bad escape characters in paths #52

Closed jebob closed 5 years ago

jebob commented 6 years ago

In various strings, there is the path C:\GAMS, but the backslash is an escape character in python, so C:\newGAMSfolder will be rendered as

C:
ewGAMSfolder

because the \n represents a newline. Python doesn't recognize \G so throws a warning. Some ideas:

  1. Anywhere there is a C:\GAMS instead use C:\\GAMS as the double backslach then becomes a regular backslash, but this is slightly less readable.
  2. Anywhere there is a string "C:\GAMS" instead use a raw string r"C:\GAMS" which won't throw the error.