Skip to content

Fix backslash escaping issues in docstrings #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

musicinmybrain
Copy link
Contributor

Escape backslashes that should be passed through to the documentation system rather than interpreted as backslash escape sequences in the Python string.

This fixes a number of SyntaxWarning instances about invalid escape sequences in Python 3.12.

An alternative would be to make these docstrings raw strings (r"""foo""").

Escape backslashes that should be passed through to the documentation
system rather than interpreted as backslash escape sequences in the
Python string.

This fixes a number of SyntaxWarning instances about invalid escape
sequences in Python 3.12.

An alternative would be to make these docstrings raw strings
(r"""foo""").
@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5e063b) 84.71% compared to head (b7a4259) 84.71%.
Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #543    +/-   ##
========================================
  Coverage   84.71%   84.71%            
========================================
  Files         297      297            
  Lines       27632    27632            
  Branches     3660     3361   -299     
========================================
  Hits        23409    23409            
  Misses       3269     3269            
  Partials      954      954            
Files Coverage Δ
nipy/algorithms/statistics/formula/formulae.py 89.87% <ø> (ø)
nipy/core/reference/coordinate_map.py 97.54% <ø> (ø)
nipy/modalities/fmri/design.py 89.75% <ø> (ø)
nipy/modalities/fmri/utils.py 100.00% <ø> (ø)
nipy/utils/perlpie.py 20.51% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DimitriPapadopoulos
Copy link
Contributor

Alternatively add r for raw string before ".

@effigies
Copy link
Member

effigies commented Nov 8, 2023

My preference would also be for raw strings.

@musicinmybrain
Copy link
Contributor Author

I’m happy to convert these docstrings to raw strings when I have a little time in front of a computer.

Exception: don’t touch doc/devel/tools/tricked_out_emacs.rst for now.
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

LGTM. Small fix in one docstring.

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies effigies merged commit a301f82 into nipy:main Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants