Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

- adds support for localized electric emission factors #399

Merged
merged 15 commits into from
May 19, 2020
Merged

- adds support for localized electric emission factors #399

merged 15 commits into from
May 19, 2020

Conversation

baywet
Copy link
Contributor

@baywet baywet commented May 16, 2020

This pull requests adds support for country and state specific emission factors so the user's data can be more accurate.
It relies on the following data to work https://www.carbonfootprint.com/docs/2019_06_emissions_factors_sources_for_2019_electricity.pdf
I've only ported Canadian emission factors to get early feedback on the pull request before I invest too much time. We'd need to import the rest of the dataset.

Although the code is in place to support state specific, the library I'm using doesn't seem to support returning provinces/states at the moment. I have opened an issues over there to ask them if they are planning to add the information. rapideditor/country-coder#19
I made a point to use an offline library an not any API to avoid dependency on an API key and lengthy network calls that could slow down the app when importing data.
If they don't add that support, we could either look into other libraries to bridge the gaps or lookup by country only (less precise).

TODO:

  • feedback on the current approach
  • import remaining factors

@baywet baywet marked this pull request as ready for review May 18, 2020 14:39
@corradio
Copy link
Member

Hi @baywet - thanks for the PR. This looks really good, and is definitely an improvement over what we've done. The approach looks good to me. Let me know when you're ready for the final review and I'll make a final pass 👍

@baywet
Copy link
Contributor Author

baywet commented May 18, 2020

@corradio thanks for the feedback. I was actually wrapping up the PR.

  • the main geoloc reverse lookup library I was using is not planning to add states
  • I found another library that does states for USA, Canada and Australia which I implemented in combination with the previous one
  • added all the emission factors that were listed in the document

This PR is ready to be merged whenever you have a chance :)

@corradio corradio self-requested a review May 19, 2020 06:04
@corradio corradio self-assigned this May 19, 2020
@baywet baywet requested a review from corradio May 19, 2020 14:57
Copy link
Member

@corradio corradio left a comment

Choose a reason for hiding this comment

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

Terrific! Thanks!

@corradio corradio merged commit ac85dae into electricitymaps:master May 19, 2020
@baywet baywet deleted the feature/electricity-accurate branch May 19, 2020 15:47
@baywet
Copy link
Contributor Author

baywet commented May 19, 2020

@corradio thanks for merging! when do you think I'll see it on my phone?

@corradio
Copy link
Member

We'll try to make a release within next week! Stay tuned (or ask us on Slack)

@baywet
Copy link
Contributor Author

baywet commented May 28, 2020

@corradio I just got the update on my phone and I saw the bubbles resizing and the progress bar updating live! Really cool!

@corradio
Copy link
Member

corradio commented May 28, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants