Skip to content
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

Populate historical_emission automatically when shifting y₀ #543

Open
OFR-IIASA opened this issue Jan 25, 2022 · 2 comments
Open

Populate historical_emission automatically when shifting y₀ #543

OFR-IIASA opened this issue Jan 25, 2022 · 2 comments
Labels
enh New features & functionality

Comments

@OFR-IIASA
Copy link
Contributor

OFR-IIASA commented Jan 25, 2022

The parameter historical_emission should automatically be tracked with the value from the variable EMISS when shifting the firstmodelyear, as was explained here in issue #314.

A simple test using the Westeros tutorial (https://github.com/iiasa/message_ix/blob/main/tutorial/westeros/westeros_emissions_bounds.ipynb) showed that the parameter is indeed not populated.

This can be replicated by running the above mentioned tutorial. At the end, clone "scen" and shift the firstmodelyear in the process to 710. Retrieving the parameter "historical_emission" returns an empty dataframe, despite original scenario containing entries in the var(""EMISS).

To replicate, open the above tutorial, and before closing the database connection type:

print(scen.var("EMISS"))
scen2 = scen.clone(model, "test_historical_emission", shift_first_model_year=710, keep_solution=False)
print(scen2.par("historical_emission"))
@OFR-IIASA OFR-IIASA added the bug Doesn't work as advertised/unintended effects label Jan 25, 2022
@OFR-IIASA OFR-IIASA changed the title Parameter "historical_emission" no populated. Parameter "historical_emission" not populated. Jan 25, 2022
@khaeru khaeru changed the title Parameter "historical_emission" not populated. Parameter "historical_emission" not populated Jan 26, 2022
@khaeru
Copy link
Member

khaeru commented Jan 26, 2022

This is also linked to #254: the functionality to shift the first model year is currently embedded in the Java code of the ixmp JDBCBackend. This is both a "stack level violation" and means that the code is not currently maintained or updated with improvements in this package.

A fix will involve creating utility code (basically a single function) here that shifts the first model year in a message_ix.Scenario; then the Java code can be bypassed/never used. That function should address this bug.

@khaeru khaeru changed the title Parameter "historical_emission" not populated Populate historical_emission automatically when shifting y₀ May 30, 2022
@khaeru khaeru added enh New features & functionality and removed bug Doesn't work as advertised/unintended effects labels May 30, 2022
@khaeru
Copy link
Member

khaeru commented May 30, 2022

I've relabeled this. While it is an intuitive and straightforward thing to expect given the brief/vague description of this argument, the docs also don't promise that this should happen, it's not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

No branches or pull requests

2 participants