Skip to content

Commit d8972bc

Browse files
committed
2 parents 26c455f + 525c9ff commit d8972bc

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

src/IHEWAcollect/base/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ def __init__(self, product, is_print):
9595
"""Class instantiation
9696
"""
9797
# Class self.__status['is_print']
98+
self.__status['code'] = 0
9899
vname, rtype, vdata = 'is_print', bool, is_print
99100
if self.check_input(vname, rtype, vdata):
100101
self.__status['is_print'] = vdata
101102
else:
102103
self.__status['code'] = 1
103-
104104
# Class self.__conf['product']['name']
105105
self.__conf['product']['name'] = product
106106

@@ -113,7 +113,6 @@ def __init__(self, product, is_print):
113113
v=self.__conf['product']['name'])
114114
else:
115115
raise IHEClassInitError('Base') from None
116-
117116
def _conf(self,):
118117
"""Get configuration
119118

src/IHEWAcollect/templates/NASA/GLDAS.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ def get_download_args(latlim, lonlim, date,
333333

334334
# Adjust the lon, lat limits based on the grids of the data
335335
lonlim = np.array([
336-
(y_id[0] * prod_lon_size + prod_lon_w),
337-
(y_id[1] * prod_lon_size + prod_lon_w)
336+
(x_id[0] * prod_lon_size + prod_lon_w),
337+
(x_id[1] * prod_lon_size + prod_lon_w)
338338
], dtype=np.float)
339339
latlim = np.array([
340-
(x_id[0] * prod_lat_size + prod_lat_s),
341-
(x_id[1] * prod_lat_size + prod_lat_s)
340+
(y_id[0] * prod_lat_size + prod_lat_s),
341+
(y_id[1] * prod_lat_size + prod_lat_s)
342342
], dtype=np.float)
343343
# [w,n]--[w,s]
344344
# | |

src/IHEWAcollect/templates/NASA/GPM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def start_download(args) -> int:
449449
try:
450450
# Connect to server
451451
conn = requests.get(url)
452-
# conn.raise_for_status()
452+
conn.raise_for_status()
453453
except requests.exceptions.RequestException as err:
454454
# Connect error
455455
msg = 'Not able to download {fn}, from {sr}{dr}'.format(

src/IHEWAcollect/templates/NASA/JPL.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
IHEStringError, IHETypeError, IHEKeyError, IHEFileError, IHEPassError
2525
except ImportError:
2626
from IHEWAcollect.base.exception import IHEClassInitError,\
27+
IHEStringError, IHETypeError, IHEKeyError, IHEFileError, IHEPassError
2728
# from netCDF4 import Dataset
2829

2930
# IHEWAcollect Modules

src/IHEWAcollect/templates/USGS/SSEBop.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import numpy as np
1212
import pandas as pd
1313
import requests
14-
14+
import time
1515
# from requests.auth import HTTPBasicAuth
1616
from joblib import Parallel, delayed
1717

@@ -635,5 +635,8 @@ def clean(path,log_file,part_file_name):
635635
for filename in files:
636636
# print(filename)
637637
if(part_file_name in filename):
638-
os.remove(os.path.join(root, filename))
639-
638+
try:
639+
os.remove(os.path.join(root, filename))
640+
except:
641+
time.sleep(5)
642+
os.remove(os.path.join(root, filename))

0 commit comments

Comments
 (0)