From f01711f28469bcdb22d298f0d005775529d1cfea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:13:24 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- gpm_api/bucket/writers.py | 2 +- gpm_api/dataset/crs.py | 1 - gpm_api/io/download.py | 1 - gpm_api/old_dataset/reader.py | 1 - gpm_api/scripts/download_gpm_daily_data.py | 1 + gpm_api/scripts/download_gpm_files.py | 1 + gpm_api/scripts/download_gpm_monthly_data.py | 1 + gpm_api/tests/0_tmp/dataset/0_create_test_files.py | 2 -- gpm_api/utils/utils_HDF5.py | 1 + gpm_api/visualization/orbit.py | 1 - gpm_api/visualization/plot.py | 1 - 11 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gpm_api/bucket/writers.py b/gpm_api/bucket/writers.py index 968c9595..154a8ead 100644 --- a/gpm_api/bucket/writers.py +++ b/gpm_api/bucket/writers.py @@ -470,6 +470,7 @@ def write_granules_bucket( # return None + ####--------------------------------------------------------------------------. #### GPM Datasets Routines @print_task_elapsed_time(prefix="Dataset Bucket Operation Terminated.") @@ -491,7 +492,6 @@ def write_dataset_bucket( use_threads=True, **writer_kwargs, ): - df = convert_ds_to_df( ds=ds, preprocessing_function=preprocessing_function, diff --git a/gpm_api/dataset/crs.py b/gpm_api/dataset/crs.py index 30c72a51..027d70e1 100644 --- a/gpm_api/dataset/crs.py +++ b/gpm_api/dataset/crs.py @@ -317,7 +317,6 @@ def _add_proj_coords_attrs(ds, crs) -> xr.Dataset: # If available, add attributes if x_dim is not None and y_dim is not None: - # Retrieve existing coordinate attributes src_x_coord_attrs = dict(ds[x_dim].attrs) src_y_coord_attrs = dict(ds[y_dim].attrs) diff --git a/gpm_api/io/download.py b/gpm_api/io/download.py index bb40b62d..66d5b65f 100644 --- a/gpm_api/io/download.py +++ b/gpm_api/io/download.py @@ -258,7 +258,6 @@ def _download_files( progress_bar=True, verbose=False, ): - if transfer_tool == "curl": list_cmd = [ curl_cmd(src_path, dst_path, username, username) diff --git a/gpm_api/old_dataset/reader.py b/gpm_api/old_dataset/reader.py index fbfc9561..bd55b947 100644 --- a/gpm_api/old_dataset/reader.py +++ b/gpm_api/old_dataset/reader.py @@ -145,7 +145,6 @@ def _get_granule_info(filepath, scan_mode, variables, groups): """Retrieve coordinates, attributes and valid variables and groups from the HDF file.""" # Open HDF5 file with h5py.File(filepath, "r", locking=False, swmr=SWMR) as hdf: - # Get coordinates coords = get_coords(hdf, scan_mode) diff --git a/gpm_api/scripts/download_gpm_daily_data.py b/gpm_api/scripts/download_gpm_daily_data.py index b4c953d3..b94f603c 100644 --- a/gpm_api/scripts/download_gpm_daily_data.py +++ b/gpm_api/scripts/download_gpm_daily_data.py @@ -14,6 +14,7 @@ warnings.filterwarnings("ignore") sys.tracebacklimit = 0 # avoid full traceback error if occur + # -------------------------------------------------------------------------. # Click Command Line Interface decorator @click.command() diff --git a/gpm_api/scripts/download_gpm_files.py b/gpm_api/scripts/download_gpm_files.py index eff74bdb..905c54db 100644 --- a/gpm_api/scripts/download_gpm_files.py +++ b/gpm_api/scripts/download_gpm_files.py @@ -12,6 +12,7 @@ warnings.filterwarnings("ignore") sys.tracebacklimit = 0 # avoid full traceback error if occur + # -------------------------------------------------------------------------. # Click Command Line Interface decorator @click.command() diff --git a/gpm_api/scripts/download_gpm_monthly_data.py b/gpm_api/scripts/download_gpm_monthly_data.py index e8a97abb..b7d6c0f3 100644 --- a/gpm_api/scripts/download_gpm_monthly_data.py +++ b/gpm_api/scripts/download_gpm_monthly_data.py @@ -14,6 +14,7 @@ warnings.filterwarnings("ignore") sys.tracebacklimit = 0 # avoid full traceback error if occur + # -------------------------------------------------------------------------. # Click Command Line Interface decorator @click.command() diff --git a/gpm_api/tests/0_tmp/dataset/0_create_test_files.py b/gpm_api/tests/0_tmp/dataset/0_create_test_files.py index de28bd40..c4907774 100644 --- a/gpm_api/tests/0_tmp/dataset/0_create_test_files.py +++ b/gpm_api/tests/0_tmp/dataset/0_create_test_files.py @@ -19,7 +19,6 @@ def copy_attributes(original, copy): def copy_datasets_recursive(original_group, subset_group, desired_size=10): for name, item in original_group.items(): if isinstance(item, h5py.Dataset): - # Determine the subset shape (2 indices per dimension) subset_shape = tuple(min(3, dim_size) for dim_size in item.shape) @@ -38,7 +37,6 @@ def copy_datasets_recursive(original_group, subset_group, desired_size=10): subset_dataset.compression_opts = item.compression_opts elif isinstance(item, h5py.Group): - # If the item is a group, create a corresponding group in the subset file and copy its datasets recursively subgroup = subset_group.create_group(name) # Copy group attributes diff --git a/gpm_api/utils/utils_HDF5.py b/gpm_api/utils/utils_HDF5.py index cb0da16e..5de8fffa 100644 --- a/gpm_api/utils/utils_HDF5.py +++ b/gpm_api/utils/utils_HDF5.py @@ -221,6 +221,7 @@ def h5dump(filepath, group="/", dataset_attrs=True, group_attrs=True): # for item in x.keys(): # print_hdf5_shape(x[item]) + # -----------------------------------------------------------------------------. def hdf5_objects_names(hdf): l_objs = [] diff --git a/gpm_api/visualization/orbit.py b/gpm_api/visualization/orbit.py index 9ab06c4c..ae7b6288 100644 --- a/gpm_api/visualization/orbit.py +++ b/gpm_api/visualization/orbit.py @@ -188,7 +188,6 @@ def wrapper(*args, **kwargs): # - Call the function over each slice for i, slc in enumerate(list_slices): - # Retrieve contiguous data array tmp_da = da.isel(along_track=slc) diff --git a/gpm_api/visualization/plot.py b/gpm_api/visualization/plot.py index 5832999b..a921443e 100644 --- a/gpm_api/visualization/plot.py +++ b/gpm_api/visualization/plot.py @@ -447,7 +447,6 @@ def plot_map( cbar_kwargs={}, **plot_kwargs, ): - from gpm_api.checks import is_grid, is_orbit from .grid import plot_grid_map