Skip to content

Commit a8cb734

Browse files
author
Andrew Burrows
committed
Merge commit 'tags/v0.13.0' into AHLMSS
Conflicts: pandas/tseries/tests/test_timezones.py
2 parents d5c0b20 + a5410ed commit a8cb734

File tree

212 files changed

+13694
-5295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+13694
-5295
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ pandas/io/*.json
3838
.pydevproject
3939
.settings
4040
.idea
41+
*.pdb

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ script:
4848

4949
after_script:
5050
- ci/print_versions.py
51+
- ci/print_skipped.py /tmp/nosetests.xml

CONTRIBUTING.md

Lines changed: 33 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,38 @@ All contributions, bug reports, bug fixes, documentation improvements,
44
enhancements and ideas are welcome.
55

66
The [GitHub "issues" tab](https://github.com/pydata/pandas/issues)
7-
contains some issues labeled "Good as first PR"; these are
8-
tasks which do not require deep knowledge of the package. Look those up if you're
7+
contains some issues labeled "Good as first PR"; Look those up if you're
98
looking for a quick way to help out.
109

11-
Please try and follow these guidelines, as this makes it easier for us to accept
12-
your contribution or address the issue you're having.
13-
1410
#### Bug Reports
1511

1612
- Please include a short, self-contained Python snippet reproducing the problem.
1713
You can have the code formatted nicely by using [GitHub Flavored Markdown](http://github.github.com/github-flavored-markdown/) :
1814

1915
```python
20-
16+
2117
print("I ♥ pandas!")
2218

2319
```
2420

25-
- A [test case](https://github.com/pydata/pandas/tree/master/pandas/tests) may be more helpful.
26-
- Specify the pandas (and NumPy) version used. (check `pandas.__version__`
27-
and `numpy.__version__`)
28-
- Explain what the expected behavior was, and what you saw instead.
29-
- If the issue seems to involve some of [pandas' dependencies](https://github.com/pydata/pandas#dependencies)
30-
such as
31-
[NumPy](http://numpy.org),
32-
[matplotlib](http://matplotlib.org/), and
33-
[PyTables](http://www.pytables.org/)
34-
you should include (the relevant parts of) the output of
21+
- Specify the pandas version used and those of it's dependencies. You can simply include the output of
3522
[`ci/print_versions.py`](https://github.com/pydata/pandas/blob/master/ci/print_versions.py).
23+
- Explain what the expected behavior was, and what you saw instead.
3624

3725
#### Pull Requests
3826

39-
- **Make sure the test suite passes** for both python2 and python3.
40-
You can use `test_fast.sh`, **tox** locally, and/or enable **Travis-CI** on your fork.
41-
See "Getting Travis-CI going" below.
27+
- **Make sure the test suite passes** on your box, Use the provided `test_*.sh` scripts or tox.
28+
- Use [proper commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html):
29+
- a subject line with `< 80` chars.
30+
- One blank line.
31+
- Optionally, a commit message body.
32+
- Please reference relevant Github issues in your commit message using `GH1234`
33+
or `#1234`. Either style is fine but the '#' style generates nose when your rebase your PR.
34+
- `doc/source/release.rst` and `doc/source/vx.y.z.txt` contain an ongoing
35+
changelog for each release. Add entries to these files
36+
as needed in a separate commit in your PR: document the fix, enhancement,
37+
or (unavoidable) breaking change.
38+
- Keep style fixes to a separate commit to make your PR more readable.
4239
- An informal commit message format is in effect for the project. Please try
4340
and adhere to it. Check `git log` for examples. Here are some common prefixes
4441
along with general guidelines for when to use them:
@@ -49,119 +46,31 @@ your contribution or address the issue you're having.
4946
- **BLD**: Updates to the build process/scripts
5047
- **PERF**: Performance improvement
5148
- **CLN**: Code cleanup
52-
- Commit messages should have:
53-
- a subject line with `< 80` chars
54-
- one blank line
55-
- a commit message body, if there's a need for one
56-
- If you are changing any code, you should enable Travis-CI on your fork
57-
to make it easier for the team to see that the PR does indeed pass all the tests.
58-
- **Backward-compatibility really matters**. Pandas already has a large user base and
59-
a lot of existing user code.
60-
- Don't break old code if you can avoid it.
61-
- If there is a need, explain it in the PR.
62-
- Changes to method signatures should be made in a way which doesn't break existing
63-
code. For example, you should beware of changes to ordering and naming of keyword
64-
arguments.
49+
- Maintain backward-compatibility. Pandas has lots of users with lots of existing code. Don't break it.
50+
- If you think breakage is required clearly state why as part of the PR.
51+
- Be careful when changing method signatures.
6552
- Add deprecation warnings where needed.
66-
- Performance matters. You can use the included `test_perf.sh`
67-
script to make sure your PR does not introduce any new performance regressions
68-
in the library.
53+
- Performance matters. Make sure your PR hasn't introduced perf regressions by using `test_perf.sh`.
6954
- Docstrings follow the [numpydoc](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt) format.
70-
- **Don't** merge upstream into a branch you're going to submit as a PR.
71-
This can create all sorts of problems. Use `git rebase` instead. This ensures
72-
no merge conflicts occur when your code is merged by the core team.
73-
- Please reference the GH issue number in your commit message using `GH1234`
74-
or `#1234`. Either style is fine.
75-
- Use `raise AssertionError` rather then plain `assert` in library code (`assert` is fine
76-
for test code). `python -o` strips assertions. Better safe than sorry.
77-
- When writing tests, don't use "new" assertion methods added to the `unittest` module
78-
in 2.7 since pandas currently supports 2.6. The most common pitfall is:
79-
80-
with self.assertRaises(ValueError):
81-
foo
82-
83-
84-
which fails with Python 2.6. You need to use `assertRaises` from
85-
`pandas.util.testing` instead (or use `self.assertRaises(TheException,func,args)`).
86-
87-
- `doc/source/release.rst` and `doc/source/vx.y.z.txt` contain an ongoing
88-
changelog for each release. Add entries to these files
89-
as needed in a separate commit in your PR: document the fix, enhancement,
90-
or (unavoidable) breaking change.
91-
- For extra brownie points, use `git rebase -i` to squash and reorder
92-
commits in your PR so that the history makes the most sense. Use your own
93-
judgment to decide what history needs to be preserved.
94-
- Pandas source code should not -- with some exceptions, such as 3rd party licensed code --
95-
generally speaking, include an "Authors" list or attribution to individuals in source code.
96-
`RELEASE.rst` details changes and enhancements to the code over time.
97-
A "thanks goes to @JohnSmith." as part of the appropriate entry is a suitable way to acknowledge
98-
contributions. The rest is `git blame`/`git log`.
99-
Feel free to ask the commiter who merges your code to include such an entry
100-
or include it directly yourself as part of the PR if you'd like to.
101-
**We're always glad to have new contributors join us from the ever-growing pandas community.**
102-
You may also be interested in the copyright policy as detailed in the pandas [LICENSE](https://github.com/pydata/pandas/blob/master/LICENSE).
55+
- When writing tests, use 2.6 compatible `self.assertFoo` methods. Some polyfills such as `assertRaises`
56+
can be found in `pandas.util.testing`.
57+
- Generally, pandas source files should not contain attributions. You can include a "thanks to..."
58+
in the release changelog. The rest is `git blame`/`git log`.
59+
- When you start working on a PR, start by creating a new branch pointing at the latest
60+
commit on github master.
61+
- **Do not** merge upstream into a branch you're going to submit as a PR.
62+
Use `git rebase` against the current github master.
63+
- For extra brownie points, you can squash and reorder the commits in your PR using `git rebase -i`.
64+
Use your own judgment to decide what history needs to be preserved. If git frightens you, that's OK too.
65+
- Use `raise AssertionError` over `assert` unless you want the assertion stripped by `python -o`.
66+
- The pandas copyright policy is detailed in the pandas [LICENSE](https://github.com/pydata/pandas/blob/master/LICENSE).
10367
- On the subject of [PEP8](http://www.python.org/dev/peps/pep-0008/): yes.
104-
- On the subject of massive PEP8 fix PRs touching everything, please consider the following:
105-
- They create noisy merge conflicts for people working in their own fork.
106-
- They make `git blame` less effective.
107-
- Different tools / people achieve PEP8 in different styles. This can create
108-
"style wars" and churn that produces little real benefit.
109-
- If your code changes are intermixed with style fixes, they are harder to review
110-
before merging. Keep style fixes in separate commits.
111-
- It's fine to clean-up a little around an area you just worked on.
112-
- Generally it's a BAD idea to PEP8 on documentation.
113-
114-
Having said that, if you still feel a PEP8 storm is in order, go for it.
68+
- On the subject of a massive PEP8-storm touching everything: not too often (once per release works).
11569

11670
### Notes on plotting function conventions
11771

11872
https://groups.google.com/forum/#!topic/pystatsmodels/biNlCvJPNNY/discussion
11973

120-
### Getting Travis-CI going
121-
122-
Instructions for getting Travis-CI installed are available [here](http://about.travis-ci.org/docs/user/getting-started/).
123-
For those users who are new to Travis-CI and [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) in particular,
124-
Here's a few high-level notes:
125-
- Travis-CI is a free service (with premium account upgrades available) that integrates
126-
well with GitHub.
127-
- Enabling Travis-CI on your GitHub fork of a project will cause any *new* commit
128-
pushed to the repo to trigger a full build+test on Travis-CI's servers.
129-
- All the configuration for Travis-CI builds is already specified by `.travis.yml` in the repo.
130-
That means all you have to do is enable Travis-CI once, and then just push commits
131-
and you'll get full testing across py2/3 with pandas' considerable
132-
[test-suite](https://github.com/pydata/pandas/tree/master/pandas/tests).
133-
- Enabling Travis-CI will attach the test results (red/green) to the Pull-Request
134-
page for any PR you submit. For example:
135-
136-
https://github.com/pydata/pandas/pull/2532,
137-
138-
See the Green "Good to merge!" banner? that's it.
139-
140-
This is especially important for new contributors, as members of the pandas dev team
141-
like to know that the test suite passes before considering it for merging.
142-
Even regular contributors who test religiously on their local box (using tox
143-
for example) often rely on a PR+travis=green to make double sure everything
144-
works ok on another system, as occasionally, it doesn't.
145-
146-
#### Steps to enable Travis-CI
147-
148-
- Open https://travis-ci.org/
149-
- Select "Sign in with GitHub" (Top Navbar)
150-
- Select \[your username\] -> "Accounts" (Top Navbar)
151-
- Select 'Sync now' to refresh the list of repos from your GH account.
152-
- Flip the switch for the repos you want Travis-CI enabled for.
153-
"pandas", obviously.
154-
- Then, pushing a *new* commit to a certain branch on that repo
155-
will trigger a build/test for that branch. For example, the branch
156-
might be `master` or `PR1234_fix_everything__atomically`, if that's the
157-
name of your PR branch.
158-
159-
You can see the build history and current builds for your fork
160-
at: https://travis-ci.org/(your_GH_username)/pandas.
161-
162-
For example, the builds for the main pandas repo can be seen at:
163-
https://travis-ci.org/pydata/pandas.
164-
16574
####More developer docs
16675

16776
* See the [developers](http://pandas.pydata.org/developers.html) page on the

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ include MANIFEST.in
22
include LICENSE
33
include RELEASE.md
44
include README.rst
5-
include TODO.rst
65
include setup.py
7-
include setupegg.py
86

97
graft doc
108
prune doc/build

ci/install.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
5555
time sudo locale-gen "$LOCALE_OVERRIDE"
5656
fi
5757

58-
# show-skipped is working at this particular commit
59-
show_skipped_commit=fa4ff84e53c09247753a155b428c1bf2c69cb6c3
60-
time pip install git+git://github.com/cpcloud/nose-show-skipped.git@$show_skipped_commit
6158
time pip install $PIP_ARGS -r ci/requirements-${wheel_box}.txt
6259

6360
# we need these for numpy

ci/print_skipped.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
import math
5+
import xml.etree.ElementTree as et
6+
7+
8+
def parse_results(filename):
9+
tree = et.parse(filename)
10+
root = tree.getroot()
11+
skipped = []
12+
13+
current_class = old_class = ''
14+
i = 1
15+
assert i - 1 == len(skipped)
16+
for el in root.findall('testcase'):
17+
cn = el.attrib['classname']
18+
for sk in el.findall('skipped'):
19+
old_class = current_class
20+
current_class = cn
21+
name = '{classname}.{name}'.format(classname=current_class,
22+
name=el.attrib['name'])
23+
msg = sk.attrib['message']
24+
out = ''
25+
if old_class != current_class:
26+
ndigits = int(math.log(i, 10) + 1)
27+
out += ('-' * (len(name + msg) + 4 + ndigits) + '\n') # 4 for : + space + # + space
28+
out += '#{i} {name}: {msg}'.format(i=i, name=name, msg=msg)
29+
skipped.append(out)
30+
i += 1
31+
assert i - 1 == len(skipped)
32+
assert i - 1 == len(skipped)
33+
assert len(skipped) == int(root.attrib['skip'])
34+
return '\n'.join(skipped)
35+
36+
37+
def main(args):
38+
print('SKIPPED TESTS:')
39+
print(parse_results(args.filename))
40+
return 0
41+
42+
43+
def parse_args():
44+
import argparse
45+
parser = argparse.ArgumentParser()
46+
parser.add_argument('filename', help='XUnit file to parse')
47+
return parser.parse_args()
48+
49+
50+
if __name__ == '__main__':
51+
sys.exit(main(parse_args()))

ci/print_versions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33

44
def show_versions():
5-
import subprocess
5+
import imp
66
import os
77
fn = __file__
88
this_dir = os.path.dirname(fn)
9-
pandas_dir = os.path.dirname(this_dir)
10-
sv_path = os.path.join(pandas_dir, 'pandas', 'util',
11-
'print_versions.py')
12-
return subprocess.check_call(['python', sv_path])
9+
pandas_dir = os.path.abspath(os.path.join(this_dir,".."))
10+
sv_path = os.path.join(pandas_dir, 'pandas','util')
11+
mod = imp.load_module('pvmod', *imp.find_module('print_versions', [sv_path]))
12+
return mod.show_versions()
1313

1414

1515
if __name__ == '__main__':

ci/requirements-2.6.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ python-dateutil==1.5
44
pytz==2013b
55
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.2/beautifulsoup4-4.2.0.tar.gz
66
html5lib==1.0b2
7-
bigquery==2.0.15
7+
bigquery==2.0.17

ci/requirements-2.7.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
python-dateutil==2.1
22
pytz==2013b
33
xlwt==0.7.5
4-
numpy==1.7.1
4+
numpy==1.8.0
55
cython==0.19.1
66
bottleneck==0.6.0
77
numexpr==2.1
88
tables==2.3.1
99
matplotlib==1.1.1
1010
openpyxl==1.6.2
11-
xlsxwriter==0.4.3
11+
xlsxwriter==0.4.6
1212
xlrd==0.9.2
1313
patsy==0.1.0
1414
html5lib==1.0b2
@@ -18,4 +18,4 @@ MySQL-python==1.2.4
1818
scipy==0.10.0
1919
beautifulsoup4==4.2.1
2020
statsmodels==0.5.0
21-
bigquery==2.0.15
21+
bigquery==2.0.17

ci/requirements-2.7_LOCALE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ python-dateutil
22
pytz==2013b
33
xlwt==0.7.5
44
openpyxl==1.6.2
5-
xlsxwriter==0.4.3
5+
xlsxwriter==0.4.6
66
xlrd==0.9.2
77
numpy==1.6.1
88
cython==0.19.1
@@ -16,4 +16,4 @@ lxml==3.2.1
1616
scipy==0.10.0
1717
beautifulsoup4==4.2.1
1818
statsmodels==0.5.0
19-
bigquery==2.0.15
19+
bigquery==2.0.17

ci/requirements-3.2.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
python-dateutil==2.1
22
pytz==2013b
33
openpyxl==1.6.2
4-
xlsxwriter==0.4.3
4+
xlsxwriter==0.4.6
55
xlrd==0.9.2
6-
numpy==1.6.2
6+
numpy==1.7.1
77
cython==0.19.1
88
numexpr==2.1
99
tables==3.0.0

ci/requirements-3.3.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
python-dateutil==2.1
1+
python-dateutil==2.2
22
pytz==2013b
33
openpyxl==1.6.2
4-
xlsxwriter==0.4.3
4+
xlsxwriter==0.4.6
55
xlrd==0.9.2
66
html5lib==1.0b2
7-
numpy==1.7.1
7+
numpy==1.8.0
88
cython==0.19.1
99
numexpr==2.1
1010
tables==3.0.0

ci/script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
99
python -c "$pycmd"
1010
fi
1111

12-
echo nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --show-skipped
13-
nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --show-skipped
12+
echo nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
13+
nosetests --exe -w /tmp -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml

doc/make.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ def upload_prev(ver, doc_root='./'):
7272
if os.system(pdf_cmd):
7373
raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))
7474

75-
75+
def build_pandas():
76+
os.chdir('..')
77+
os.system('python setup.py clean')
78+
os.system('python setup.py build_ext --inplace')
79+
os.chdir('doc')
80+
7681
def build_prev(ver):
7782
if os.system('git checkout v%s' % ver) != 1:
7883
os.chdir('..')
@@ -238,6 +243,7 @@ def _get_config():
238243
'clean': clean,
239244
'auto_dev': auto_dev_build,
240245
'auto_debug': lambda: auto_dev_build(True),
246+
'build_pandas': build_pandas,
241247
'all': all,
242248
}
243249

0 commit comments

Comments
 (0)