Skip to content

Commit 48f1e76

Browse files
authored
Merge branch 'master' into fix-some-PeriodIndex-resampling-issues
2 parents 5f8ba79 + a6fcec6 commit 48f1e76

File tree

130 files changed

+1965
-745
lines changed

Some content is hidden

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

130 files changed

+1965
-745
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*$
88
*.bak
99
*flymake*
10+
*.iml
1011
*.kdev4
1112
*.log
1213
*.swp

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ cache:
1616

1717
env:
1818
global:
19-
20-
# pandas-docs-travis GH
21-
- secure: "YvvTc+FrSYHgdxqoxn9s8VOaCWjvZzlkaf6k55kkmQqCYR9dPiLMsot1F96/N7o3YlD1s0znPQCak93Du8HHi/8809zAXloTaMSZrWz4R4qn96xlZFRE88O/w/Z1t3VVYpKX3MHlCggBc8MtXrqmvWKJMAqXyysZ4TTzoiJDPvE="
19+
# create a github personal access token
20+
# cd pandas-dev/pandas
21+
# travis encrypt 'PANDAS_GH_TOKEN=personal_access_token' -r pandas-dev/pandas
22+
- secure: "EkWLZhbrp/mXJOx38CHjs7BnjXafsqHtwxPQrqWy457VDFWhIY1DMnIR/lOWG+a20Qv52sCsFtiZEmMfUjf0pLGXOqurdxbYBGJ7/ikFLk9yV2rDwiArUlVM9bWFnFxHvdz9zewBH55WurrY4ShZWyV+x2dWjjceWG5VpWeI6sA="
2223

2324
git:
2425
# for cloning
@@ -123,7 +124,7 @@ after_success:
123124

124125
after_script:
125126
- echo "after_script start"
126-
- source activate pandas && python -c "import pandas; pandas.show_versions();"
127+
- source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
127128
- if [ -e /tmp/single.xml ]; then
128129
ci/print_skipped.py /tmp/single.xml;
129130
fi

asv_bench/benchmarks/indexing.py

+31-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def time_getitem_list_like(self):
1919
def time_getitem_array(self):
2020
self.s[np.arange(10000)]
2121

22+
def time_getitem_lists(self):
23+
self.s[np.arange(10000).tolist()]
24+
2225
def time_iloc_array(self):
2326
self.s.iloc[np.arange(10000)]
2427

@@ -190,9 +193,15 @@ def setup(self):
190193
np.arange(1000)], names=['one', 'two'])
191194

192195
import string
193-
self.mistring = MultiIndex.from_product(
194-
[np.arange(1000),
195-
np.arange(20), list(string.ascii_letters)],
196+
197+
self.mi_large = MultiIndex.from_product(
198+
[np.arange(1000), np.arange(20), list(string.ascii_letters)],
199+
names=['one', 'two', 'three'])
200+
self.mi_med = MultiIndex.from_product(
201+
[np.arange(1000), np.arange(10), list('A')],
202+
names=['one', 'two', 'three'])
203+
self.mi_small = MultiIndex.from_product(
204+
[np.arange(100), list('A'), list('A')],
196205
names=['one', 'two', 'three'])
197206

198207
def time_series_xs_mi_ix(self):
@@ -215,8 +224,26 @@ def time_multiindex_get_indexer(self):
215224
(0, 16), (0, 17), (0, 18),
216225
(0, 19)], dtype=object))
217226

227+
def time_multiindex_large_get_loc(self):
228+
self.mi_large.get_loc((999, 19, 'Z'))
229+
230+
def time_multiindex_large_get_loc_warm(self):
231+
for _ in range(1000):
232+
self.mi_large.get_loc((999, 19, 'Z'))
233+
234+
def time_multiindex_med_get_loc(self):
235+
self.mi_med.get_loc((999, 9, 'A'))
236+
237+
def time_multiindex_med_get_loc_warm(self):
238+
for _ in range(1000):
239+
self.mi_med.get_loc((999, 9, 'A'))
240+
218241
def time_multiindex_string_get_loc(self):
219-
self.mistring.get_loc((999, 19, 'Z'))
242+
self.mi_small.get_loc((99, 'A', 'A'))
243+
244+
def time_multiindex_small_get_loc_warm(self):
245+
for _ in range(1000):
246+
self.mi_small.get_loc((99, 'A', 'A'))
220247

221248
def time_is_monotonic(self):
222249
self.miint.is_monotonic

asv_bench/benchmarks/series_methods.py

+11
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def setup(self):
111111
def time_series_dropna_int64(self):
112112
self.s.dropna()
113113

114+
114115
class series_dropna_datetime(object):
115116
goal_time = 0.2
116117

@@ -120,3 +121,13 @@ def setup(self):
120121

121122
def time_series_dropna_datetime(self):
122123
self.s.dropna()
124+
125+
126+
class series_clip(object):
127+
goal_time = 0.2
128+
129+
def setup(self):
130+
self.s = pd.Series(np.random.randn(50))
131+
132+
def time_series_dropna_datetime(self):
133+
self.s.clip(0, 1)

ci/build_docs.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ if [ "$DOC" ]; then
4040
cd /tmp/doc/build/html
4141
git config --global user.email "[email protected]"
4242
git config --global user.name "pandas-docs-bot"
43-
git config --global credential.helper cache
4443

4544
# create the repo
4645
git init
46+
4747
touch README
4848
git add README
4949
git commit -m "Initial commit" --allow-empty
@@ -52,8 +52,12 @@ if [ "$DOC" ]; then
5252
touch .nojekyll
5353
git add --all .
5454
git commit -m "Version" --allow-empty
55+
5556
git remote remove origin
56-
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-docs/pandas-docs-travis.git"
57+
git remote add origin "https://${PANDAS_GH_TOKEN}@github.com/pandas-dev/pandas-docs-travis.git"
58+
git fetch origin
59+
git remote -v
60+
5761
git push origin gh-pages -f
5862
fi
5963

ci/install_travis.sh

+16-11
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,7 @@ if [ "$COVERAGE" ]; then
119119
fi
120120

121121
echo
122-
if [ "$BUILD_TEST" ]; then
123-
124-
# build & install testing
125-
echo ["Starting installation test."]
126-
bash ci/install_release_build.sh
127-
conda uninstall -y cython
128-
time pip install dist/*tar.gz || exit 1
129-
130-
else
122+
if [ -z "$BUILD_TEST" ]; then
131123

132124
# build but don't install
133125
echo "[build em]"
@@ -163,9 +155,22 @@ fi
163155
# w/o removing anything else
164156
echo
165157
echo "[removing installed pandas]"
166-
conda remove pandas --force
158+
conda remove pandas -y --force
167159

168-
if [ -z "$BUILD_TEST" ]; then
160+
if [ "$BUILD_TEST" ]; then
161+
162+
# remove any installation
163+
pip uninstall -y pandas
164+
conda list pandas
165+
pip list --format columns |grep pandas
166+
167+
# build & install testing
168+
echo ["building release"]
169+
bash scripts/build_dist_for_release.sh
170+
conda uninstall -y cython
171+
time pip install dist/*tar.gz || exit 1
172+
173+
else
169174

170175
# install our pandas
171176
echo

ci/requirements-3.4.build

-4
This file was deleted.

ci/requirements-3.4.pip

-2
This file was deleted.

ci/requirements-3.4.run

-18
This file was deleted.

ci/requirements-3.4_SLOW.run

-20
This file was deleted.

ci/requirements-3.4_SLOW.sh

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
python=3.4*
1+
python=3.6*
22
python-dateutil
33
pytz
44
nomkl
5-
numpy=1.10*
5+
numpy
66
cython

ci/requirements-3.6_LOCALE.pip

Whitespace-only changes.

ci/requirements-3.6_LOCALE.run

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
scipy
5+
openpyxl
6+
xlsxwriter
7+
xlrd
8+
xlwt
9+
numexpr
10+
pytables
11+
matplotlib
12+
lxml
13+
html5lib
14+
jinja2
15+
sqlalchemy
16+
pymysql
17+
# feather-format (not available on defaults ATM)
18+
# psycopg2 (not avail on defaults ATM)
19+
beautifulsoup4
20+
s3fs
21+
xarray
22+
ipython

ci/requirements-3.6_LOCALE_SLOW.build

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
python=3.6*
2+
python-dateutil
3+
pytz
4+
nomkl
5+
numpy
6+
cython

ci/requirements-3.6_LOCALE_SLOW.pip

Whitespace-only changes.

ci/requirements-3.6_LOCALE_SLOW.run

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
scipy
5+
openpyxl
6+
xlsxwriter
7+
xlrd
8+
xlwt
9+
numexpr
10+
pytables
11+
matplotlib
12+
lxml
13+
html5lib
14+
jinja2
15+
sqlalchemy
16+
pymysql
17+
# feather-format (not available on defaults ATM)
18+
# psycopg2 (not available on defaults ATM)
19+
beautifulsoup4
20+
s3fs
21+
xarray
22+
ipython

ci/script_multi.sh

+13-7
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@ export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 429496
1919
echo PYTHONHASHSEED=$PYTHONHASHSEED
2020

2121
if [ "$BUILD_TEST" ]; then
22-
echo "build-test"
22+
echo "[build-test]"
23+
24+
echo "[env]"
25+
pip list --format columns |grep pandas
26+
27+
echo "[running]"
2328
cd /tmp
24-
pwd
25-
conda list pandas
26-
echo "running"
27-
python -c "import pandas; pandas.test(['-n 2'])"
29+
unset PYTHONPATH
30+
python -c 'import pandas; pandas.test(["-n 2", "--skip-slow", "--skip-network", "-r xX", "-m not single"])'
31+
2832
elif [ "$DOC" ]; then
2933
echo "We are not running pytest as this is a doc-build"
34+
3035
elif [ "$COVERAGE" ]; then
3136
echo pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
3237
pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
38+
3339
else
34-
echo pytest -n 2 -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
35-
pytest -n 2 -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas # TODO: doctest
40+
echo pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
41+
pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas # TODO: doctest
3642
fi
3743

3844
RET="$?"

ci/script_single.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ elif [ "$COVERAGE" ]; then
2020
echo pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
2121
pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
2222
else
23-
echo pytest -m "single" --junitxml=/tmp/single.xml $TEST_ARGS pandas
24-
pytest -m "single" --junitxml=/tmp/single.xml $TEST_ARGS pandas # TODO: doctest
23+
echo pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas
24+
pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas # TODO: doctest
2525
fi
2626

2727
RET="$?"

circle.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ dependencies:
2323
0)
2424
sudo apt-get install language-pack-it && ./ci/install_circle.sh JOB="2.7_COMPAT" LOCALE_OVERRIDE="it_IT.UTF-8" ;;
2525
1)
26-
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh JOB="3.4_SLOW" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
26+
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh JOB="3.6_LOCALE" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
2727
2)
28-
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh JOB="3.4" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
28+
sudo apt-get install language-pack-zh-hans && ./ci/install_circle.sh JOB="3.6_LOCALE_SLOW" LOCALE_OVERRIDE="zh_CN.UTF-8" ;;
2929
3)
3030
./ci/install_circle.sh JOB="3.5_ASCII" LOCALE_OVERRIDE="C" ;;
3131
esac

doc/make.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,28 @@ def maybe_exclude_notebooks():
115115
notebooks = [os.path.join(base, 'source', nb)
116116
for nb in ['style.ipynb']]
117117
contents = {}
118-
try:
119-
import nbconvert
120-
nbconvert.utils.pandoc.get_pandoc_version()
121-
except (ImportError, nbconvert.utils.pandoc.PandocMissing):
122-
print("Warning: Pandoc is not installed. Skipping Notebooks.")
118+
119+
def _remove_notebooks():
123120
for nb in notebooks:
124121
with open(nb, 'rt') as f:
125122
contents[nb] = f.read()
126123
os.remove(nb)
124+
125+
# Skip notebook conversion if
126+
# 1. nbconvert isn't installed, or
127+
# 2. nbconvert is installed, but pandoc isn't
128+
try:
129+
import nbconvert
130+
except ImportError:
131+
print("Warning: nbconvert not installed. Skipping notebooks.")
132+
_remove_notebooks()
133+
else:
134+
try:
135+
nbconvert.utils.pandoc.get_pandoc_version()
136+
except nbconvert.utils.pandoc.PandocMissing:
137+
print("Warning: Pandoc is not installed. Skipping notebooks.")
138+
_remove_notebooks()
139+
127140
yield
128141
for nb, content in contents.items():
129142
with open(nb, 'wt') as f:

0 commit comments

Comments
 (0)