-
Notifications
You must be signed in to change notification settings - Fork 79
Fix 947 #1144
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 947 #1144
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.
You can use defaultdict(list) and remove the if statement in lines 154-155
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 think it is better to use tuples rather than dictionaries in here:
{% for title, num_samples, samples in studies %}
this helps to reduce also the amount of python code.
|
Thanks @antgonza this looks way better! Few comments though... |
|
👍 |
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.
Why did you change this line? dropped_samples was already set to analysis.dropped_samples on line 145
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.
In fact, the if statement on line 147 is not needed here, since this for loop will not run if dropped_samples is empty
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.
- analysis.dropped_samples -> dropped_samples: will change, left behind by mistake
- if statement is necessary as dropped_samples is either a dict or None.
Thanks!
|
A couple small comments |
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.
@adamrp I think you suggested that this if statement can be removed. However, analysis.dropped_samples returns None if there are no dropped samples, instead of an empty list. This will make the call to viewitems to fail because of an AttributeError.
I think this should not block this PR and we should open a new issue for modifying analysis.dropped_samples so it returns consistent types (list). Do you agree?
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.
Agreed -- thanks for pointing that out, I didn't look carefully at analysis.dropped_samples before commenting.
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.
Cool! New issue created: #1152
This adds a nicer visualization of dropped samples in an analysis. This is the base to add #1091, which will be in another PR.