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

Gobierto Visualizations / Costs: refactor and update data #3932

Merged
merged 6 commits into from
Sep 27, 2021

Conversation

jorgeatgu
Copy link
Contributor

Closes https://github.com/PopulateTools/issues/issues/1335

✌️ What does this PR do?

  • Refactor the code to remove references to the year 2019.
  • Add new text about covid19
  • Update 2019 and 2020 population data.

🔍 How should this be manually tested?

Staging

for (let amounts = 0; amounts < amountStrings.length; amounts++) {
d[amountStrings[amounts]] = convertStringToNumbers(
d[amountStrings[amounts]]
);
}
}

let yearsCosts = [...new Set(rawData.map(item => item.any_))];
function getPopulation(year) {
Copy link
Member

Choose a reason for hiding this comment

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

This function is totally worthless:

  1. There is only one use (L160)
  2. It's running over and over through the yearsCosts array
  3. yearsCosts array is defined outside the function

Why not this? The current code is quite hard to understand

const ix = yearsCosts.findIndex(x => x === d["any_"])
d.population = population[ix]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better, done.

@furilo
Copy link
Member

furilo commented Sep 8, 2021

What's pending to merge this?

@jorgeatgu
Copy link
Contributor Author

What's pending to merge this?

Last Friday, they changed some data, so we are pending their review.

@ferblape
Copy link
Member

ferblape commented Sep 8, 2021

Careful, the test that it's failing is caused by the text you updated, please review https://app.circleci.com/pipelines/github/PopulateTools/gobierto/4546/workflows/4cb58281-9e50-497c-bfe6-c690a0fb848b/jobs/39397

@jorgeatgu
Copy link
Contributor Author

Careful, the test that it's failing is caused by the text you updated, please review https://app.circleci.com/pipelines/github/PopulateTools/gobierto/4546/workflows/4cb58281-9e50-497c-bfe6-c690a0fb848b/jobs/39397

Done!

@jorgeatgu jorgeatgu merged commit b1d1ebc into master Sep 27, 2021
@jorgeatgu jorgeatgu deleted the 1335_mataro_costs branch September 27, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants