IAMconsortium / pyam

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

Add an "annualized growth rate" feature #604

Closed danielhuppmann closed 2 years ago

danielhuppmann commented 2 years ago

Please confirm that this PR has done the following:

Description of PR

This PR adds a growth_rate() method to the timeseries and compute modules so it can be called as

df.compute.growth_rate({"Primary Energy|Wind": "Growth rate of Wind"})

where df is an IamDataFrame, or

pyam.timeseries.growth_rate(x)

where x is a pd.Series indexed over an (integer) time domain.

codecov[bot] commented 2 years ago

Codecov Report

Merging #604 (b91feff) into main (8dc1d27) will increase coverage by 0.0%. The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #604   +/-   ##
=====================================
  Coverage   94.2%   94.3%           
=====================================
  Files         52      53    +1     
  Lines       5415    5471   +56     
=====================================
+ Hits        5106    5162   +56     
  Misses       309     309           
Impacted Files Coverage Δ
pyam/core.py 94.4% <ø> (ø)
pyam/compute.py 100.0% <100.0%> (ø)
pyam/timeseries.py 96.9% <100.0%> (+0.6%) :arrow_up:
tests/test_feature_growth_rate.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 8dc1d27...b91feff. Read the comment docs.