Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rabernat committed Aug 23, 2019
2 parents 2ff2595 + 76d4a67 commit f7c12a9
Show file tree
Hide file tree
Showing 159 changed files with 25,034 additions and 17,853 deletions.
11 changes: 7 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
codecov:
ci:
# by default, codecov doesn't recognize azure as a CI provider
- dev.azure.com
require_ci_to_pass: yes

coverage:
status:
project:
Expand All @@ -7,7 +13,4 @@ coverage:
patch: false
changes: false

comment:
layout: "header, diff"
behavior: default
require_changes: no
comment: off
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

15 changes: 7 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
name: Bug report / Feature request
about: 'Post a problem or idea'
title: ''
labels: ''
assignees: ''

---

#### MCVE Code Sample

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
<!-- 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 -->

```python
# Your code here

```

#### Problem Description
#### Expected Output

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

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

#### Output of ``xr.show_versions()``

#### Output of ``xr.show_versions()``
<details>
# Paste the output here xr.show_versions() here

Expand Down
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Passes `black . && mypy . && flake8`
- [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dask-worker-space/
doc/_build
doc/generated
xarray/version.py
xarray/tests/data/*.grib.*.idx

# Sync tools
Icon*
Expand Down
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://pre-commit.com/
# https://github.com/python/black#version-control-integration
repos:
- repo: https://github.com/python/black
rev: stable
hooks:
- id: black
language_version: python3.7
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.720 # Must match ci/requirements/*.yml
hooks:
- id: mypy
# run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
# - repo: https://github.com/asottile/pyupgrade
# rev: v1.22.1
# hooks:
# - id: pyupgrade
# args:
# - "--py3-only"
# # remove on f-strings in Py3.7
# - "--keep-percent-format"
# - repo: https://github.com/timothycrosley/isort
# rev: 4.3.21-2
# hooks:
# - id: isort
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ xarray: N-D labeled arrays and datasets
:target: https://pandas.pydata.org/speed/xarray/
.. image:: https://img.shields.io/pypi/v/xarray.svg
:target: https://pypi.python.org/pypi/xarray/
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black


**xarray** (formerly **xray**) is an open source project and Python package
that makes working with labelled multi-dimensional arrays simple,
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import itertools

import numpy as np
Expand All @@ -12,6 +10,7 @@ def decorator(func):
func.param_names = names
func.params = params
return func

return decorator


Expand All @@ -28,6 +27,7 @@ def randn(shape, frac_nan=None, chunks=None, seed=0):
x = rng.standard_normal(shape)
else:
import dask.array as da

rng = da.random.RandomState(seed)
x = rng.standard_normal(shape, chunks=chunks)

Expand Down
18 changes: 9 additions & 9 deletions asv_bench/benchmarks/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ def setup(self):
data = np.random.randn(t_size, x_size, y_size)

self.dsA0 = xr.Dataset(
{'A': xr.DataArray(data, coords={'T': t},
dims=('T', 'X', 'Y'))})
{"A": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
)
self.dsA1 = xr.Dataset(
{'A': xr.DataArray(data, coords={'T': t + t_size},
dims=('T', 'X', 'Y'))})
{"A": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
)
self.dsB0 = xr.Dataset(
{'B': xr.DataArray(data, coords={'T': t},
dims=('T', 'X', 'Y'))})
{"B": xr.DataArray(data, coords={"T": t}, dims=("T", "X", "Y"))}
)
self.dsB1 = xr.Dataset(
{'B': xr.DataArray(data, coords={'T': t + t_size},
dims=('T', 'X', 'Y'))})
{"B": xr.DataArray(data, coords={"T": t + t_size}, dims=("T", "X", "Y"))}
)

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

xr.combine_manual(datasets, concat_dim=[None, 't'])
xr.combine_manual(datasets, concat_dim=[None, "t"])

def time_auto_combine(self):
"""Also has to load and arrange t coordinate"""
Expand Down
45 changes: 24 additions & 21 deletions asv_bench/benchmarks/dataarray_missing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import pandas as pd

import xarray as xr
Expand All @@ -14,9 +12,8 @@

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

if chunks is not None:
da = da.chunk(chunks)
Expand All @@ -28,44 +25,50 @@ def time_interpolate_na(shape, chunks, method, limit):
if chunks is not None:
requires_dask()
da = make_bench_data(shape, 0.1, chunks=chunks)
actual = da.interpolate_na(dim='time', method='linear', limit=limit)
actual = da.interpolate_na(dim="time", method="linear", limit=limit)

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


time_interpolate_na.param_names = ['shape', 'chunks', 'method', 'limit']
time_interpolate_na.params = ([(3650, 200, 400), (100, 25, 25)],
[None, {'x': 25, 'y': 25}],
['linear', 'spline', 'quadratic', 'cubic'],
[None, 3])
time_interpolate_na.param_names = ["shape", "chunks", "method", "limit"]
time_interpolate_na.params = (
[(3650, 200, 400), (100, 25, 25)],
[None, {"x": 25, "y": 25}],
["linear", "spline", "quadratic", "cubic"],
[None, 3],
)


def time_ffill(shape, chunks, limit):

da = make_bench_data(shape, 0.1, chunks=chunks)
actual = da.ffill(dim='time', limit=limit)
actual = da.ffill(dim="time", limit=limit)

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


time_ffill.param_names = ['shape', 'chunks', 'limit']
time_ffill.params = ([(3650, 200, 400), (100, 25, 25)],
[None, {'x': 25, 'y': 25}],
[None, 3])
time_ffill.param_names = ["shape", "chunks", "limit"]
time_ffill.params = (
[(3650, 200, 400), (100, 25, 25)],
[None, {"x": 25, "y": 25}],
[None, 3],
)


def time_bfill(shape, chunks, limit):

da = make_bench_data(shape, 0.1, chunks=chunks)
actual = da.bfill(dim='time', limit=limit)
actual = da.bfill(dim="time", limit=limit)

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


time_bfill.param_names = ['shape', 'chunks', 'limit']
time_bfill.params = ([(3650, 200, 400), (100, 25, 25)],
[None, {'x': 25, 'y': 25}],
[None, 3])
time_bfill.param_names = ["shape", "chunks", "limit"]
time_bfill.params = (
[(3650, 200, 400), (100, 25, 25)],
[None, {"x": 25, "y": 25}],
[None, 3],
)
Loading

0 comments on commit f7c12a9

Please sign in to comment.