@@ -176,7 +176,7 @@ If you are on Windows, then you will also need to install the compiler linkages:
176
176
177
177
This will create the new environment, and not touch any of your existing environments,
178
178
nor any existing python installation. It will install all of the basic dependencies of
179
- *pandas *, as well as the development and testing tools. If you would like to install
179
+ *pandas *, as well as the development and testing tools. If you would like to install
180
180
other dependencies, you can install them as follows::
181
181
182
182
conda install -n pandas_dev -c pandas pytables scipy
@@ -294,7 +294,7 @@ Some other important things to know about the docs:
294
294
In [2]: x**3
295
295
Out[2]: 8
296
296
297
- Almost all code examples in the docs are run (and the output saved) during the
297
+ Almost all code examples in the docs are run (and the output saved) during the
298
298
doc build. This approach means that code examples will always be up to date,
299
299
but it does make the doc building a bit more complex.
300
300
@@ -337,7 +337,7 @@ Furthermore, it is recommended to have all `optional dependencies
337
337
<http://pandas.pydata.org/pandas-docs/dev/install.html#optional-dependencies> `_
338
338
installed. This is not strictly necessary, but be aware that you will see some error
339
339
messages when building the docs. This happens because all the code in the documentation
340
- is executed during the doc build, and so code examples using optional dependencies
340
+ is executed during the doc build, and so code examples using optional dependencies
341
341
will generate errors. Run ``pd.show_versions() `` to get an overview of the installed
342
342
version of all dependencies.
343
343
@@ -357,7 +357,7 @@ So how do you build the docs? Navigate to your local
357
357
Then you can find the HTML output in the folder ``pandas/doc/build/html/ ``.
358
358
359
359
The first time you build the docs, it will take quite a while because it has to run
360
- all the code examples and build all the generated docstring pages. In subsequent
360
+ all the code examples and build all the generated docstring pages. In subsequent
361
361
evocations, sphinx will try to only build the pages that have been modified.
362
362
363
363
If you want to do a full clean build, do::
@@ -368,7 +368,7 @@ If you want to do a full clean build, do::
368
368
Starting with *pandas * 0.13.1 you can tell ``make.py `` to compile only a single section
369
369
of the docs, greatly reducing the turn-around time for checking your changes.
370
370
You will be prompted to delete ``.rst `` files that aren't required. This is okay because
371
- the prior versions of these files can be checked out from git. However, you must make sure
371
+ the prior versions of these files can be checked out from git. However, you must make sure
372
372
not to commit the file deletions to your Git repository!
373
373
374
374
::
@@ -396,7 +396,7 @@ And you'll have the satisfaction of seeing your new and improved documentation!
396
396
Building master branch documentation
397
397
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398
398
399
- When pull requests are merged into the *pandas * ``master `` branch, the main parts of
399
+ When pull requests are merged into the *pandas * ``master `` branch, the main parts of
400
400
the documentation are also built by Travis-CI. These docs are then hosted `here
401
401
<http://pandas-docs.github.io/pandas-docs-travis> `__.
402
402
@@ -410,30 +410,41 @@ Code standards
410
410
--------------
411
411
412
412
*pandas * uses the `PEP8 <http://www.python.org/dev/peps/pep-0008/ >`_ standard.
413
- There are several tools to ensure you abide by this standard.
413
+ There are several tools to ensure you abide by this standard. Here are *some * of
414
+ the more common ``PEP8 `` issues:
414
415
415
- We've written a tool to check that your commits are PEP8 great, `pip install pep8radius
416
+ - we restrict line-length to 80 characters to promote readability
417
+ - passing arguments should have spaces after commas, e.g. ``foo(arg1, arg2, kw1='bar') ``
418
+
419
+ The Travis-CI will run `flake8 <http://pypi.python.org/pypi/flake8 >`_ tool and report
420
+ any stylistic errors in your code. Generating any warnings will cause the build to fail;
421
+ thus these are part of the requirements for submitting code to *pandas *.
422
+
423
+ It is helpful before submitting code to run this yourself on the diff::
424
+
425
+ git diff master | flake8 --diff
426
+
427
+ Furthermore, we've written a tool to check that your commits are PEP8 great, `pip install pep8radius
416
428
<https://github.com/hayd/pep8radius> `_. Look at PEP8 fixes in your branch vs master with::
417
429
418
- pep8radius master --diff
430
+ pep8radius master --diff
419
431
420
432
and make these changes with::
421
433
422
434
pep8radius master --diff --in-place
423
435
424
- Alternatively, use the `flake8 <http://pypi.python.org/pypi/flake8 >`_ tool for checking
425
- the style of your code. Additional standards are outlined on the `code style wiki
436
+ Additional standards are outlined on the `code style wiki
426
437
page <https://github.com/pydata/pandas/wiki/Code-Style-and-Conventions> `_.
427
438
428
- Please try to maintain backward compatibility. *pandas * has lots of users with lots of
439
+ Please try to maintain backward compatibility. *pandas * has lots of users with lots of
429
440
existing code, so don't break it if at all possible. If you think breakage is required,
430
441
clearly state why as part of the pull request. Also, be careful when changing method
431
442
signatures and add deprecation warnings where needed.
432
443
433
444
Test-driven development/code writing
434
445
------------------------------------
435
446
436
- *pandas * is serious about testing and strongly encourages contributors to embrace
447
+ *pandas * is serious about testing and strongly encourages contributors to embrace
437
448
`test-driven development (TDD) <http://en.wikipedia.org/wiki/Test-driven_development >`_.
438
449
This development process "relies on the repetition of a very short development cycle:
439
450
first the developer writes an (initially failing) automated test case that defines a desired
@@ -556,7 +567,7 @@ It can also be useful to run tests in your current environment. You can simply d
556
567
557
568
This command is equivalent to::
558
569
559
- asv run --quick --show-stderr --python=same
570
+ asv run --quick --show-stderr --python=same
560
571
561
572
This will launch every test only once, display stderr from the benchmarks, and use your local ``python `` that comes from your ``$PATH ``.
562
573
@@ -680,7 +691,7 @@ To squash to the master branch do::
680
691
Use the ``s `` option on a commit to ``squash ``, meaning to keep the commit messages,
681
692
or ``f `` to ``fixup ``, meaning to merge the commit messages.
682
693
683
- Then you will need to push the branch (see below) forcefully to replace the current
694
+ Then you will need to push the branch (see below) forcefully to replace the current
684
695
commits with the new ones::
685
696
686
697
git push origin shiny-new-feature -f
@@ -714,8 +725,8 @@ Review your code
714
725
----------------
715
726
716
727
When you're ready to ask for a code review, file a pull request. Before you do, once
717
- again make sure that you have followed all the guidelines outlined in this document
718
- regarding code style, tests, performance tests, and documentation. You should also
728
+ again make sure that you have followed all the guidelines outlined in this document
729
+ regarding code style, tests, performance tests, and documentation. You should also
719
730
double check your branch changes against the branch it was based on:
720
731
721
732
#. Navigate to your repository on GitHub -- https://github.com/your-user-name/pandas
@@ -735,7 +746,7 @@ release. To submit a pull request:
735
746
736
747
#. Navigate to your repository on GitHub
737
748
#. Click on the ``Pull Request `` button
738
- #. You can then click on ``Commits `` and ``Files Changed `` to make sure everything looks
749
+ #. You can then click on ``Commits `` and ``Files Changed `` to make sure everything looks
739
750
okay one last time
740
751
#. Write a description of your changes in the ``Preview Discussion `` tab
741
752
#. Click ``Send Pull Request ``.
@@ -747,14 +758,14 @@ updated. Pushing them to GitHub again is done by::
747
758
748
759
git push -f origin shiny-new-feature
749
760
750
- This will automatically update your pull request with the latest code and restart the
761
+ This will automatically update your pull request with the latest code and restart the
751
762
Travis-CI tests.
752
763
753
764
Delete your merged branch (optional)
754
765
------------------------------------
755
766
756
767
Once your feature branch is accepted into upstream, you'll probably want to get rid of
757
- the branch. First, merge upstream master into your branch so git knows it is safe to
768
+ the branch. First, merge upstream master into your branch so git knows it is safe to
758
769
delete your branch::
759
770
760
771
git fetch upstream
0 commit comments