Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucascr91
Copy link

Addressing problem raised by issued #57

I create a more informative error message

Copy link
Collaborator

@toobaz toobaz left a 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()
Copy link
Collaborator

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):
Copy link
Collaborator

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 (sets, tuples...) 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')
Copy link
Collaborator

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()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants