Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
yohai committed Jul 11, 2018
2 parents 29ba108 + 9491318 commit daa4489
Show file tree
Hide file tree
Showing 84 changed files with 9,187 additions and 1,057 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# reduce the number of merge conflicts
doc/whats-new.rst merge=union
xarray/_version.py export-subst
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ nosetests.xml
.ropeproject/
.tags*
.testmon*
.tmontmp/
.pytest_cache
dask-worker-space/

# asv environments
.asv
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ install:
- python xarray/util/print_versions.py

script:
- python -OO -c "import xarray"
# TODO: restore this check once the upstream pandas issue is fixed:
# https://github.com/pandas-dev/pandas/issues/21071
# - python -OO -c "import xarray"
- if [[ "$CONDA_ENV" == "docs" ]]; then
conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc;
sphinx-build -n -j auto -b html -d _build/doctrees doc _build/html;
Expand Down
28 changes: 12 additions & 16 deletions HOW_TO_RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ Time required: about an hour.
2. Look over whats-new.rst and the docs. Make sure "What's New" is complete
(check the date!) and add a brief summary note describing the release at the
top.
3. Update the version in setup.py and switch to `ISRELEASED = True`.
4. If you have any doubts, run the full test suite one final time!
3. If you have any doubts, run the full test suite one final time!
py.test
5. On the master branch, commit the release in git:
4. On the master branch, commit the release in git:
git commit -a -m 'Release v0.X.Y'
6. Tag the release:
5. Tag the release:
git tag -a v0.X.Y -m 'v0.X.Y'
7. Build source and binary wheels for pypi:
6. Build source and binary wheels for pypi:
python setup.py bdist_wheel sdist
8. Use twine to register and upload the release on pypi. Be careful, you can't
7. Use twine to register and upload the release on pypi. Be careful, you can't
take this back!
twine upload dist/xarray-0.X.Y*
You will need to be listed as a package owner at
https://pypi.python.org/pypi/xarray for this to work.
9. Push your changes to master:
8. Push your changes to master:
git push upstream master
git push upstream --tags
9. Update the stable branch (used by ReadTheDocs) and switch back to master:
Expand All @@ -32,25 +31,22 @@ Time required: about an hour.
It's OK to force push to 'stable' if necessary.
We also update the stable branch with `git cherrypick` for documentation
only fixes that apply the current released version.
10. Revert ISRELEASED in setup.py back to False. Don't change the version
number: in normal development, we keep the version number in setup.py as the
last released version.
11. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
12. Commit your changes and push to master again:
10. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
11. Commit your changes and push to master again:
git commit -a -m 'Revert to dev version'
git push upstream master
You're done pushing to master!
13. Issue the release on GitHub. Click on "Draft a new release" at
12. Issue the release on GitHub. Click on "Draft a new release" at
https://github.com/pydata/xarray/releases and paste in the latest from
whats-new.rst.
14. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
13. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
and switch your new release tag (at the bottom) from "Inactive" to "Active".
It should now build automatically.
15. Update conda-forge. Clone https://github.com/conda-forge/xarray-feedstock
14. Update conda-forge. Clone https://github.com/conda-forge/xarray-feedstock
and update the version number and sha256 in meta.yaml. (On OS X, you can
calculate sha256 with `shasum -a 256 xarray-0.X.Y.tar.gz`). Submit a pull
request (and merge it, once CI passes).
16. Issue the release announcement! For bug fix releases, I usually only email
15. Issue the release announcement! For bug fix releases, I usually only email
[email protected]. For major/feature releases, I will email a broader
list (no more than once every 3-6 months):
[email protected], [email protected],
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ recursive-include doc *
prune doc/_build
prune doc/generated
global-exclude .DS_Store
include versioneer.py
include xarray/_version.py
54 changes: 54 additions & 0 deletions asv_bench/benchmarks/interp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from __future__ import absolute_import, division, print_function

import numpy as np
import pandas as pd

import xarray as xr

from . import parameterized, randn, requires_dask

nx = 3000
long_nx = 30000000
ny = 2000
nt = 1000
window = 20

randn_xy = randn((nx, ny), frac_nan=0.1)
randn_xt = randn((nx, nt))
randn_t = randn((nt, ))
randn_long = randn((long_nx, ), frac_nan=0.1)


new_x_short = np.linspace(0.3 * nx, 0.7 * nx, 100)
new_x_long = np.linspace(0.3 * nx, 0.7 * nx, 1000)
new_y_long = np.linspace(0.1, 0.9, 1000)


class Interpolation(object):
def setup(self, *args, **kwargs):
self.ds = xr.Dataset(
{'var1': (('x', 'y'), randn_xy),
'var2': (('x', 't'), randn_xt),
'var3': (('t', ), randn_t)},
coords={'x': np.arange(nx),
'y': np.linspace(0, 1, ny),
't': pd.date_range('1970-01-01', periods=nt, freq='D'),
'x_coords': ('x', np.linspace(1.1, 2.1, nx))})

@parameterized(['method', 'is_short'],
(['linear', 'cubic'], [True, False]))
def time_interpolation(self, method, is_short):
new_x = new_x_short if is_short else new_x_long
self.ds.interp(x=new_x, method=method).load()

@parameterized(['method'],
(['linear', 'nearest']))
def time_interpolation_2d(self, method):
self.ds.interp(x=new_x_long, y=new_y_long, method=method).load()


class InterpolationDask(Interpolation):
def setup(self, *args, **kwargs):
requires_dask()
super(InterpolationDask, self).setup(**kwargs)
self.ds = self.ds.chunk({'t': 50})
9 changes: 5 additions & 4 deletions asv_bench/benchmarks/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup(self, *args, **kwargs):
@parameterized(['func', 'center'],
(['mean', 'count'], [True, False]))
def time_rolling(self, func, center):
getattr(self.ds.rolling(x=window, center=center), func)()
getattr(self.ds.rolling(x=window, center=center), func)().load()

@parameterized(['func', 'pandas'],
(['mean', 'count'], [True, False]))
Expand All @@ -44,19 +44,20 @@ def time_rolling_long(self, func, pandas):
se = self.da_long.to_series()
getattr(se.rolling(window=window), func)()
else:
getattr(self.da_long.rolling(x=window), func)()
getattr(self.da_long.rolling(x=window), func)().load()

@parameterized(['window_', 'min_periods'],
([20, 40], [5, None]))
def time_rolling_np(self, window_, min_periods):
self.ds.rolling(x=window_, center=False,
min_periods=min_periods).reduce(getattr(np, 'nanmean'))
min_periods=min_periods).reduce(
getattr(np, 'nanmean')).load()

@parameterized(['center', 'stride'],
([True, False], [1, 200]))
def time_rolling_construct(self, center, stride):
self.ds.rolling(x=window, center=center).construct(
'window_dim', stride=stride).mean(dim='window_dim')
'window_dim', stride=stride).mean(dim='window_dim').load()


class RollingDask(Rolling):
Expand Down
3 changes: 1 addition & 2 deletions ci/requirements-py27-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- h5py
- h5netcdf
- matplotlib
- netcdf4
- pathlib2
- pytest
- flake8
Expand All @@ -21,4 +20,4 @@ dependencies:
- rasterio
- zarr
- pip:
- cftime
- netcdf4
1 change: 1 addition & 0 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
- rasterio
- bottleneck
- zarr
- pseudonetcdf>=3.0.1
- pip:
- coveralls
- pytest-cov
Expand Down
Loading

0 comments on commit daa4489

Please sign in to comment.