IAMconsortium / pyam

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

Add profiler/benchmark module #583

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 adds a "profile" module collecting some utility code for benchmarking and profile tests that I used for working on #580. This module is not intended to be tested or executed automatically as part of the CI/CD

codecov[bot] commented 3 years ago

Codecov Report

Merging #583 (abd65ba) into main (151e330) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #583   +/-   ##
=====================================
  Coverage   93.7%   93.7%           
=====================================
  Files         50      50           
  Lines       5339    5339           
=====================================
  Hits        5004    5004           
  Misses       335     335           

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 151e330...abd65ba. Read the comment docs.

danielhuppmann commented 3 years ago

Thanks for the suggestions, @phackstock: my strategy here was to keep all changes related to profiling contained within this folder until we have figured out whether pytest-monitor is indeed the best solution for our use case. I also did some more experiments with memory-profiler...

I suggest to merge this PR as is and then continue working on performance improvements and other benchmarking/profiling tests.

phackstock commented 3 years ago

@danielhuppmann sounds like a sensible approach to me. Having a benchmarking suite as part of the main branch of pyam is a good thing for sure. From my side we are good to merge. We just should keep in mind to eventually move the .gitignore and the dependencies into the main program once we have a stable benchmarking environment. Maybe it's worth putting a note into the README that the benchmarking is still a work in progress for now.

danielhuppmann commented 3 years ago

Added a note to the module-readme per suggestion by @phackstock

danielhuppmann commented 3 years ago

Merging as is this is only an exploratory, work-in-progress module with no interconnection to the existing functionality of the package.