Skip to content

Commit

Permalink
fix: correct error type (#88)
Browse files Browse the repository at this point in the history
* fix raise error problem

* fix CI
  • Loading branch information
IncubatorShokuhou committed Jul 15, 2021
1 parent 1d1097c commit 51a8e70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepforest/cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def _get_layer(self, layer_idx):
"The layer index should be in the range [0, {}], but got {}"
" instead."
)
raise ValueError(msg.format(self.n_layers_ - 1, layer_idx))
raise IndexError(msg.format(self.n_layers_ - 1, layer_idx))

layer_key = "layer_{}".format(layer_idx)

Expand Down Expand Up @@ -1598,7 +1598,7 @@ def _check_target_values(self, y):

def _check_array_numeric(self, y):
"""Check the input numpy array y is all numeric."""
numeric_types = np.typecodes['AllInteger'] + np.typecodes["AllFloat"]
numeric_types = np.typecodes["AllInteger"] + np.typecodes["AllFloat"]
if y.dtype.kind in numeric_types:
return True
else:
Expand Down

0 comments on commit 51a8e70

Please sign in to comment.