energy-data / energydata.info

energydata.info - open data and analytics for a sustainable energy future
http://energydata.info
MIT License
25 stars 6 forks source link

Wrong number of covered countries on main page #347

Closed hy347mc closed 4 years ago

hy347mc commented 4 years ago

The number of covered countries is wrong (there are not even that many countries in the world). Please find out the reason behind and fix it. Thanks!

Screen Shot 2020-03-17 at 4 44 10 PM
jodiegardiner commented 4 years ago

Hi @hy347mc,

I've looked at this one this morning. The way that number is generated is by looking at the country_code fields of all the datasets and compiling a unique set of entries which appear there, then reporting back the count. I think what's happening is that where the country field has multiple countries, for example "ALG|FRA|MOR" it counts that as 1 unique entry, then counts "ALG|FRA" as another unique entry and so on. At a glance it looks like the actual number of countries with datasets is more like 40 or 50. But definitely not 176.

This current code was from before we took over maintenance/development.

I'll write some code to better parse the country_code fields and we'll see what the actual count is.

jodiegardiner commented 4 years ago

Ok, fixed now. This took some tracking down actually but we got there. Accurate number now displayed on staging. Pushing to prod scheduled for today.

https://energydata.staging.derilinx.com/

hy347mc commented 4 years ago

Ok, fixed now. This took some tracking down actually but we got there. Accurate number now displayed on staging. Pushing to prod scheduled for today.

https://energydata.staging.derilinx.com/

Hi Jodie, it is still not working. The number is still wrong. Please fix asap.

jodiegardiner commented 4 years ago

solved

hy347mc commented 4 years ago

solved

Confirmed. Thanks Jodie!