-
Notifications
You must be signed in to change notification settings - Fork 100
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
Fix location if section list is empty #451
Conversation
self.sec_index = int(np.argmax(np.linalg.norm(points, axis=1))) | ||
else: | ||
self.sec_index = int(np.argmax(points.dot(self.direction))) | ||
if len(points) > 0: |
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.
But what will happen if this fails? Isn't that an exception?
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.
yes, here: https://github.com/BlueBrain/BluePyOpt/blob/master/bluepyopt/ephys/locations.py#L432
as sec_index =None (default) value I didn't bother raising the same again
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.
I was almost gonna say it was ok like this. But then I realized that this function is called set_sec_index. The user of this method would expect something to happen to sec_index when it is being called. (Let's say e.g. sec_index was set to a certain value before the call, it would not even set to None again if no points were found). I think an exception here is the safest, because in the end ... it is an exception ;-)
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.
sure, better like that?
No description provided.