-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a more informative warning when user don't enter a single mode… #64
base: master
Are you sure you want to change the base?
Adding a more informative warning when user don't enter a single mode… #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lucascr91, some comments
@@ -35,10 +35,9 @@ class Stargazer: | |||
|
|||
def __init__(self, models): | |||
self.models = models | |||
self.num_models = len(models) | |||
self.num_models = self.new_len() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not worth adding a new method, please do it inside __init__
and before checking the length
""" | ||
Adding a more informative warning when user don't enter a single model as a list | ||
""" | ||
if isinstance(self.models,list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that as of now, other containers (set
s, tuple
s...) would have worked fine. I'm OK with requiring a list, but please add a docstring to __init__
(in the format of add_line
's one) that documents this.
if isinstance(self.models,list): | ||
return len(self.models) | ||
else: | ||
raise ValueError('Models must be a list') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Models
-> "models"
, list
-> list of trained models
self.reset_params() | ||
self.extract_data() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this line
Addressing problem raised by issued #57
I create a more informative error message