Open mabudz opened 8 months ago
Thanks for this PR :) Getting the tests to pass is a bit tricky since the API for pyam changed when they went from version 1.9.0 to 2.0.0 (as you might expect) and our code needs to satisfy both versions since we test on Python <= 3.9, which is not supported for pyam 2.0.0. So let me take a closer look, maybe we'd want to use the function that pyam's sankey function wraps around directly, after all.
Thanks @daymontas1 for stepping up here, much appreciated :)
You should be able to test the PR as is and see how you like it's usefulness, but there are a few things that I would like to see happen before we merge it:
util/__init__.py
to somewhere more appropriate. E.g. report/sankey.py
if it's a reporting tool or util/sankey.py
if there are more general use cases.sankey_mapper
maps the correct values to the correct keys. We might also need to adapt one or two reporting tests that check the number of reporting steps if this stays in the default reporting workflow.Please feel free to ask about any of these steps if you need help :)
Hi all, to simplify here, I would simply limit this functionality to pyam > 2 - we can do a version check for this on the fly and raise an error.
Rebased onto current main and expanded the PR a bit :)
Thanks for jumping in here, @gidden :)
@daymontas1, please pull these latest changes before making further edits. If you already have some edits locally, you can git stash
them, git pull
these changes and git stash pop
your work on top of this.
The missing type hints (from the failing code quality check) probably indicate that we need to add pyam.*
to our mypy config exclude list.
The other main error I'm seeing just indicates that by adding this reporter step, we need to adapt the expected value of reporter steps in another test, which is no problem :)
Is there any update here, @daymontas1? Since we want to publish a new release still this week (most likely), I'll postpone this to the 3.10 milestone.
Hi @glatterf42, I tried to push the changes, but I didn't have permission to do so. So, you need to grant me access. This was my latest comment. Thanks.
Alright, that's good to know. @mabudz, could you please give @daymontas1 write access to your fork? You can do that under Settings -> Collaborators and Teams -> Add people. If you do that, please confirm here so we know we can proceed.
If you don't want to wait, @daymontas1, please consider pushing your changes to a branch on your fork or on the main repository: git push -u <name of the repo> <name of the branch>
. So you need to pick a repo name from the list produced by git remote -v
and can choose any branch name.
Hi @glatterf42 and @daymontas1 ,
i have added @daymontas1 to the repo ☺️
Thanks for the quick reaction, much appreciated :)
FYI all, see the GitHub docs about the “Allow edits from maintainers” option. AFAIK this is on by default, so an equivalent solution would be to add @daymontas1 to the team @iiasa/messageix-devs. Since that team has (at least) "maintainer" permissions on this repo, he would then have write access to the specific branch used in this PR (so long as @mabudz left the default value for the above option).
This avoids the work of having to (maybe) add every maintainer to every contributor's fork.
Thanks, I've also added @daymontas1 to @iiasa/messageix-devs :)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.6%. Comparing base (
ef66e37
) to head (30d8d32
). Report is 20 commits behind head on main.
Create sankey diagram and add tutorial.
The approach here creates the sankey diagram by using the sankey plot function of the
pyam
package. This function requires a mapping dictionary. The mapping dict is created by using the newly created automatic reportmessage::sankey
and a utility function ~sankey_mapper()
~map_for_sankey
.This pull request is related to the draft pull request in message_data , which can be removed, since the sankey diagram has been implemented in the
pyam
package.How to review
General approach should be reviewed. Also, I am not sure if the util function ~
sankey_mapper()
~map_for_sankey()
is at the right place.PR checklist
[x] Continuous integration checks all ✅
[x] Update release notes.