From 4065378a48ec8b75eccde3464cd7a7bb7ec426ae Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 8 Aug 2019 17:10:28 -0400 Subject: [PATCH 1/5] remove future statements --- asv_bench/benchmarks/__init__.py | 2 -- asv_bench/benchmarks/dataarray_missing.py | 2 -- asv_bench/benchmarks/dataset_io.py | 2 -- asv_bench/benchmarks/indexing.py | 2 -- asv_bench/benchmarks/interp.py | 2 -- asv_bench/benchmarks/reindexing.py | 2 -- asv_bench/benchmarks/rolling.py | 2 -- asv_bench/benchmarks/unstacking.py | 2 -- doc/conf.py | 8 ++++---- doc/gallery/plot_cartopy_facetgrid.py | 1 - versioneer.py | 1 - 11 files changed, 4 insertions(+), 22 deletions(-) diff --git a/asv_bench/benchmarks/__init__.py b/asv_bench/benchmarks/__init__.py index 2ee5350ba90..ef647c5a74a 100644 --- a/asv_bench/benchmarks/__init__.py +++ b/asv_bench/benchmarks/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import itertools import numpy as np diff --git a/asv_bench/benchmarks/dataarray_missing.py b/asv_bench/benchmarks/dataarray_missing.py index b119d14e73a..9711e2bbcd0 100644 --- a/asv_bench/benchmarks/dataarray_missing.py +++ b/asv_bench/benchmarks/dataarray_missing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import pandas as pd import xarray as xr diff --git a/asv_bench/benchmarks/dataset_io.py b/asv_bench/benchmarks/dataset_io.py index 1542d2c857a..c1567d0b513 100644 --- a/asv_bench/benchmarks/dataset_io.py +++ b/asv_bench/benchmarks/dataset_io.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import os import numpy as np diff --git a/asv_bench/benchmarks/indexing.py b/asv_bench/benchmarks/indexing.py index c9e367dc696..cd212895d99 100644 --- a/asv_bench/benchmarks/indexing.py +++ b/asv_bench/benchmarks/indexing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/interp.py b/asv_bench/benchmarks/interp.py index b62717d7ceb..cded900ebbc 100644 --- a/asv_bench/benchmarks/interp.py +++ b/asv_bench/benchmarks/interp.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/reindexing.py b/asv_bench/benchmarks/reindexing.py index ceed186fcc8..fe4fa500c09 100644 --- a/asv_bench/benchmarks/reindexing.py +++ b/asv_bench/benchmarks/reindexing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import xarray as xr diff --git a/asv_bench/benchmarks/rolling.py b/asv_bench/benchmarks/rolling.py index 268bad7e738..d5426af4aa1 100644 --- a/asv_bench/benchmarks/rolling.py +++ b/asv_bench/benchmarks/rolling.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/unstacking.py b/asv_bench/benchmarks/unstacking.py index 7b529373902..342475b96df 100644 --- a/asv_bench/benchmarks/unstacking.py +++ b/asv_bench/benchmarks/unstacking.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import xarray as xr diff --git a/doc/conf.py b/doc/conf.py index e181c3e14c2..a80e470af26 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,7 +11,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import absolute_import, division, print_function + import datetime import os @@ -262,11 +262,11 @@ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/doc/gallery/plot_cartopy_facetgrid.py b/doc/gallery/plot_cartopy_facetgrid.py index cfa9d3b07ec..a0afa7ad92e 100644 --- a/doc/gallery/plot_cartopy_facetgrid.py +++ b/doc/gallery/plot_cartopy_facetgrid.py @@ -14,7 +14,6 @@ .. _this discussion: https://github.com/pydata/xarray/issues/1397#issuecomment-299190567 """ # noqa -from __future__ import division import cartopy.crs as ccrs import matplotlib.pyplot as plt diff --git a/versioneer.py b/versioneer.py index ea714e561b7..7b55d5d06cb 100644 --- a/versioneer.py +++ b/versioneer.py @@ -277,7 +277,6 @@ """ -from __future__ import print_function import errno import json From 6ad6adfee385d94e02482da6d094e354cc335541 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 8 Aug 2019 22:31:16 -0400 Subject: [PATCH 2/5] add commented out pyupgrade --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb627986e0f..ab66d9b03fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,9 @@ repos: rev: v2.2.3 hooks: - id: flake8 +# run 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"] From 86e369caeeb81762b855d062a3e15b8679677549 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 8 Aug 2019 22:48:16 -0400 Subject: [PATCH 3/5] add py3-only & keep-percent to pyupgrade config --- .pre-commit-config.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab66d9b03fd..078616153e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,9 +10,12 @@ repos: rev: v2.2.3 hooks: - id: flake8 -# run 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"] + # run 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" From 96ed5196216643d2e509509aa7ee6559574948ba Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 8 Aug 2019 23:30:24 -0400 Subject: [PATCH 4/5] add isort to commented out hooks --- .pre-commit-config.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 078616153e2..a94a53778ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: rev: v2.2.3 hooks: - id: flake8 - # run occasionally, ref discussion https://github.com/pydata/xarray/pull/3194 + # run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194 # - repo: https://github.com/asottile/pyupgrade # rev: v1.22.1 # hooks: @@ -19,3 +19,7 @@ repos: # - "--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 From 4df038747410dad575531245cc6d14cf7c81da7d Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Thu, 8 Aug 2019 23:34:25 -0400 Subject: [PATCH 5/5] add a couple of items to isort config --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 68fc3b6e06c..4bcf979197d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,6 +30,8 @@ exclude= doc [isort] +default_section=THIRDPARTY +known_first_party=xarray multi_line_output=3 include_trailing_comma=True force_grid_wrap=0