electricitymaps-contrib
electricitymaps-contrib copied to clipboard
Check value of co2eq files at test time
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 😄 )
Hi @pierresegonne, First-time contributor here, I can try this out if it's ok for you ?
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
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!
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!
Of course, you're more welcome to give it a try
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.