electricitymaps-contrib icon indicating copy to clipboard operation
electricitymaps-contrib copied to clipboard

Check value of co2eq files at test time

Open pierresegonne opened this issue 2 years ago • 2 comments

After the amazing work of @kruschk in #3937, we now have a nice setup for testing the co2eq parameter files (co2eq_parameters_all, co2eq_parameters_direct, co2eq_parameters_lifecycle)

The tests currently ran can be extended to also check the values of the given parameters. We for example currently check that origin ratios sum to 1. See: https://github.com/electricitymap/electricitymap-contrib/blob/e73130642064acd16e178a80e035b4d2584c7f8d/tests/test_co2eq_parameters.py#L79-L91

But don't run any checks on the value of the emission factors. We could for example:

  • Check that all emission factors are >= 0
  • Check that all emission factors are <= 2000
  • Could also do per mode check, using large uncertainty around the default values
  • etc (be creative 😄 )

pierresegonne avatar Apr 20 '22 12:04 pierresegonne

Hi @pierresegonne, First-time contributor here, I can try this out if it's ok for you ?

du-phan avatar Jul 04 '22 15:07 du-phan

Of course! Everyone is more than welcome to contribute :) Sorry for the delay, I was on holidays. Let me know if you need some help / guidance

pierresegonne avatar Jul 18 '22 09:07 pierresegonne

Hi, is this issue still relevant? If so, I'd like to have a look at it. I'm also a first timer, and this seems like a good place to start!

ZachEichen avatar Nov 07 '22 22:11 ZachEichen

Hey, @ZachEichen! I can't say whether this issue is still relevant because I haven't contributed in a while. I wrote the original test suite, though, so let me know if you have any questions and I'll try to answer them!

kruschk avatar Nov 08 '22 02:11 kruschk

Of course, you're more welcome to give it a try

pierresegonne avatar Nov 08 '22 08:11 pierresegonne

Quick note here, as noted in the above PR there are more potential improvements here, including splitting expected ranges into direct and lifecycle emissions sections. I plan to do that in a follow up.

qyearsley avatar May 17 '23 20:05 qyearsley