Skip to content

Commit daa4489

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 29ba108 + 9491318 commit daa4489

Some content is hidden

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

84 files changed

+9187
-1057
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# reduce the number of merge conflicts
22
doc/whats-new.rst merge=union
3+
xarray/_version.py export-subst

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ nosetests.xml
3838
.ropeproject/
3939
.tags*
4040
.testmon*
41+
.tmontmp/
4142
.pytest_cache
43+
dask-worker-space/
4244

4345
# asv environments
4446
.asv

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ install:
101101
- python xarray/util/print_versions.py
102102

103103
script:
104-
- python -OO -c "import xarray"
104+
# TODO: restore this check once the upstream pandas issue is fixed:
105+
# https://github.com/pandas-dev/pandas/issues/21071
106+
# - python -OO -c "import xarray"
105107
- if [[ "$CONDA_ENV" == "docs" ]]; then
106108
conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc;
107109
sphinx-build -n -j auto -b html -d _build/doctrees doc _build/html;

HOW_TO_RELEASE

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ Time required: about an hour.
77
2. Look over whats-new.rst and the docs. Make sure "What's New" is complete
88
(check the date!) and add a brief summary note describing the release at the
99
top.
10-
3. Update the version in setup.py and switch to `ISRELEASED = True`.
11-
4. If you have any doubts, run the full test suite one final time!
10+
3. If you have any doubts, run the full test suite one final time!
1211
py.test
13-
5. On the master branch, commit the release in git:
12+
4. On the master branch, commit the release in git:
1413
git commit -a -m 'Release v0.X.Y'
15-
6. Tag the release:
14+
5. Tag the release:
1615
git tag -a v0.X.Y -m 'v0.X.Y'
17-
7. Build source and binary wheels for pypi:
16+
6. Build source and binary wheels for pypi:
1817
python setup.py bdist_wheel sdist
19-
8. Use twine to register and upload the release on pypi. Be careful, you can't
18+
7. Use twine to register and upload the release on pypi. Be careful, you can't
2019
take this back!
2120
twine upload dist/xarray-0.X.Y*
2221
You will need to be listed as a package owner at
2322
https://pypi.python.org/pypi/xarray for this to work.
24-
9. Push your changes to master:
23+
8. Push your changes to master:
2524
git push upstream master
2625
git push upstream --tags
2726
9. Update the stable branch (used by ReadTheDocs) and switch back to master:
@@ -32,25 +31,22 @@ Time required: about an hour.
3231
It's OK to force push to 'stable' if necessary.
3332
We also update the stable branch with `git cherrypick` for documentation
3433
only fixes that apply the current released version.
35-
10. Revert ISRELEASED in setup.py back to False. Don't change the version
36-
number: in normal development, we keep the version number in setup.py as the
37-
last released version.
38-
11. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
39-
12. Commit your changes and push to master again:
34+
10. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
35+
11. Commit your changes and push to master again:
4036
git commit -a -m 'Revert to dev version'
4137
git push upstream master
4238
You're done pushing to master!
43-
13. Issue the release on GitHub. Click on "Draft a new release" at
39+
12. Issue the release on GitHub. Click on "Draft a new release" at
4440
https://github.com/pydata/xarray/releases and paste in the latest from
4541
whats-new.rst.
46-
14. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
42+
13. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
4743
and switch your new release tag (at the bottom) from "Inactive" to "Active".
4844
It should now build automatically.
49-
15. Update conda-forge. Clone https://github.com/conda-forge/xarray-feedstock
45+
14. Update conda-forge. Clone https://github.com/conda-forge/xarray-feedstock
5046
and update the version number and sha256 in meta.yaml. (On OS X, you can
5147
calculate sha256 with `shasum -a 256 xarray-0.X.Y.tar.gz`). Submit a pull
5248
request (and merge it, once CI passes).
53-
16. Issue the release announcement! For bug fix releases, I usually only email
49+
15. Issue the release announcement! For bug fix releases, I usually only email
5450
xarray@googlegroups.com. For major/feature releases, I will email a broader
5551
list (no more than once every 3-6 months):
5652
pydata@googlegroups.com, xarray@googlegroups.com,

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ recursive-include doc *
44
prune doc/_build
55
prune doc/generated
66
global-exclude .DS_Store
7+
include versioneer.py
8+
include xarray/_version.py

asv_bench/benchmarks/interp.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
from __future__ import absolute_import, division, print_function
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
import xarray as xr
7+
8+
from . import parameterized, randn, requires_dask
9+
10+
nx = 3000
11+
long_nx = 30000000
12+
ny = 2000
13+
nt = 1000
14+
window = 20
15+
16+
randn_xy = randn((nx, ny), frac_nan=0.1)
17+
randn_xt = randn((nx, nt))
18+
randn_t = randn((nt, ))
19+
randn_long = randn((long_nx, ), frac_nan=0.1)
20+
21+
22+
new_x_short = np.linspace(0.3 * nx, 0.7 * nx, 100)
23+
new_x_long = np.linspace(0.3 * nx, 0.7 * nx, 1000)
24+
new_y_long = np.linspace(0.1, 0.9, 1000)
25+
26+
27+
class Interpolation(object):
28+
def setup(self, *args, **kwargs):
29+
self.ds = xr.Dataset(
30+
{'var1': (('x', 'y'), randn_xy),
31+
'var2': (('x', 't'), randn_xt),
32+
'var3': (('t', ), randn_t)},
33+
coords={'x': np.arange(nx),
34+
'y': np.linspace(0, 1, ny),
35+
't': pd.date_range('1970-01-01', periods=nt, freq='D'),
36+
'x_coords': ('x', np.linspace(1.1, 2.1, nx))})
37+
38+
@parameterized(['method', 'is_short'],
39+
(['linear', 'cubic'], [True, False]))
40+
def time_interpolation(self, method, is_short):
41+
new_x = new_x_short if is_short else new_x_long
42+
self.ds.interp(x=new_x, method=method).load()
43+
44+
@parameterized(['method'],
45+
(['linear', 'nearest']))
46+
def time_interpolation_2d(self, method):
47+
self.ds.interp(x=new_x_long, y=new_y_long, method=method).load()
48+
49+
50+
class InterpolationDask(Interpolation):
51+
def setup(self, *args, **kwargs):
52+
requires_dask()
53+
super(InterpolationDask, self).setup(**kwargs)
54+
self.ds = self.ds.chunk({'t': 50})

asv_bench/benchmarks/rolling.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setup(self, *args, **kwargs):
3535
@parameterized(['func', 'center'],
3636
(['mean', 'count'], [True, False]))
3737
def time_rolling(self, func, center):
38-
getattr(self.ds.rolling(x=window, center=center), func)()
38+
getattr(self.ds.rolling(x=window, center=center), func)().load()
3939

4040
@parameterized(['func', 'pandas'],
4141
(['mean', 'count'], [True, False]))
@@ -44,19 +44,20 @@ def time_rolling_long(self, func, pandas):
4444
se = self.da_long.to_series()
4545
getattr(se.rolling(window=window), func)()
4646
else:
47-
getattr(self.da_long.rolling(x=window), func)()
47+
getattr(self.da_long.rolling(x=window), func)().load()
4848

4949
@parameterized(['window_', 'min_periods'],
5050
([20, 40], [5, None]))
5151
def time_rolling_np(self, window_, min_periods):
5252
self.ds.rolling(x=window_, center=False,
53-
min_periods=min_periods).reduce(getattr(np, 'nanmean'))
53+
min_periods=min_periods).reduce(
54+
getattr(np, 'nanmean')).load()
5455

5556
@parameterized(['center', 'stride'],
5657
([True, False], [1, 200]))
5758
def time_rolling_construct(self, center, stride):
5859
self.ds.rolling(x=window, center=center).construct(
59-
'window_dim', stride=stride).mean(dim='window_dim')
60+
'window_dim', stride=stride).mean(dim='window_dim').load()
6061

6162

6263
class RollingDask(Rolling):

ci/requirements-py27-windows.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- h5py
99
- h5netcdf
1010
- matplotlib
11-
- netcdf4
1211
- pathlib2
1312
- pytest
1413
- flake8
@@ -21,4 +20,4 @@ dependencies:
2120
- rasterio
2221
- zarr
2322
- pip:
24-
- cftime
23+
- netcdf4

ci/requirements-py36.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
- rasterio
2121
- bottleneck
2222
- zarr
23+
- pseudonetcdf>=3.0.1
2324
- pip:
2425
- coveralls
2526
- pytest-cov

0 commit comments

Comments
 (0)