From e6b934a36ffdc3fa5ac0046eb2a3b0bc95a82f95 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 00:45:05 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.2...v0.9.1) - [github.com/psf/black: 24.8.0 → 24.10.0](https://github.com/psf/black/compare/24.8.0...24.10.0) - [github.com/asottile/pyupgrade: v3.17.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v3.17.0...v3.19.1) - [github.com/executablebooks/mdformat: 0.7.17 → 0.7.21](https://github.com/executablebooks/mdformat/compare/0.7.17...0.7.21) - [github.com/kynan/nbstripout: 0.7.1 → 0.8.1](https://github.com/kynan/nbstripout/compare/0.7.1...0.8.1) - [github.com/nbQA-dev/nbQA: 1.8.7 → 1.9.1](https://github.com/nbQA-dev/nbQA/compare/1.8.7...1.9.1) --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cc74ac..e69f00a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -12,12 +12,12 @@ repos: - id: check-ast - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.9.1 hooks: - id: ruff args: [--fix] - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 24.10.0 hooks: - id: black language_version: python3 @@ -38,7 +38,7 @@ repos: types_or: [python, markdown, rst] additional_dependencies: [tomli] - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.19.1 hooks: - id: pyupgrade - repo: https://github.com/MarcoGorelli/madforhooks @@ -47,18 +47,18 @@ repos: # - id: conda-env-sorter # conflicts with prettier - id: check-execution-order - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.21 hooks: - id: mdformat additional_dependencies: [mdformat-gfm, mdformat-black] exclude: ^.github/ # this avoid the hook to wrongly reformats md issue template files - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 + rev: 0.8.1 hooks: - id: nbstripout args: [--keep-output] - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.7 + rev: 1.9.1 hooks: - id: nbqa-black - id: nbqa-ruff From 9033b1248635d52faaf53962601ec65e82b14a5f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 00:45:39 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- gpm/accessor/__init__.py | 2 +- gpm/bucket/__init__.py | 4 ++-- gpm/gv/__init__.py | 4 ++-- gpm/io/download.py | 2 +- gpm/visualization/__init__.py | 10 +++++----- gpm/visualization/facetgrid.py | 6 +++--- gpm/visualization/grid.py | 2 +- gpm/visualization/orbit.py | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gpm/accessor/__init__.py b/gpm/accessor/__init__.py index e60bcaa..4a429da 100644 --- a/gpm/accessor/__init__.py +++ b/gpm/accessor/__init__.py @@ -27,4 +27,4 @@ """This directory defines GPM-API xarray accessors.""" from .methods import GPM_DataArray_Accessor, GPM_Dataset_Accessor -__all__ = ["GPM_Dataset_Accessor", "GPM_DataArray_Accessor"] +__all__ = ["GPM_DataArray_Accessor", "GPM_Dataset_Accessor"] diff --git a/gpm/bucket/__init__.py b/gpm/bucket/__init__.py index fb89a2f..7600d4a 100644 --- a/gpm/bucket/__init__.py +++ b/gpm/bucket/__init__.py @@ -46,8 +46,8 @@ __all__ = [ "LonLatPartitioning", "TilePartitioning", - "read", "merge_granule_buckets", - "write_granules_bucket", + "read", "write_bucket", + "write_granules_bucket", ] diff --git a/gpm/gv/__init__.py b/gpm/gv/__init__.py index a723aea..181896f 100644 --- a/gpm/gv/__init__.py +++ b/gpm/gv/__init__.py @@ -36,10 +36,10 @@ from gpm.gv.routines import volume_matching __all__ = [ + "calibration_summary", "compare_maps", + "reflectivity_distribution", "reflectivity_scatterplot", "reflectivity_scatterplots", - "reflectivity_distribution", - "calibration_summary", "volume_matching", ] diff --git a/gpm/io/download.py b/gpm/io/download.py index 4fb5276..a0f187f 100644 --- a/gpm/io/download.py +++ b/gpm/io/download.py @@ -991,7 +991,7 @@ def download_archive( list_status = [] list_versions = [] for i, date in enumerate(dates): - warn_missing_files = not (i == 0 or i == len(dates) - 1 and date == end_time) + warn_missing_files = not (i == 0 or (i == len(dates) - 1 and date == end_time)) status, available_version = _download_daily_data( date=date, diff --git a/gpm/visualization/__init__.py b/gpm/visualization/__init__.py index b9813fe..ed596d1 100644 --- a/gpm/visualization/__init__.py +++ b/gpm/visualization/__init__.py @@ -37,12 +37,12 @@ ) __all__ = [ + "add_map_inset", + "plot_cartopy_background", + "plot_colorbar", + "plot_image", "plot_labels", - "plot_patches", "plot_map", - "plot_image", "plot_map_mesh", - "add_map_inset", - "plot_colorbar", - "plot_cartopy_background", + "plot_patches", ] diff --git a/gpm/visualization/facetgrid.py b/gpm/visualization/facetgrid.py index d9a593a..da7b805 100644 --- a/gpm/visualization/facetgrid.py +++ b/gpm/visualization/facetgrid.py @@ -299,7 +299,7 @@ def map_dataarray( FacetGrid object """ - if kwargs.get("cbar_ax", None) is not None: + if kwargs.get("cbar_ax") is not None: raise ValueError("cbar_ax not supported by FacetGrid.") cmap_params, cbar_kwargs = _process_cmap_cbar_kwargs( @@ -324,8 +324,8 @@ def map_dataarray( da_proto = da_proto.isel({self._row_var: 0}) if self._col_var in list(da_proto.dims): da_proto = da_proto.isel({self._col_var: 0}) - if kwargs.get("rgb", None): - da_proto = da_proto.isel({kwargs.get("rgb", None): 0}) + if kwargs.get("rgb"): + da_proto = da_proto.isel({kwargs.get("rgb"): 0}) x, y = _infer_xy_labels( darray=da_proto, x=x, diff --git a/gpm/visualization/grid.py b/gpm/visualization/grid.py index 3236f58..830b69a 100644 --- a/gpm/visualization/grid.py +++ b/gpm/visualization/grid.py @@ -269,7 +269,7 @@ def plot_grid_mesh( ) # Infer x and y - x, y = infer_xy_labels(xr_obj, x=x, y=y, rgb=plot_kwargs.get("rgb", None)) + x, y = infer_xy_labels(xr_obj, x=x, y=y, rgb=plot_kwargs.get("rgb")) # Create 2D mesh xarray.DataArray da = create_grid_mesh_data_array(xr_obj, x=x, y=y) diff --git a/gpm/visualization/orbit.py b/gpm/visualization/orbit.py index 6d25d90..887bc6f 100644 --- a/gpm/visualization/orbit.py +++ b/gpm/visualization/orbit.py @@ -167,7 +167,7 @@ def wrapper(*args, **kwargs): ax = args[1] if len(args) > 1 else kwargs.get("ax") # Define dimensions and coordinates - x, y = infer_map_xy_coords(da, x=kwargs.get("x", None), y=kwargs.get("y", None)) + x, y = infer_map_xy_coords(da, x=kwargs.get("x"), y=kwargs.get("y")) along_track_dim, cross_track_dim = infer_orbit_xy_dim(da, x=x, y=y) # Define kwargs