From 27c6a4ff4d7f4d568cb70f2f0ed98daf3e59d412 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 09:43:34 +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 | 1 - 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, 4 insertions(+), 8 deletions(-) diff --git a/gpm_api/bucket/writers.py b/gpm_api/bucket/writers.py index 47f35737..fe2066e1 100644 --- a/gpm_api/bucket/writers.py +++ b/gpm_api/bucket/writers.py @@ -238,7 +238,6 @@ def write_dataset_bucket( xbin_name="lonbin", ybin_name="latbin", ): - 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 8c715568..e1a38753 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