-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Update plotly dash overview dashboards (combined old dashboards) #1288
Conversation
#1249 is about the older plotly dashboards not doing so well locally due to gunicorn / dash interaction issues, thus flask was needed. The newest dashboards no longer have that issue thus the fix that was reverted. I can break the pr down further. |
Thanks for clarifying! We can revert the old PR then. We can break this PR into two PRs:
|
Thanks for the suggestion. Updated this current PR and the ncSumComp dashboard PR is here |
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 for the work here Josh! I took a first look at your PR. A few high level comments:
- use
snake_case
for filenames, and spell things out a little more so the names aren't ambiguous. So this file can be calledoverview_combined.py
- That file is a bit difficult to read. I think it would be more readable if we had helper functions for each type of graph or stat that we are collecting.
Thanks for the review. Updated the filename using snake_case and other comments. Regarding the helper functions, I'm not entirely sure if it will enhance readability as there are many customizations for each graph (and the variety of graphs in our dashboard), so a function won't really reduce the lines of code, e.g. calling go.Figure vs. px.bar. Let me know if there are other ways to help with readability (perhaps more documentation?) |
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.
Looking good!
I would still suggest to encapsulate code into functions. Readability is not always about reducing line count; sometimes, code is more readable if we actually make it longer.
E.g., I think it would be helpful to encapsulate all the code to get various counts into a single function get_counts_dict
that returns a dict, mapping a count string name to the value.
Ditto for the graphs: I think encapsulating the logic to make each graph also makes the code more readable. This helps us know exactly what purpose a line of code is serving (i.e., if it's within a function, then it serves the purpose of that function).
At the moment, the code is difficult to read because the lines are almost all unindented, in a script style. I see that you're trying to break up the code parts by adding comments, e.g., # Day of Week Bar Chart.
. But again, I think putting that code into a function is more readable.
This is a short blog post talking more about functions and code readability: https://dev.to/glocore/tip-create-functions-to-improve-code-readability-2kme. It makes a great point about hiding implementation details: if a teammate is trying to read this file for the first time, it's overwhelming to understand every single line at once. But if we put more code into functions, then they can treat that function as a black box to more easily get an overall idea of what this file is doing. Let me know if that makes sense! |
Thanks for the review and clarifiaction on the code readability. I have added functions for the graphs and a function for the count. Let me know if there's anything else I could do to enhance readabilty. |
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.
Looks great, thanks for your patience working on this Josh! Just a few small comments. I'm approving it, so feel free to merge after handling the comments.
Thanks for the comprehensive review Nich! |
Fixes #1197 (Pt2 - Overview combined dashboards)
dev
branchAny questions? See the getting started guide