laszukdawid / PyEMD

Python implementation of Empirical Mode Decompoisition (EMD) method
https://pyemd.readthedocs.io/
Apache License 2.0
867 stars 224 forks source link

Fix bug - Null IMFs on EEMD #70

Closed rfmiotto closed 4 years ago

rfmiotto commented 4 years ago

In EEMD.py the iterator all_IMFs was being used more than once, what would raise a StopIteration exception after its first use. Then, the code wasn't entering the loop to give values to E_IMF because all_IMFs was an empty list. There are 2 ways to fix this problem: (1) simply convert the iterator to a list before the next use, or (2) create two more iterators using itertools.tee. In this commit, option (2) is employed.

codecov-io commented 4 years ago

Codecov Report

Merging #70 into master will increase coverage by 0.49%. The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   88.95%   89.44%   +0.49%     
==========================================
  Files           5        5              
  Lines         652      654       +2     
  Branches      105      105              
==========================================
+ Hits          580      585       +5     
+ Misses         43       41       -2     
+ Partials       29       28       -1
laszukdawid commented 4 years ago

Thanks for creating a pull request. I see that you have created a newer version (#71) which removed something that I'd ask you here.

In general, please keep pull requests to do one thing. There was no mentioning about exposing the noise generator.