Skip to content

DOC: Add warning for newbs not to edit auto-generated file #10456

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

Closed
wants to merge 3 commits into from

Conversation

Garrett-R
Copy link
Contributor

@jreback, here is the proposed changed we talked about in this PR for other fellow newbs that make the same mistake I did.

You said "and more importantly prob a note in internals.rst about how/what to change", but I didn't understand that. internals.rst is not auto-generated, right? So, why would I add a note there? Perhaps you wanted a note to appear in internals.html? That seems unnecessary since if the user has that file on their machine, they must have intentionally generated it...

@shoyer
Copy link
Member

shoyer commented Jun 27, 2015

This is where internals.rst ends up in the generated docs: http://pandas.pydata.org/pandas-docs/stable/internals.html

That said, I think the warning in the generated file serves this purpose more directly. Warnings in docs tend to get ignored anyways :).

@Garrett-R
Copy link
Contributor Author

@shoyer, hmmm.. maybe I'm confused. So are you saying it would be good to have a comment in internals.html warning new devs that internals.html is auto-generated and they should edit internals.rst instead? (similar to what I just did for generated.pyx)

If that's the case, we should probably have a similar comment in all the [generated] HTML files, right?

@shoyer
Copy link
Member

shoyer commented Jun 28, 2015

@Garrett-R No, I think @jreback was thinking you could have the warning "generated.pyx is generated from make_generated.py" in the internals documentation. None of the documentation HTML pages are checked into git, so there's no danger we could get a pull request editing them directly.

HOWEVER, I actually disagree with @jreback on this one. I think the warning you have here is sufficient.

@Garrett-R
Copy link
Contributor Author

Ah, I see. Yeah, I agree with you. I think having the source code warning in generated.pyx should be enough. It's already kind of embarrassing that I didn't realize that generated.pyx was generated.

@jreback
Copy link
Contributor

jreback commented Jun 28, 2015

no the issue is that I don't think it's obvious that you need to Python generate_code.py

that instruction should live maybe in the contributing docs as well as in generated.pyx

@Garrett-R Garrett-R force-pushed the warnings_for_newbs branch 2 times, most recently from 7dae4a6 to dc8185d Compare June 28, 2015 00:40
@Garrett-R
Copy link
Contributor Author

Oh yeah, that's true, it's definitely not obvious that you need to run python2 generatre_code.py (I had to be told).

The only situation you'd ever need to know this is if you're actually trying to modify generated.pyx, so one option would be to just include it these instructions in both generated.pyx and generate_code.py (which I've now done), but not add extra noise to the contributing docs.

@Garrett-R Garrett-R force-pushed the warnings_for_newbs branch from dc8185d to cf4c3d8 Compare June 28, 2015 00:42
during building. To regenerate `generated.pyx`, just run:

`python2 generate_code.py`.

Copy link
Contributor

Choose a reason for hiding this comment

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

just say python

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You sure? Some systems now have python pointing to python3 (ex: Arch Linux) whereas I believe all systems recognize python2... and this file is not Python 3 compatible (which tripped me up a bit)...

Copy link
Member

Choose a reason for hiding this comment

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

+1 on python2.

On Sat, Jun 27, 2015 at 5:48 PM, Garrett Reynolds [email protected]
wrote:

In pandas/src/generate_code.py
#10456 (comment):

@@ -1,3 +1,10 @@
+"""This file generates generated.pyx which is then included in ../algos.pyx
+during building. To regenerate generated.pyx, just run:
+

  • python2 generate_code.py.

You sure? Some systems now have python pointing to python3 (ex: Arch
Linux) whereas I believe all systems recognize python2... and this file
is not Python 3 compatible...


Reply to this email directly or view it on GitHub
https://github.com/pydata/pandas/pull/10456/files#r33417787.

@jreback
Copy link
Contributor

jreback commented Jun 28, 2015

hmm this should be compat but I guess that's another issue

ok then on the py2

@Garrett-R
Copy link
Contributor Author

Yeah, it would be nice to have it compatible.

@jreback jreback added the Docs label Jun 28, 2015
@jreback jreback added this to the 0.17.0 milestone Jun 28, 2015
@@ -1,3 +1,10 @@
"""This file generates `generated.pyx` which is then included in `../algos.pyx`
during building. To regenerate `generated.pyx`, just run:
Copy link
Contributor

Choose a reason for hiding this comment

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

this actually has to be run from pandas/src (so that generated.pyx is in the correct place), so either we need to fix this (e.g. the output path should be relative to the pandas tree), or provide this in the instructions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I fixed it so it can now be run from anywhere.

@Garrett-R Garrett-R force-pushed the warnings_for_newbs branch from 16976ab to bde1e3a Compare June 29, 2015 03:52
# or we get a bootstrapping problem
from StringIO import StringIO
import os
from pandas.compat import StringIO
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I made it 2/3 compatible.

I didn't understand this warning here and the original commit had no more information about this. I tested this on Py2 and Py3 and it seemed to work fine...

Previously you had to run it from inside the same directory, but
it's less likely to mess up newbs if you can run it from anywhere.
@jreback
Copy link
Contributor

jreback commented Jul 7, 2015

merged via 758ca05

thanks!

@jreback jreback closed this Jul 7, 2015
@Garrett-R Garrett-R deleted the warnings_for_newbs branch July 7, 2015 17:40
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.

3 participants