oafuncs 0.0.72__py2.py3-none-any.whl → 0.0.74__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oafuncs/oa_down/hycom_3hourly.py +7 -5
- {oafuncs-0.0.72.dist-info → oafuncs-0.0.74.dist-info}/METADATA +1 -1
- {oafuncs-0.0.72.dist-info → oafuncs-0.0.74.dist-info}/RECORD +6 -6
- {oafuncs-0.0.72.dist-info → oafuncs-0.0.74.dist-info}/LICENSE.txt +0 -0
- {oafuncs-0.0.72.dist-info → oafuncs-0.0.74.dist-info}/WHEEL +0 -0
- {oafuncs-0.0.72.dist-info → oafuncs-0.0.74.dist-info}/top_level.txt +0 -0
oafuncs/oa_down/hycom_3hourly.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
Author: Liu Kun && 16031215@qq.com
|
5
5
|
Date: 2024-11-01 10:31:09
|
6
6
|
LastEditors: Liu Kun && 16031215@qq.com
|
7
|
-
LastEditTime: 2024-12-01 11:
|
7
|
+
LastEditTime: 2024-12-01 13:11:33
|
8
8
|
FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\hycom_3hourly.py
|
9
9
|
Description:
|
10
10
|
EditPlatform: vscode
|
@@ -622,9 +622,11 @@ def dlownload_file(target_url, store_path, file_name, check=False):
|
|
622
622
|
delta_t = datetime.datetime.strptime(times_in_str[1], '%Y%m%d%H') - datetime.datetime.strptime(times_in_str[0], '%Y%m%d%H')
|
623
623
|
delta_t = delta_t.total_seconds() / 3600
|
624
624
|
delta_t = delta_t / 3 + 1
|
625
|
+
else:
|
626
|
+
delta_t = 1
|
625
627
|
|
626
628
|
return int(delta_t*15)
|
627
|
-
|
629
|
+
|
628
630
|
max_timeout = calculate_wait_time(file_name)
|
629
631
|
|
630
632
|
if check:
|
@@ -737,7 +739,7 @@ def get_submit_url_var(var, depth, level_num, lon_min, lon_max, lat_min, lat_max
|
|
737
739
|
|
738
740
|
|
739
741
|
def prepare_url_to_download(var, lon_min=0, lon_max=359.92, lat_min=-80, lat_max=90, download_time='2024083100', download_time_end=None, depth=None, level_num=None, store_path=None, dataset_name=None, version_name=None, check=False):
|
740
|
-
print('[bold #ecdbfe]-'*
|
742
|
+
print('[bold #ecdbfe]-'*160)
|
741
743
|
download_time = str(download_time)
|
742
744
|
if download_time_end is not None:
|
743
745
|
download_time_end = str(download_time_end)
|
@@ -857,14 +859,14 @@ def download_hourly_func(var, time_s, time_e, lon_min=0, lon_max=359.92, lat_min
|
|
857
859
|
if num_workers is None or num_workers <= 1:
|
858
860
|
# 串行方式
|
859
861
|
for i, time_str in enumerate(new_time_list):
|
860
|
-
time_str_end_index = int(min(len(time_list), int(i*ftimes+ftimes-1)))
|
862
|
+
time_str_end_index = int(min(len(time_list)-1, int(i*ftimes+ftimes-1)))
|
861
863
|
time_str_end = time_list[time_str_end_index]
|
862
864
|
prepare_url_to_download(var, lon_min, lon_max, lat_min, lat_max, time_str, time_str_end, depth, level, store_path, dataset_name, version_name, check)
|
863
865
|
progress.update(task, advance=1, description=f'[cyan]Downloading... {i+1}/{total_num}')
|
864
866
|
else:
|
865
867
|
# 并行方式
|
866
868
|
with ThreadPoolExecutor(max_workers=num_workers) as executor:
|
867
|
-
futures = [executor.submit(download_task, var, new_time_list[i], time_list[int(min(len(time_list), int(i*ftimes+ftimes-1)))], lon_min, lon_max, lat_min, lat_max, depth, level, store_path, dataset_name, version_name, check) for i in range(total_num)]
|
869
|
+
futures = [executor.submit(download_task, var, new_time_list[i], time_list[int(min(len(time_list)-1, int(i*ftimes+ftimes-1)))], lon_min, lon_max, lat_min, lat_max, depth, level, store_path, dataset_name, version_name, check) for i in range(total_num)]
|
868
870
|
for i, future in enumerate(futures):
|
869
871
|
future.add_done_callback(lambda _: progress.update(task, advance=1, description=f'[cyan]Downloading... {i+1}/{total_num}'))
|
870
872
|
else:
|
@@ -7,7 +7,7 @@ oafuncs/oa_help.py,sha256=ppNktmtNzs15R20MD1bM7yImlTQ_ngMwvoIglePOKXA,1000
|
|
7
7
|
oafuncs/oa_nc.py,sha256=ALAYfqDy5lbUNJsTU29j6ZWkM4wgqQU3p2Fxn5pkvsQ,12102
|
8
8
|
oafuncs/oa_python.py,sha256=XPTP3o7zTFzfJR_YhsKfQksa3bSYwXsne9YxlJplCEA,3994
|
9
9
|
oafuncs/oa_down/__init__.py,sha256=a6rgxHQi8spvlI-TaVEqnrDNhYsKm5_IQf7ckAZ8U4w,603
|
10
|
-
oafuncs/oa_down/hycom_3hourly.py,sha256=
|
10
|
+
oafuncs/oa_down/hycom_3hourly.py,sha256=8Cc8A8qwPtVWSHBgh7uwu81OqBhtkQ28-iOvX-il-cw,57434
|
11
11
|
oafuncs/oa_down/literature.py,sha256=dT3-7-beEzQ9mTP8LNV9Gf3q5Z1Pqqjc6FOS010HZeQ,17833
|
12
12
|
oafuncs/oa_down/refs_pdf.py,sha256=lgGKO2gQ0hRjuaBYOLeBgksJB_KXYpFcXMDwMQeYVkI,18719
|
13
13
|
oafuncs/oa_sign/__init__.py,sha256=QKqTFrJDFK40C5uvk48GlRRbGFzO40rgkYwu6dYxatM,563
|
@@ -16,8 +16,8 @@ oafuncs/oa_sign/ocean.py,sha256=xrW-rWD7xBWsB5PuCyEwQ1Q_RDKq2KCLz-LOONHgldU,5932
|
|
16
16
|
oafuncs/oa_sign/scientific.py,sha256=a4JxOBgm9vzNZKpJ_GQIQf7cokkraV5nh23HGbmTYKw,5064
|
17
17
|
oafuncs/oa_tool/__init__.py,sha256=IKOlqpWlb4cMDCtq2VKR_RTxQHDNqR_vfqqsOsp_lKQ,466
|
18
18
|
oafuncs/oa_tool/email.py,sha256=4lJxV_KUzhxgLYfVwYTqp0qxRugD7fvsZkXDe5WkUKo,3052
|
19
|
-
oafuncs-0.0.
|
20
|
-
oafuncs-0.0.
|
21
|
-
oafuncs-0.0.
|
22
|
-
oafuncs-0.0.
|
23
|
-
oafuncs-0.0.
|
19
|
+
oafuncs-0.0.74.dist-info/LICENSE.txt,sha256=rMtLpVg8sKiSlwClfR9w_Dd_5WubTQgoOzE2PDFxzs4,1074
|
20
|
+
oafuncs-0.0.74.dist-info/METADATA,sha256=uxSx1qb2044HvbyCx87jkjFy9ctgixl-Fw3Wm750vrE,22531
|
21
|
+
oafuncs-0.0.74.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
|
22
|
+
oafuncs-0.0.74.dist-info/top_level.txt,sha256=bgC35QkXbN4EmPHEveg_xGIZ5i9NNPYWqtJqaKqTPsQ,8
|
23
|
+
oafuncs-0.0.74.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|