Skip to content

Commit f7c12a9

Browse files
committed
resolve merge conflicts
2 parents 2ff2595 + 76d4a67 commit f7c12a9

File tree

159 files changed

+25034
-17853
lines changed

Some content is hidden

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

159 files changed

+25034
-17853
lines changed

.codecov.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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+
17
coverage:
28
status:
39
project:
@@ -7,7 +13,4 @@ coverage:
713
patch: false
814
changes: false
915

10-
comment:
11-
layout: "header, diff"
12-
behavior: default
13-
require_changes: no
16+
comment: off

.github/ISSUE_TEMPLATE.md

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
---
2-
name: Bug report
3-
about: Create a report to help us improve
2+
name: Bug report / Feature request
3+
about: 'Post a problem or idea'
44
title: ''
55
labels: ''
66
assignees: ''
77

88
---
99

1010
#### MCVE Code Sample
11-
12-
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
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 -->
1312

1413
```python
1514
# Your code here
1615

1716
```
1817

19-
#### Problem Description
18+
#### Expected Output
2019

21-
[this should explain **why** the current behavior is a problem and why the expected output is a better solution.]
2220

23-
#### Expected Output
21+
#### Problem Description
22+
<!-- this should explain why the current behavior is a problem and why the expected output is a better solution -->
2423

25-
#### Output of ``xr.show_versions()``
2624

25+
#### Output of ``xr.show_versions()``
2726
<details>
2827
# Paste the output here xr.show_versions() here
2928

.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ dask-worker-space/
6666
doc/_build
6767
doc/generated
6868
xarray/version.py
69+
xarray/tests/data/*.grib.*.idx
6970

7071
# Sync tools
7172
Icon*

.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

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ xarray: N-D labeled arrays and datasets
1111
:target: https://pandas.pydata.org/speed/xarray/
1212
.. image:: https://img.shields.io/pypi/v/xarray.svg
1313
: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+
1417

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

asv_bench/benchmarks/__init__.py

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

53
import numpy as np
@@ -12,6 +10,7 @@ def decorator(func):
1210
func.param_names = names
1311
func.params = params
1412
return func
13+
1514
return decorator
1615

1716

@@ -28,6 +27,7 @@ def randn(shape, frac_nan=None, chunks=None, seed=0):
2827
x = rng.standard_normal(shape)
2928
else:
3029
import dask.array as da
30+
3131
rng = da.random.RandomState(seed)
3232
x = rng.standard_normal(shape, chunks=chunks)
3333

asv_bench/benchmarks/combine.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ def setup(self):
1313
data = np.random.randn(t_size, x_size, y_size)
1414

1515
self.dsA0 = xr.Dataset(
16-
{'A': xr.DataArray(data, coords={'T': t},
17-
dims=('T', 'X', 'Y'))})
16+
{"A": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
17+
)
1818
self.dsA1 = xr.Dataset(
19-
{'A': xr.DataArray(data, coords={'T': t + t_size},
20-
dims=('T', 'X', 'Y'))})
19+
{"A": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
20+
)
2121
self.dsB0 = xr.Dataset(
22-
{'B': xr.DataArray(data, coords={'T': t},
23-
dims=('T', 'X', 'Y'))})
22+
{"B": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
23+
)
2424
self.dsB1 = xr.Dataset(
25-
{'B': xr.DataArray(data, coords={'T': t + t_size},
26-
dims=('T', 'X', 'Y'))})
25+
{"B": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
26+
)
2727

2828
def time_combine_manual(self):
2929
datasets = [[self.dsA0, self.dsA1], [self.dsB0, self.dsB1]]
3030

31-
xr.combine_manual(datasets, concat_dim=[None, 't'])
31+
xr.combine_manual(datasets, concat_dim=[None, "t"])
3232

3333
def time_auto_combine(self):
3434
"""Also has to load and arrange t coordinate"""
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import, division, print_function
2-
31
import pandas as pd
42

53
import xarray as xr
@@ -14,9 +12,8 @@
1412

1513
def make_bench_data(shape, frac_nan, chunks):
1614
vals = randn(shape, frac_nan)
17-
coords = {'time': pd.date_range('2000-01-01', freq='D',
18-
periods=shape[0])}
19-
da = xr.DataArray(vals, dims=('time', 'x', 'y'), coords=coords)
15+
coords = {"time": pd.date_range("2000-01-01", freq="D", periods=shape[0])}
16+
da = xr.DataArray(vals, dims=("time", "x", "y"), coords=coords)
2017

2118
if chunks is not None:
2219
da = da.chunk(chunks)
@@ -28,44 +25,50 @@ def time_interpolate_na(shape, chunks, method, limit):
2825
if chunks is not None:
2926
requires_dask()
3027
da = make_bench_data(shape, 0.1, chunks=chunks)
31-
actual = da.interpolate_na(dim='time', method='linear', limit=limit)
28+
actual = da.interpolate_na(dim="time", method="linear", limit=limit)
3229

3330
if chunks is not None:
3431
actual = actual.compute()
3532

3633

37-
time_interpolate_na.param_names = ['shape', 'chunks', 'method', 'limit']
38-
time_interpolate_na.params = ([(3650, 200, 400), (100, 25, 25)],
39-
[None, {'x': 25, 'y': 25}],
40-
['linear', 'spline', 'quadratic', 'cubic'],
41-
[None, 3])
34+
time_interpolate_na.param_names = ["shape", "chunks", "method", "limit"]
35+
time_interpolate_na.params = (
36+
[(3650, 200, 400), (100, 25, 25)],
37+
[None, {"x": 25, "y": 25}],
38+
["linear", "spline", "quadratic", "cubic"],
39+
[None, 3],
40+
)
4241

4342

4443
def time_ffill(shape, chunks, limit):
4544

4645
da = make_bench_data(shape, 0.1, chunks=chunks)
47-
actual = da.ffill(dim='time', limit=limit)
46+
actual = da.ffill(dim="time", limit=limit)
4847

4948
if chunks is not None:
5049
actual = actual.compute()
5150

5251

53-
time_ffill.param_names = ['shape', 'chunks', 'limit']
54-
time_ffill.params = ([(3650, 200, 400), (100, 25, 25)],
55-
[None, {'x': 25, 'y': 25}],
56-
[None, 3])
52+
time_ffill.param_names = ["shape", "chunks", "limit"]
53+
time_ffill.params = (
54+
[(3650, 200, 400), (100, 25, 25)],
55+
[None, {"x": 25, "y": 25}],
56+
[None, 3],
57+
)
5758

5859

5960
def time_bfill(shape, chunks, limit):
6061

6162
da = make_bench_data(shape, 0.1, chunks=chunks)
62-
actual = da.bfill(dim='time', limit=limit)
63+
actual = da.bfill(dim="time", limit=limit)
6364

6465
if chunks is not None:
6566
actual = actual.compute()
6667

6768

68-
time_bfill.param_names = ['shape', 'chunks', 'limit']
69-
time_bfill.params = ([(3650, 200, 400), (100, 25, 25)],
70-
[None, {'x': 25, 'y': 25}],
71-
[None, 3])
69+
time_bfill.param_names = ["shape", "chunks", "limit"]
70+
time_bfill.params = (
71+
[(3650, 200, 400), (100, 25, 25)],
72+
[None, {"x": 25, "y": 25}],
73+
[None, 3],
74+
)

0 commit comments

Comments
 (0)