Skip to content

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

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.num_models = self.new_len()
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