Skip to content

Commit

Permalink
Fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart committed Aug 9, 2023
1 parent 5c064c2 commit f1ba304
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tabmat/formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def to_tabmat(
dtype: numpy.dtype = numpy.float64,
sparse_threshold: float = 0.1,
cat_threshold: int = 4,
) -> DenseMatrix:
) -> Union[SparseMatrix, DenseMatrix]:
if (self.values != 0).mean() > sparse_threshold:
return DenseMatrix(self.values)
else:
Expand Down Expand Up @@ -439,7 +439,7 @@ def to_tabmat(
dtype: numpy.dtype = numpy.float64,
sparse_threshold: float = 0.1,
cat_threshold: int = 4,
) -> Union[CategoricalMatrix, SplitMatrix]:
) -> Union[DenseMatrix, CategoricalMatrix, SplitMatrix]:
codes = self.codes.copy()
categories = self.categories.copy()
if -2 in self.codes:
Expand Down

0 comments on commit f1ba304

Please sign in to comment.