Skip to content
forked from pydata/xarray

Commit

Permalink
typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Oct 25, 2019
1 parent 9de946f commit a411cc2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,11 @@ def fillna(self, value: Any) -> "DataArray":

def interpolate_na(
self,
dim=None,
dim: Hashable = None,
method: str = "linear",
limit: int = None,
use_coordinate: Union[bool, str] = True,
max_gap: int = None,
max_gap: Union[int, float, str, pd.Timedelta, np.timedelta64] = None,
**kwargs: Any,
) -> "DataArray":
"""Interpolate values according to different methods.
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3866,7 +3866,7 @@ def interpolate_na(
method: str = "linear",
limit: int = None,
use_coordinate: Union[bool, Hashable] = True,
max_gap: int = None,
max_gap: Union[int, float, str, pd.Timedelta, np.timedelta64] = None,
**kwargs: Any,
) -> "Dataset":
"""Interpolate values according to different methods.
Expand Down
16 changes: 8 additions & 8 deletions xarray/core/missing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warnings
from functools import partial
from numbers import Number
from typing import Any, Callable, Dict, Sequence
from typing import Any, Callable, Dict, Hashable, Sequence, Union

import numpy as np
import pandas as pd
Expand All @@ -14,7 +14,7 @@
from .variable import Variable, broadcast_variables


def _get_nan_block_lengths(obj, dim: str, index: Variable):
def _get_nan_block_lengths(obj, dim: Hashable, index: Variable):
"""
Return an object where each NaN element in 'obj' is replaced by the
length of the gap the element is in.
Expand Down Expand Up @@ -206,7 +206,7 @@ def _apply_over_vars_with_dim(func, self, dim=None, **kwargs):
return ds


def get_clean_interp_index(arr, dim, use_coordinate=True):
def get_clean_interp_index(arr, dim: Hashable, use_coordinate: Union[str, bool] = True):
"""get index to use for x values in interpolation.
If use_coordinate is True, the coordinate that shares the name of the
Expand Down Expand Up @@ -259,11 +259,11 @@ def get_clean_interp_index(arr, dim, use_coordinate=True):

def interp_na(
self,
dim=None,
use_coordinate=True,
method="linear",
limit=None,
max_gap=None,
dim: Hashable = None,
use_coordinate: Union[bool, str] = True,
method: str = "linear",
limit: int = None,
max_gap: Union[int, float, str, pd.Timedelta, np.timedelta64] = None,
**kwargs,
):
"""Interpolate values according to different methods.
Expand Down

0 comments on commit a411cc2

Please sign in to comment.