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

Update expected figures to use matplotlib 3.5 #590

Merged
merged 5 commits into from
Nov 24, 2021

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Nov 16, 2021

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Name of contributors Added to AUTHORS.rst
  • Description in RELEASE_NOTES.md Added

Description of PR

Alerted by the nightly tests... It seems that matplotlib v3.5 changed the order of the legends in stackplot-figures with totals. This PR simply updates the test-figures to reflect the new behavior (alternative approach: change the way that the "total" is added to the legend).

In addition, the PR silences a warning in the plotting module and changes the readme and install-bat-file from py.test to pytest (because this seems to be the more common usage).

@codecov
Copy link

codecov bot commented Nov 16, 2021

Codecov Report

Merging #590 (ff161a3) into main (20df347) will not change coverage.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #590   +/-   ##
=====================================
  Coverage   94.2%   94.2%           
=====================================
  Files         50      50           
  Lines       5331    5331           
=====================================
  Hits        5022    5022           
  Misses       309     309           
Impacted Files Coverage Δ
pyam/plotting.py 92.9% <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 20df347...ff161a3. Read the comment docs.

Copy link
Member

@gidden gidden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the nightlies! Small question in review.

@@ -437,7 +437,7 @@ def stack(

def as_series(index, name):
_idx = [i[0] for i in index]
return pd.Series([0] * len(index), index=_idx, name=name)
return pd.Series([0] * len(index), index=_idx, name=name, dtype="int")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear why this is needed, can you let me know why?

Can this be sent through calling code? e.g., either with

  1. move this dtype up as a kwarg or
  2. add generic **kwargs which then passes through to this series call

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a function only used within this function (see just the following line) to select the rows where a timeseries crosses zero. Adding the dtype explicitly is done just to silence a warning in the log.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha - won't hold up. But I assume this will not work for non-integer times?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facepalm reread, and realize no issue here. sorry!

@gidden gidden merged commit 732752c into IAMconsortium:main Nov 24, 2021
@danielhuppmann danielhuppmann deleted the plotting/matplotlib-3.5 branch November 24, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants