Skip to content

Commit

Permalink
useful error/warnings!
Browse files Browse the repository at this point in the history
  • Loading branch information
raamana committed Dec 18, 2019
1 parent 49b47d2 commit 4a5ccf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pyradigm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def __init__(self,

if np.issubdtype(dtype, np.generic):
self._dtype = dtype
else:
raise TypeError('data type for features {} not recognized!'
'It must be a subdtype of np.generic'
''.format(dtype))

if not isinstance(allow_nan_inf, (bool, str)):
raise TypeError('allow_nan_inf flag can only be bool or str')
Expand Down
2 changes: 1 addition & 1 deletion pyradigm/regress.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def get_target(self, target_id):

non_existent = set(self.target_set).intersection(set(target_ids))
if len(non_existent) < 1:
raise ValueError('These classes {} do not exist in this dataset.'
raise ValueError('These targets {} do not exist in this dataset.'
''.format(non_existent))

subsets = list()
Expand Down

0 comments on commit 4a5ccf3

Please sign in to comment.