Skip to content

Commit ef9c42d

Browse files
committed
DOC: Add warning for newbs not to edit auto-generated file
1 parent 01995b2 commit ef9c42d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pandas/src/generate_code.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""This file generates `generated.pyx` which is then included in `../algos.pyx`
2+
during building. To regenerate `generated.pyx`, just run:
3+
4+
`python2 generate_code.py`.
5+
6+
"""
7+
18
from __future__ import print_function
29
# we only need to be able to run this file on 2.7
310
# don't introduce a pandas/pandas.compat import
@@ -7,6 +14,12 @@
714

815
_int64_max = np.iinfo(np.int64).max
916

17+
warning_to_new_contributors = """
18+
# DO NOT EDIT THIS FILE: This file was autogenerated from generate_code.py, so
19+
# please edit that file and then run `python2 generate_code.py` to re-generate
20+
# this file.
21+
"""
22+
1023
header = """
1124
cimport numpy as np
1225
cimport cython
@@ -2528,6 +2541,7 @@ def generate_from_template(template, exclude=None):
25282541

25292542
def generate_take_cython_file(path='generated.pyx'):
25302543
with open(path, 'w') as f:
2544+
print(warning_to_new_contributors, file=f)
25312545
print(header, file=f)
25322546

25332547
print(generate_ensure_dtypes(), file=f)

pandas/src/generated.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
# DO NOT EDIT THIS FILE: This file was autogenerated from generate_code.py, so
3+
# please edit that file and then run `python2 generate_code.py` to re-generate
4+
# this file.
5+
6+
27
cimport numpy as np
38
cimport cython
49

0 commit comments

Comments
 (0)