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

1235-Dashboard-add radio buttons w moving average breakdown by wk and mo, normalize by population per 10k people and update labels #1242

Closed
wants to merge 13 commits into from

Conversation

piotrsan
Copy link
Member

@piotrsan piotrsan commented Jun 9, 2022

Fixes #{issue number here}

  • Up to date with dev branch
  • Branch name follows guidelines
  • All PR Status checks are successful
  • Peer reviewed and approved

Any questions? See the getting started guide

@piotrsan piotrsan changed the title Data science issue #150 311-data issue #1235 Jun 9, 2022
@nichhk nichhk self-requested a review June 11, 2022 19:08
Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

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

Thanks for working on this Piero!

Please update the title and description of this PR to reflect the changes that you've made.

Most of my comments are related to readability, and I know some of the issues already existed beforehand. We are working on improving the readability of our code, and we're asking everyone to improve where they can. Sorry for the extra requests, but I think it will be valuable for future contributions!

@piotrsan piotrsan changed the title 311-data issue #1235 1235-Dashboard-add dropdown with breakdown of council avg by wk and mo and change labels Jun 12, 2022
piotrsan added a commit to piotrsan/311-data that referenced this pull request Jun 13, 2022
Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

Can you include screenshots of the updated dashboard?

Please run an auto-formatter. There are some simple issues with spacing. Also, quote usage is inconsistent. Please use double-quotes throughout the file.

Please add ".idea/*" to ".gitignore". We don't want local IDE configs to be included in the repo


total_sum_df['nc_ma'] = total_sum_df.counts.rolling(selected_timeframe, center=True).mean()/NEIGHBORHOOD_COUNCILS_NUMBER
Copy link
Member

Choose a reason for hiding this comment

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

When we have any type of literal (in this case, "nc_ma") that's being used multiple times throughout the code, it's good to make a constant for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you give me an example for this? I am not sure I quite get what you mean.

Copy link
Member

Choose a reason for hiding this comment

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

You can make a constant like:

NC_MOVING_AVERAGE_KEY = "nc_ma" # Key for neighborhood council moving average in dataframe.

Similar to how you made a constant for the number of neighborhood councils.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Nich, I implemented this, but I am not sure it is correct. I don't completely understand why I would create a variable name to a column name, other than having a place where I can write a comment about what the variable does. Am I getting this right?

@piotrsan
Copy link
Member Author

Here is the current screenshot of the first part of the Dashboard:
image

Here how it looks with 7day MA.
image


total_sum_df['nc_ma'] = total_sum_df.counts.rolling(selected_timeframe, center=True).mean()/NEIGHBORHOOD_COUNCILS_NUMBER
Copy link
Member

Choose a reason for hiding this comment

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

You can make a constant like:

NC_MOVING_AVERAGE_KEY = "nc_ma" # Key for neighborhood council moving average in dataframe.

Similar to how you made a constant for the number of neighborhood councils.

Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

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

Just a few more style changes. Looking good!

@nichhk
Copy link
Member

nichhk commented Jun 21, 2022

It's totally fine for this PR, but in the future, let's split this into two PRs: one for the name change, and one for the moving average change.

@piotrsan
Copy link
Member Author

Thanks Nich.

I have implemented some normalization, should that be made into a new ull request?

@nichhk
Copy link
Member

nichhk commented Jul 14, 2022

Yes, please make a new PR. But before you make the PR, please open an issue explaining why we need normalization

Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

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

Thanks Piero! I see that you resolved several comments, but it doesn't seem like they were fixed. Did you forget to push some commits?

Hi Nich, sorry I did not make commits between the comment addressing and the population adjustment, next time I will make sure to create a new PR before I start working on the next issue
Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

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

Thanks Piero! Just a few more comments.

@piotrsan piotrsan changed the title 1235-Dashboard-add dropdown with breakdown of council avg by wk and mo and change labels 1235-Dashboard-add radio buttons w moving average breakdown by wk and mo, normalize by population per 10k people and update labels Jul 28, 2022
@piotrsan
Copy link
Member Author

Hi Nich,

thanks for the comments. I implemented all changes and restricted this particular dashboard for showcasing how a specific council compares to the average (this has to be done by normalizing by population for the comparison to be meaningful). I removed the raw counts, which can be visualized in other dashboards or in a different graph if needed.

@piotrsan
Copy link
Member Author

The current visualization is done using population data from NC_pop_2020.csv which was generated from arcGS public data analysis (it is not clear how the analysis is done by the app). Anupriya will provide the final numbers through her careful analysis, which can then be integrated into the dashboard.

@ryanfchase ryanfchase mentioned this pull request Nov 19, 2023
9 tasks
@Skydodle
Copy link
Member

Closed without merge due to outdated PR & irrelevant to current working branch main.

@Skydodle Skydodle closed this Jan 24, 2024
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.

3 participants