Skip to content

fix DeprecationWarning about invalid escape characters#856

Merged
dwhswenson merged 3 commits into
openpathsampling:masterfrom
sroet:fix_dep_warning
Sep 25, 2019
Merged

fix DeprecationWarning about invalid escape characters#856
dwhswenson merged 3 commits into
openpathsampling:masterfrom
sroet:fix_dep_warning

Conversation

@sroet

@sroet sroet commented Sep 23, 2019

Copy link
Copy Markdown
Member

This morning, running py.test with python 3.7. Spat out these DeprecationWarnings:

openpathsampling/collectivevariable.py:205
  /home/sander/github_files/openpathsampling/openpathsampling/collectivevariable.py:205: DeprecationWarning: invalid escape sequence \*
    """

openpathsampling/collectivevariable.py:396
  /home/sander/github_files/openpathsampling/openpathsampling/collectivevariable.py:396: DeprecationWarning: invalid escape sequence \*
    """

openpathsampling/collectivevariable.py:461
  /home/sander/github_files/openpathsampling/openpathsampling/collectivevariable.py:461: DeprecationWarning: invalid escape sequence \*
    """

openpathsampling/collectivevariable.py:627
  /home/sander/github_files/openpathsampling/openpathsampling/collectivevariable.py:627: DeprecationWarning: invalid escape sequence \*
    """

openpathsampling/collectivevariable.py:715
  /home/sander/github_files/openpathsampling/openpathsampling/collectivevariable.py:715: DeprecationWarning: invalid escape sequence \*
    """

Looking at SO it seems due to python 3 reading it as Unicode characters instead of a raw string.

This might break doc building, but did not have thad time yet to look at that

@dwhswenson

Copy link
Copy Markdown
Member

The addition of the backslashes was to fix problems when building docs in sphinx. I noticed that most of these are in single backticks; that's incorrect rst (correct Markdown). Maybe switch those to the double backticks that rst uses? Please do build docs (just make html in the docs and then make sure that they look right (files in docs/_build/html).

@sroet

sroet commented Sep 23, 2019

Copy link
Copy Markdown
Member Author

Alright, python3 does not give DeprecationWarnings anymore, and the docs look the same as the current version on the website, when build with python2 and python3.
Also fixed a couple small typo's I found. PLease have a look

@dwhswenson

Copy link
Copy Markdown
Member

By this:

Maybe switch those to the double backticks that rst uses?

I meant that the way it looks now is wrong. The stuff in italics should be in monospace font. This is old stuff in OPS; we never fixed some old docs, and were writing more like Markdown than RST.

As long as your working on these sections, do you mind switching them to double-backticks, so they correctly render as monospace font?

The rest looks good to me!

@sroet

sroet commented Sep 24, 2019

Copy link
Copy Markdown
Member Author

As long as your working on these sections, do you mind switching them to double-backticks, so they correctly render as monospace font?

sure, done

@dwhswenson dwhswenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dwhswenson dwhswenson merged commit bd3ea06 into openpathsampling:master Sep 25, 2019
@sroet sroet deleted the fix_dep_warning branch September 25, 2019 07:30
This was referenced Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants