IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
234 stars 120 forks source link

Enable `colors` as list in `plot.pie()` #563

Closed danielhuppmann closed 3 years ago

danielhuppmann commented 3 years ago

Please confirm that this PR has done the following:

Description of PR

This PR enables passing an explicit colors arg as list to to the pie plot, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pie.html

It also implements the title keyword argument, which was previously ignored in the implementation, and future-proofs pandas (using min(level=0) will be disabled).

codecov[bot] commented 3 years ago

Codecov Report

Merging #563 (c4b7935) into main (32fcd33) will increase coverage by 0.0%. The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #563   +/-   ##
=====================================
  Coverage   93.6%   93.7%           
=====================================
  Files         50      50           
  Lines       5313    5322    +9     
=====================================
+ Hits        4978    4987    +9     
  Misses       335     335           
Impacted Files Coverage Δ
pyam/plotting.py 92.9% <100.0%> (+<0.1%) :arrow_up:
tests/test_plotting.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 32fcd33...c4b7935. Read the comment docs.

danielhuppmann commented 3 years ago

Thanks for the suggestions, all implemented!

Not quite sure what you mean by adding a test for resolving a future-warning? If you go back to a previous test run, section "Test with pytest", line 270, there is a warning that this particular code will stop working. If you compare this to the current test runs, this warning is gone. (There are plenty of others, though, tackling them one at a time).

gidden commented 3 years ago

Not quite sure what you mean by adding a test for resolving a future-warning? If you go back to a previous test run, section "Test with pytest", line 270, there is a warning that this particular code will stop working. If you compare this to the current test runs, this warning is gone. (There are plenty of others, though, tackling them one at a time).

Specifically the line

mins = pd.concat([allmins, intermins]).groupby(level=0).min()

I was curious it is was possible to add any test for this. If not, that's fine.

gidden commented 3 years ago

Ahh ok, I understand now. Thanks!