Skip to content

Commit

Permalink
Remove py37 collections.abc deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Nov 25, 2018
1 parent 5f09deb commit a036b61
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion xarray/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import time
import traceback
import warnings
from collections import Mapping, OrderedDict
from collections.abc import Mapping
from collections import OrderedDict
from functools import partial

import numpy as np
Expand Down
7 changes: 4 additions & 3 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import functools
import sys
import warnings
from collections import Mapping, defaultdict
from collections import defaultdict
from collections.abc import Mapping
from distutils.version import LooseVersion
from numbers import Number

Expand Down Expand Up @@ -1415,7 +1416,7 @@ def _validate_indexers(self, indexers):
""" Here we make sure
+ indexer has a valid keys
+ indexer is in a valid data type
+ string indexers are cast to the appropriate date type if the
+ string indexers are cast to the appropriate date type if the
associated index is a DatetimeIndex or CFTimeIndex
"""
from .dataarray import DataArray
Expand Down Expand Up @@ -1998,7 +1999,7 @@ def _validate_interp_indexer(x, new_x):
'Instead got\n{}'.format(new_x))
else:
return (x, new_x)

variables = OrderedDict()
for name, var in iteritems(obj._variables):
if name not in indexers:
Expand Down
3 changes: 2 additions & 1 deletion xarray/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import functools
import operator
from collections import Hashable, defaultdict
from collections.abc import Hashable
from collections import defaultdict
from datetime import timedelta

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/missing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import, division, print_function

import warnings
from collections import Iterable
from collections.abc import Iterable
from functools import partial

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import itertools
import re
import warnings
from collections import Iterable, Mapping, MutableMapping, MutableSet
from collections.abc import Iterable, Mapping, MutableMapping, MutableSet

import numpy as np
import pandas as pd
Expand Down

0 comments on commit a036b61

Please sign in to comment.