WAPORWP icon indicating copy to clipboard operation
WAPORWP copied to clipboard

WaPOR internal import clash

Open Prikaziuk opened this issue 2 years ago • 0 comments

Dear wateraccounting,

Thank you for the great code and tutorial on the water productivity!

I have encountered a small bug that kills Module_0 notebook. During the import WaPOR is imported from ../Modules folder with the name WaPOR. When called as WaPOR.download_yearly() or any other download function from that module it fails with "WaPOR has no attribute API in L31 of download_yearly.py". I figured that this is due to re-importing WaPOR within download_yearly.py, L7.

Worked solution: import WaPOR as wp in Module_0 notebook and call respective functions as wp.download_yearly() instead of WaPOR.download_yearly()

Could you consider updating the notebook, please?

Best regards, Egor

PS could you also make paths Linux-compatible, for example with using

from pathlib import Path
output_dir = Path('..', 'Data')

Prikaziuk avatar Sep 28 '23 16:09 Prikaziuk