-
Notifications
You must be signed in to change notification settings - Fork 157
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
potential wrong usage vintage_and_active_years() in message_ix tutorial #897
Comments
Hi @Tyler-lc, thanks for opening this issue :)
Of course, the values and units may differ, and I agree that The meaning of Please let me know if any of this helped you. If it doesn't, please explain your question again as precisely as you can. With all this terminology, one needs to be very precise with wording. In the meantime, I notice that your output from |
Hi @glatterf42,
The problem is that in the later exercises, we only call scen.vintage_and_active_years(). Which returns this table instead:
So, in the input we have that for each vintage year, we have 3 active years. The output, on the other hand, will have 2 years for each vintage. We end up having a mismatch between the vintage/active years combination between input and output. I think, it would be more correct to call the method using the correct filter. But I am not sure whether this input/output mismatch has an impact on the results. Regarding the message_ix version: for some reason this is the reporting when using messeage-ix show-versions in the prompt. If I manually check the list of installed packages in the anaconda prompt (using conda list), it tells me that message-ix version is the 3.9. And regarding GAMS, I have gams installed with a license. I did not add the PATH though, so that might be why it is reporting that I do not have it. But it otherwise works fine. I hope this clarified the issue. Thank you very much! Regards, |
Hi @Tyler-lc, thanks for specifying the issues here! I have just run the Your explanation makes sense to me, I agree that it makes more sense to make the Please report further occurrences of this issue as you encounter them! |
I think the best way to understand the implications of mismatched parameter data is to look at the mathematical formulation in the documentation and/or the GAMS code. From those we can draw simple conclusions. For any given
In the case in the issue description, take the example of
Another thing to consider is that, if there is an NB I have not re-read the tutorial or its Git history to discover which is intended, but generally I agree it is less confusing as a learning aid or expression of the model behaviour and modeling best practices to use the same set for |
Thanks for jumping in here! I also thought that changing |
The year_df = scenario.vintage_and_active_years((country, "wind_ppl"), in_horizon=False)
vintage_years, act_years = year_df["year_vtg"], year_df["year_act"]
base.update(
year_vtg=vintage_years,
year_act=act_years,
technology="wind_ppl",
commodity="electricity",
level="secondary",
value=1.0,
)
wind_out = make_df("output", **base, node_dest=country, time_dest="year")
scenario.add_par("output", wind_out) Which seems to suggest that for consistency, we should use @Tyler-lc's suggestion in |
From what @khaeru said, it makes sense that the results would change, because there are |
Ah, yes, per the last point: when using the full |
What happened?
In the westeros_renewable_resource and westeros_fossil_resource, when the tutorial adds parameters regarding wind_ppl and coal_ppl it uses an unfiltered vintage_and_active_years().
This means that the coal_ppl and wind_ppl will receive an input from all the possible vintage and active year combinations instead of only those that regard coal_ppl and wind_ppl
Code Sample
EDITED:
I will use westeros_renewable_resource.ipynb as an example, but this happened also in the westeros_fossil_resource.ipynb
When we are defining the input of the technology wind_ppl we use the following:
Then we go on using the vintage_years, act_years as an input for wind_ppl:
This will cause the input to have the format
On the other hand when we set up the outputs in westeros_baseline we used the following:
year_df = scenario.vintage_and_active_years((country, "wind_ppl"), in_horizon=False)
which returns this table instead:
So this creates a mismatch between the input and the output of the technology wind_ppl (but also for coal_ppl in the westeros_fossil_resource).
What did you expect to happen?
I am not sure if this creates issues with the input for the different *_ppl since the input vintages do not exist.
Versions
Additional Context
No response
The text was updated successfully, but these errors were encountered: