Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #4

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.257
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.0
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 23.9.1
hooks:
- id: black
language_version: python3
Expand All @@ -24,7 +24,7 @@ repos:
additional_dependencies: ["black[jupyter]"]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
types_or: [python, markdown]
Expand Down
1 change: 0 additions & 1 deletion gpm_api/bucket/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def get_cut_lon_breaks_labels(bin_spacing):
def pl_add_geographic_bins(
df, xbin_column, ybin_column, bin_spacing, x_column="lon", y_column="lat"
):

cut_lon_breaks, cut_lon_labels = get_cut_lon_breaks_labels(bin_spacing)
cut_lat_breaks, cut_lat_labels = get_cut_lat_breaks_labels(bin_spacing)
df = df.with_columns(
Expand Down
3 changes: 2 additions & 1 deletion gpm_api/bucket/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def write_granules_bucket(
####--------------------------------------------------------------------------.
#### Single GPM Granule Routines OLD


# TODO: Currently used for final merging
# --> Adapt code to use write_partitioned_dataset
def write_parquet_dataset(
Expand Down Expand Up @@ -477,6 +478,7 @@ def name_function(i):

# return None


####--------------------------------------------------------------------------.
#### GPM Datasets Routines
@print_task_elapsed_time(prefix="Dataset Bucket Operation Terminated.")
Expand All @@ -498,7 +500,6 @@ def write_dataset_bucket(
use_threads=True,
**writer_kwargs,
):

df = convert_ds_to_df(
ds=ds,
preprocessing_function=preprocessing_function,
Expand Down
1 change: 0 additions & 1 deletion gpm_api/dataset/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@


def _get_dataarray_with_spatial_dims(xr_obj):
# TODO: maybe select variable with spatial dimensions !

Check notice on line 116 in gpm_api/dataset/crs.py

View check run for this annotation

codefactor.io / CodeFactor

gpm_api/dataset/crs.py#L116

unresolved comment '# TODO: maybe select variable with spatial dimensions !' (C100)
if isinstance(xr_obj, xr.Dataset):
variables = list(xr_obj.data_vars)
if len(variables) == 0:
Expand Down Expand Up @@ -317,7 +317,6 @@

# 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)
Expand Down
1 change: 0 additions & 1 deletion gpm_api/old_dataset/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,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)

Expand Down
1 change: 1 addition & 0 deletions gpm_api/scripts/download_gpm_daily_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
warnings.filterwarnings("ignore")
sys.tracebacklimit = 0 # avoid full traceback error if occur


# -------------------------------------------------------------------------.
# Click Command Line Interface decorator
@click.command()
Expand Down
1 change: 1 addition & 0 deletions gpm_api/scripts/download_gpm_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
warnings.filterwarnings("ignore")
sys.tracebacklimit = 0 # avoid full traceback error if occur


# -------------------------------------------------------------------------.
# Click Command Line Interface decorator
@click.command()
Expand Down
1 change: 1 addition & 0 deletions gpm_api/scripts/download_gpm_monthly_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
warnings.filterwarnings("ignore")
sys.tracebacklimit = 0 # avoid full traceback error if occur


# -------------------------------------------------------------------------.
# Click Command Line Interface decorator
@click.command()
Expand Down
1 change: 0 additions & 1 deletion gpm_api/tests/0_tmp/dataset/0_create_test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def _copy_attrs(src_h5_obj, dst_h5_obj):
def _copy_datasets(src_group, dst_group, subset_size=5):
for name, h5_obj in src_group.items():
if isinstance(h5_obj, h5py.Dataset):

# Determine the subset shape (2 indices per dimension)
subset_shape, subset_chunks = _get_subset_shape_chunks(h5_obj, subset_size=subset_size)

Expand Down
1 change: 1 addition & 0 deletions gpm_api/utils/utils_HDF5.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
Parse attributes of hdf objects
parser: function parsing strings
"""
# TODO: customize missing ...

Check notice on line 66 in gpm_api/utils/utils_HDF5.py

View check run for this annotation

codefactor.io / CodeFactor

gpm_api/utils/utils_HDF5.py#L66

unresolved comment '# TODO: customize missing ...' (C100)
# Initialize dictionary with hdf keys
attr_dict = initialize_dict_with(x.attrs.keys())
# Assign values to dictionary
Expand Down Expand Up @@ -221,6 +221,7 @@
# for item in x.keys():
# print_hdf5_shape(x[item])


# -----------------------------------------------------------------------------.
def hdf5_objects_names(hdf):
l_objs = []
Expand Down
1 change: 0 additions & 1 deletion gpm_api/visualization/orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def wrapper(*args, **kwargs):

# - Call the function over each slice
for i, slc in enumerate(list_slices):

if not rgb:
# Retrieve contiguous data array
tmp_da = da.isel({"along_track": slc})
Expand Down
1 change: 0 additions & 1 deletion gpm_api/visualization/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ def plot_map(
cbar_kwargs={},
**plot_kwargs,
):

from gpm_api.checks import is_grid, is_orbit
from gpm_api.visualization.grid import plot_grid_map
from gpm_api.visualization.orbit import plot_orbit_map
Expand Down
1 change: 0 additions & 1 deletion gpm_api/visualization/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def select_transect(
transect_kwargs={},
keep_only_valid_variables=True,
):

# Identify transect isel_dict
transect_slices = get_transect_slices(
xr_obj,
Expand Down
Loading