Skip to content

Commit 5e3aea2

Browse files
authored
Merge branch 'master' into enhancement/more-explicit-type-check-in-as_compatible_data
2 parents b890ede + 41fecd8 commit 5e3aea2

File tree

188 files changed

+32181
-19313
lines changed

Some content is hidden

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

188 files changed

+32181
-19313
lines changed

.codecov.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
codecov:
2+
ci:
3+
# by default, codecov doesn't recognize azure as a CI provider
4+
- dev.azure.com
5+
require_ci_to_pass: yes
6+
7+
coverage:
8+
status:
9+
project:
10+
default:
11+
# Require 1% coverage, i.e., always succeed
12+
target: 1
13+
patch: false
14+
changes: false
15+
16+
comment: off

.coveragerc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
[run]
2-
omit = xarray/test/*
2+
omit =
3+
xarray/tests/*
4+
xarray/core/dask_array_compat.py
5+
xarray/core/npcompat.py
6+
xarray/core/pdcompat.py
7+
xarray/core/pycompat.py
8+
xarray/_version.py

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report / Feature request
3+
about: 'Post a problem or idea'
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
#### MCVE Code Sample
11+
<!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports -->
12+
13+
```python
14+
# Your code here
15+
16+
```
17+
18+
#### Expected Output
19+
20+
21+
#### Problem Description
22+
<!-- this should explain why the current behavior is a problem and why the expected output is a better solution -->
23+
24+
25+
#### Output of ``xr.show_versions()``
26+
<details>
27+
# Paste the output here xr.show_versions() here
28+
29+
</details>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
- [ ] Closes #xxxx
44
- [ ] Tests added
5+
- [ ] Passes `black . && mypy . && flake8`
56
- [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ pip-log.txt
3232

3333
# Unit test / coverage reports
3434
.coverage
35+
.coverage.*
3536
.tox
3637
nosetests.xml
3738
.cache
39+
.dmypy.json
3840
.mypy_cache
3941
.ropeproject/
4042
.tags*
@@ -64,6 +66,7 @@ dask-worker-space/
6466
doc/_build
6567
doc/generated
6668
xarray/version.py
69+
xarray/tests/data/*.grib.*.idx
6770

6871
# Sync tools
6972
Icon*

.pep8speaks.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
# File : .pep8speaks.yml
2-
3-
# This should be kept in sync with the duplicate config in the [pycodestyle]
4-
# block of setup.cfg.
1+
# https://github.com/OrkoHunter/pep8speaks for more info
2+
# pep8speaks will use the flake8 configs in `setup.cfg`
53

64
scanner:
7-
diff_only: False # If True, errors caused by only the patch are shown
8-
9-
pycodestyle:
10-
max-line-length: 79
11-
ignore: # Errors and warnings to ignore
12-
- E402 # module level import not at top of file
13-
- E731 # do not assign a lambda expression, use a def
14-
- E741 # ambiguous variable name
15-
- W503 # line break before binary operator
16-
- W504 # line break after binary operator
5+
diff_only: False
6+
linter: flake8

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# https://pre-commit.com/
2+
# https://github.com/python/black#version-control-integration
3+
repos:
4+
- repo: https://github.com/python/black
5+
rev: stable
6+
hooks:
7+
- id: black
8+
language_version: python3.7
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v2.2.3
11+
hooks:
12+
- id: flake8
13+
- repo: https://github.com/pre-commit/mirrors-mypy
14+
rev: v0.720 # Must match ci/requirements/*.yml
15+
hooks:
16+
- id: mypy
17+
# run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
18+
# - repo: https://github.com/asottile/pyupgrade
19+
# rev: v1.22.1
20+
# hooks:
21+
# - id: pyupgrade
22+
# args:
23+
# - "--py3-only"
24+
# # remove on f-strings in Py3.7
25+
# - "--keep-percent-format"
26+
# - repo: https://github.com/timothycrosley/isort
27+
# rev: 4.3.21-2
28+
# hooks:
29+
# - id: isort

.travis.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

HOW_TO_RELEASE

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ Time required: about an hour.
55
1. Ensure your master branch is synced to upstream:
66
git pull upstream master
77
2. Look over whats-new.rst and the docs. Make sure "What's New" is complete
8-
(check the date!) and add a brief summary note describing the release at the
9-
top.
8+
(check the date!) and consider adding a brief summary note describing the
9+
release at the top.
10+
Things to watch out for:
11+
- Important new features should be highlighted towards the top.
12+
- Function/method references should include links to the API docs.
13+
- Sometimes notes get added in the wrong section of whats-new, typically
14+
due to a bad merge. Check for these before a release by using git diff,
15+
e.g., ``git diff v0.X.Y whats-new.rst`` where 0.X.Y is the previous
16+
release.
1017
3. If you have any doubts, run the full test suite one final time!
1118
py.test
1219
4. On the master branch, commit the release in git:

README.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
xarray: N-D labeled arrays and datasets
22
=======================================
33

4-
.. image:: https://travis-ci.org/pydata/xarray.svg?branch=master
5-
:target: https://travis-ci.org/pydata/xarray
6-
.. image:: https://ci.appveyor.com/api/projects/status/github/pydata/xarray?svg=true&passingText=passing&failingText=failing&pendingText=pending
7-
:target: https://ci.appveyor.com/project/shoyer/xray
8-
.. image:: https://coveralls.io/repos/pydata/xarray/badge.svg
9-
:target: https://coveralls.io/r/pydata/xarray
4+
.. image:: https://dev.azure.com/xarray/xarray/_apis/build/status/pydata.xarray?branchName=master
5+
:target: https://dev.azure.com/xarray/xarray/_build/latest?definitionId=1&branchName=master
6+
.. image:: https://codecov.io/gh/pydata/xarray/branch/master/graph/badge.svg
7+
:target: https://codecov.io/gh/pydata/xarray
108
.. image:: https://readthedocs.org/projects/xray/badge/?version=latest
119
:target: https://xarray.pydata.org/
1210
.. image:: https://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
1311
:target: https://pandas.pydata.org/speed/xarray/
1412
.. image:: https://img.shields.io/pypi/v/xarray.svg
1513
:target: https://pypi.python.org/pypi/xarray/
14+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
15+
:target: https://github.com/python/black
16+
1617

1718
**xarray** (formerly **xray**) is an open source project and Python package
1819
that makes working with labelled multi-dimensional arrays simple,

appveyor.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

asv_bench/benchmarks/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import absolute_import
2-
from __future__ import division
3-
from __future__ import print_function
41
import itertools
52

63
import numpy as np
@@ -13,6 +10,7 @@ def decorator(func):
1310
func.param_names = names
1411
func.params = params
1512
return func
13+
1614
return decorator
1715

1816

@@ -29,6 +27,7 @@ def randn(shape, frac_nan=None, chunks=None, seed=0):
2927
x = rng.standard_normal(shape)
3028
else:
3129
import dask.array as da
30+
3231
rng = da.random.RandomState(seed)
3332
x = rng.standard_normal(shape, chunks=chunks)
3433

asv_bench/benchmarks/combine.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import numpy as np
2+
3+
import xarray as xr
4+
5+
6+
class Combine:
7+
"""Benchmark concatenating and merging large datasets"""
8+
9+
def setup(self):
10+
"""Create 4 datasets with two different variables"""
11+
12+
t_size, x_size, y_size = 100, 900, 800
13+
t = np.arange(t_size)
14+
data = np.random.randn(t_size, x_size, y_size)
15+
16+
self.dsA0 = xr.Dataset(
17+
{"A": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
18+
)
19+
self.dsA1 = xr.Dataset(
20+
{"A": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
21+
)
22+
self.dsB0 = xr.Dataset(
23+
{"B": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
24+
)
25+
self.dsB1 = xr.Dataset(
26+
{"B": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
27+
)
28+
29+
def time_combine_manual(self):
30+
datasets = [[self.dsA0, self.dsA1], [self.dsB0, self.dsB1]]
31+
32+
xr.combine_manual(datasets, concat_dim=[None, "t"])
33+
34+
def time_auto_combine(self):
35+
"""Also has to load and arrange t coordinate"""
36+
datasets = [self.dsA0, self.dsA1, self.dsB0, self.dsB1]
37+
38+
xr.combine_auto(datasets)

0 commit comments

Comments
 (0)