Repository navigation
CLN: fix invalid escapes - #5361
jbrockmendel wants to merge 15 commits into
Conversation
|
@thequackdaddy ping. Let’s teamwork this mama-jama. |
|
My employer is currently rolling out company values. One of them is “Teamwork divides the task and multiplies the success.” I’m a big fan of that one. But I’m afraid of some of this. Seems some of these changes seem like they foul up the currently-working-albeit-incorrectly-typed LaTeX docstrinfs. Is there a way to have |
| "support = np.linspace(-np.pi*a, np.pi*a, 100)\n", | ||
| "andrew = norms.AndrewWave(a=a)\n", | ||
| "plot_weights(support, andrew.weights, ['$-\\pi*a$', '0', '$\\pi*a$'], [-np.pi*a, 0, np.pi*a]);" | ||
| "plot_weights(support, andrew.weights, [r'$-\\pi*a$', r'0', r'$\\pi*a$'], [-np.pi*a, 0, np.pi*a]);" |
There was a problem hiding this comment.
these line already has double backslashes
There was a problem hiding this comment.
When this gets rendered into python it is a single slash
There was a problem hiding this comment.
>>> r'$-\\pi*a$', r'0', r'$\\pi*a$'
('$-\\\\pi*a$', '0', '$\\\\pi*a$')
?
There was a problem hiding this comment.
How did you you produce this? i.e. did you copy/paste the line from the .ipynb into the REPL? Because I'm pretty sure the relevant thing to do is run the .ipynb through the script to convert it to a .py
There was a problem hiding this comment.
I copied the string r'$-\\pi*a$', r'0', r'$\\pi*a$' to an interpreter (spyder python shell).
when I copy it in a regular jupyter notebook, then I get the same.
It is a string that goes to matplotlib, so the only reliable check would be to see how the plot in the notebook looks like.
There was a problem hiding this comment.
Reverted this edit, and rebased the branch.
|
all the regular expressions need the raw string I'm not sure for some of the others and docstrings might need actual proof reading. |
|
@thequackdaddy I can respect a healthy dose of caution. This Pr grew pretty big, but I’m happy to break it into pieces of whatever size reviewers will find comfortable. Mainly I’m interested in maintaining positive makes momentum. |
|
#5353 might be more regex-heavy (and much smaller). Lucky thing things like this don’t need deep knowledge of statsmodels, so any of the many talented, attractive contributors are qualified to review. |
|
one unclear to me: I think the latex in docstrings should be standardized to |
|
Pandas docs/ dir is currently failing linting. Does that help explain anything? |
|
Are we planning on fixing these at some point? |
|
yes, but not this week |
Yikes. I'm going to choose to believe that the old ones were lost in a truly epic ninja battle in which you single handedly kept the world safe for democracy. (also, delegation is a thing) |
|
I checked the python 3.7 documentation and the treatment of escape characters has not changed, AFAICS. I just checked the current sphinx documentation for devel: |
Codecov Report
@@ Coverage Diff @@
## master #5361 +/- ##
==========================================
- Coverage 81.73% 81.66% -0.07%
==========================================
Files 569 569
Lines 89809 89770 -39
Branches 10027 9304 -723
==========================================
- Hits 73401 73312 -89
- Misses 14132 14177 +45
- Partials 2276 2281 +5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #5361 +/- ##
==========================================
- Coverage 82.02% 81.75% -0.28%
==========================================
Files 588 569 -19
Lines 93026 89851 -3175
Branches 10313 10022 -291
==========================================
- Hits 76307 73455 -2852
+ Misses 14357 14126 -231
+ Partials 2362 2270 -92
Continue to review full report at Codecov.
|
|
rebased |
|
rebased |
Some of these I recognize as having fixed before; let's finally get this over with and stop seeing DeprecationWarnings.
Zillions of unfixed ones in statsmodels/examples, most of them of the form "C:[username]..."