From 5e2a8ad12858d7aa32220a491c228fa59e98c656 Mon Sep 17 00:00:00 2001 From: Jacob Bieker Date: Tue, 2 Nov 2021 14:40:00 +0000 Subject: [PATCH] Add more ignore and tqdm in script --- requirements.txt | 1 + satip/eumetsat.py | 14 -------------- satip/intermediate.py | 4 ++-- satip/utils.py | 2 ++ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/requirements.txt b/requirements.txt index c7dcbea8..5ff240e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ satpy>=0.30.1 zarr xarray bottleneck +tqdm diff --git a/satip/eumetsat.py b/satip/eumetsat.py index e77d7318..aa713402 100644 --- a/satip/eumetsat.py +++ b/satip/eumetsat.py @@ -1,17 +1,3 @@ -__all__ = [ - "request_access_token", - "query_data_products", - "format_dt_str", - "identify_available_datasets", - "dataset_id_to_link", - "json_extract", - "check_valid_request", - "DownloadManager", - "get_dir_size", - "get_filesize_megabytes", - "eumetsat_filename_to_datetime", -] - import pandas as pd from typing import Union, List diff --git a/satip/intermediate.py b/satip/intermediate.py index 13a52a66..c81c8392 100644 --- a/satip/intermediate.py +++ b/satip/intermediate.py @@ -10,6 +10,7 @@ import multiprocessing from itertools import repeat import xarray as xr +from tqdm import tqdm processed_queue = multiprocessing.Queue(maxsize = 64) @@ -65,7 +66,7 @@ def create_or_update_zarr_with_native_files( ): tasks.append(pool.apply_async(native_wrapper, args=(entry,))) num_tasks = len(remaining_days) - while num_tasks > 0: + for _ in tqdm(range(num_tasks, 0, -1)): dataset, hrv_dataset = processed_queue.get(block=True) if dataset is not None and hrv_dataset is not None: save_dataset_to_zarr( @@ -86,7 +87,6 @@ def create_or_update_zarr_with_native_files( ) del dataset del hrv_dataset - num_tasks -= 1 def pool_init(q): diff --git a/satip/utils.py b/satip/utils.py index 965937fe..cdcc4eff 100644 --- a/satip/utils.py +++ b/satip/utils.py @@ -18,6 +18,8 @@ warnings.filterwarnings("ignore", message="divide by zero encountered in true_divide") warnings.filterwarnings("ignore", message="invalid value encountered in sin") warnings.filterwarnings("ignore", message="invalid value encountered in cos") +warnings.filterwarnings("ignore", message="invalid value encountered in double_scalars") +warnings.filterwarnings("ignore", message="invalid value encountered in true_divide") warnings.filterwarnings( "ignore", message="You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems",