pytroll / pytroll-collectors

Collector modules for Pytroll
GNU General Public License v3.0
3 stars 18 forks source link

Fix times from posttroll messages when file duration is needed #54

Closed hundahl closed 4 years ago

hundahl commented 4 years ago

This PR fixes an error in the decode_message method from the PosttrollTrigger, that was introduced in commit f30d256


Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/dist-packages/pytroll_collectors/trigger.py", line 395, in run
    self.process(msg)
  File "/usr/local/lib/python3.6/dist-packages/pytroll_collectors/trigger.py", line 111, in add_file
    self._do(pathname)
  File "/usr/local/lib/python3.6/dist-packages/pytroll_collectors/trigger.py", line 105, in _do
    mda = self.decoder(pathname)
  File "/usr/local/lib/python3.6/dist-packages/pytroll_collectors/trigger.py", line 426, in decode_message
    return fix_start_end_time(message.data)
  File "/usr/local/lib/python3.6/dist-packages/pytroll_collectors/trigger.py", line 62, in fix_start_end_time
    while mda["start_time"] > mda["end_time"]:
KeyError: 'end_time'```

Noaa-19 data only includes start_time, and end_time is calculated using 'duration' from the gatherer config. The duration parameter will be parsed to the decode_message with these changes.
codecov[bot] commented 4 years ago

Codecov Report

Merging #54 into master will increase coverage by 0.01%. The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #54      +/-   ##
=========================================
+ Coverage    4.21%   4.22%   +0.01%     
=========================================
  Files          18      18              
  Lines        2896    2909      +13     
=========================================
+ Hits          122     123       +1     
- Misses       2774    2786      +12
Impacted Files Coverage Δ
pytroll_collectors/trigger.py 0% <0%> (ø) :arrow_up:
pytroll_collectors/tests/test_trigger.py 35% <16.66%> (-3.24%) :arrow_down:

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 d283bb4...5236302. Read the comment docs.