-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should variable-unit pairs be unique in a scenario (ensemble)? #338
Comments
@gidden @znicholls @byersiiasa @khaeru @Rlamboll - any comments or preferences? |
Comments but no preferences:
|
I've been assuming model / scenario / region /variable / time is a unique key, and throwing errors if I see multiple units for a variable, so everything would need to be filtered before being put into Silicone if you allow multiple unit/variable pairs. It's worth focusing on the fact that the values we use in calculations are mostly the gas concentrations themselves (no -equiv), so I'd be happier with always specifying what equivalence we mean in the units than having a separate column for My general response to the Why Could That Happen is that any specific sub-task should use a specific, filtered DataFrame anyway. I encounter a version of this problem when constructing the basket-values and then downscaling them, and simply have one DataFrame with CO2-equiv values to calculate the baskets and another with the gas-specific measurements to downscale. |
Well, so at least we identified one potential misunderstanding between the different tools! One immediate reaction, though - the current |
No strong thoughts from me! Discussion here looks good. |
Hi all - picking this back up after our units-related PRs are starting to wrap up. First things are that perhaps this should be picked up a bit higher than this toolchain in the IAMC data group, as suggested by @khaeru:
My immediate gut reaction is that variables should have a unique unit mapping (in pyam). Reasons for this is:
But that is only my gut feeling, and those having implemented already the unit conversions might have more informed opinions. @danielhuppmann, @khaeru, others? |
I'm not opposed to that approach in principle, just slightly worried about how big the refactoring will be... If someone volunteers to go ahead (maybe jointly with switching to
|
Nothing new to add, and still no preferences, since I don't use pyam. If you go this route, then I would again suggest making a clear distinction in your docs re: what is (a) part of the IAMC format spec and (b) pyam behaviour (limitations/automated helpful checks). ETA: it's fine for (a) and (b) to be different, so long as the difference is advertised! |
Description
A comment by @gidden in #335 raises a thorny question that deserves its own issue for discussion (I think):
Should any variable in a scenario (or scenario ensemble) be linked to a specific unit, or should we allow non-unique combinations?
Why could that happen
IamDataFrame
combines multiple models reporting natively in different unitsdf.append(df.convert_unit(...))
(the default behaviour of unit conversion is a replacement of the data, not appending).Immediate problems?
AFAIK all functions (aggregation, etc.) work on both
variable
andunit
separately, so there is no risk of accidentally summing apples and oranges and get fruit punch. But I might be wrong...Relevant example as food for thought
One relevant example In the SR15: we had three variables
each with the unit
Mt CO2-equiv/yr
. But could also have had one variableEmissions|Kyoto Gases
and "stored" the GWP-metric in the unit.Way forward
I see three options:
pyam
assert_variable_consistency()
which returns all non-unique pairs[variable, unit]
is non-unique)The text was updated successfully, but these errors were encountered: