pytroll / pytroll-aapp-runner

Pytroll runner for AAPP
http://pytroll-aapp-runner.readthedocs.io/en/develop/
GNU General Public License v3.0
1 stars 8 forks source link

do_ana_correction fails with ModuleNotFoundError on Python 3 due to implicit relative import #12

Closed gerritholl closed 3 years ago

gerritholl commented 3 years ago

Describe the bug

do_ana_correction uses implicit relative imports, which are not allowed in Python 3:

https://github.com/pytroll/pytroll-aapp-runner/blob/master/aapp_runner/do_ana_correction.py#L181

on Python 3, this leads to the following exception message in the logfile:

[ERROR: 2021-01-20 16:06:45 : aapp_runner] Process aapp failed: No module named 'do_avhrr_calibration'
Traceback (most recent call last):
  File "/opt/pytroll/pytroll_inst/miniconda3/envs/pytroll-py38/bin/aapp_dr_runner.py", line 949, in process_aapp
    if not do_ana_correction(config, msg, starttime):
  File "/opt/pytroll/pytroll_inst/miniconda3/envs/pytroll-py38/lib/python3.8/site-packages/aapp_runner/do_ana_correction.py", line 181, in do_ana_correction
    from do_avhrr_calibration import do_avhrr_calibration
ModuleNotFoundError: No module named 'do_avhrr_calibration'

To reproduce

I will produce a test case.

Expected behaviour

Expected to run ANA

Actual behaviour

See above: exception.

gerritholl commented 3 years ago

It appears to happen if and only if ana correction has failed, such as due to a missing reference_landmarks directory.