Update emissions.py with CO2 equivalent notation - #36
Conversation
Added CO2-eq notation as this is currently used in our AR6 and other variable templates
|
I suspect this may not work, because the underlying package, |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage 91.48% 91.48%
=======================================
Files 6 6
Lines 282 282
=======================================
Hits 258 258
Misses 24 24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Note that you edited a file that has as its first line "# DO NOT ALTER THIS FILE MANUALLY!"... |
|
@danielhuppmann good eye! 😅 @byersiiasa you should instead modify the variable _EMI_EQUIV in the file update.py. |
@khaeru sorry not quite intuitive to me here, should I add: Also - #L92 |
|
Here are the relevant pytest docs: https://docs.pytest.org/en/stable/how-to/parametrize.html To paraphrase, the 4 elements of that tuple get mapped to the function arguments named on L87, i.e. "species_in", "species_out", etc. Then you can see in the function body how those are used to call the tested function. Each line is an individual test case, so e.g.
You could test "CO2-eq" as species_in and/or species_out, depending on how you expect that it should work! |
Added a helper function to normalize CO2 variant names for consistency in comparisons. Aims to pass the tests.
| # Replace underscores and hyphens, convert to lowercase for comparison | ||
| normalized = species.lower().replace("_", "").replace("-", "") | ||
| # Treat CO2, CO2e, CO2eq, CO2_eq, CO2-eq all as equivalent | ||
| if normalized in ("co2", "co2e", "co2eq"): |
Added CO2-eq notation as this is currently used in our AR6 and other variable templates