Skip to content

Commit

Permalink
More type ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Nov 3, 2023
1 parent 4abcfa6 commit 9391873
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions flox/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,15 @@ def factorize_(
idx[mask] = -1
else:
if isinstance(flat, np.ndarray):
idx, groups = pd.factorize(flat, sort=sort)
idx, groups = pd.factorize(flat, sort=sort) # type: ignore[call-overload]
groups = np.array(groups)
else:
assert sort
groups, idx = np.unique(flat, return_inverse=True) # type: ignore[call-overload]
groups, idx = np.unique(flat, return_inverse=True)
idx[np.isnan(flat)] = -1
groups = groups[~np.isnan(groups)] # type: ignore[index]
groups = groups[~np.isnan(groups)] # type: ignore[call-overload]

found_groups.append(groups)
found_groups.append(groups) # type: ignore[arg-type]
factorized.append(idx.reshape(groupvar.shape))

grp_shape = tuple(len(grp) for grp in found_groups)
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

cp_types = (cp.ndarray,)
except ImportError:
cp_types = () # type: ignore
cp_types = () # type: ignore[assignment]


def _importorskip(modname, minversion=None):
Expand Down

0 comments on commit 9391873

Please sign in to comment.