Skip to content

Commit 44aaeee

Browse files
authored
Merge pull request #735 from ssec/pre-commit-ci-update-config
2 parents 71d1dfe + 52d37f7 commit 44aaeee

File tree

8 files changed

+20
-24
lines changed

8 files changed

+20
-24
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ exclude: '^$'
22
fail_fast: false
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: 'v0.8.6'
5+
rev: 'v0.9.4'
66
hooks:
77
- id: ruff
88
args: ["--fix"]

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def setup(app):
588588
{title_underline}
589589
590590
:Grid Name: {area_name}
591-
:Description: {area_dict['description']}
591+
:Description: {area_dict["description"]}
592592
:Projection: {crs.to_string()}
593593
"""
594594

polar2grid/_glue_argparser.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _add_common_arguments(parser: argparse.ArgumentParser, binary_name: str) ->
228228
dest="verbosity",
229229
action="count",
230230
default=0,
231-
help="each occurrence increases verbosity 1 level through " "ERROR-WARNING-INFO-DEBUG (default INFO)",
231+
help="each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default INFO)",
232232
)
233233
parser.add_argument("-l", "--log", dest="log_fn", default=None, help="specify the log filename")
234234
parser.add_argument(
@@ -288,22 +288,22 @@ def _validate_reader_writer_args(parser, args, use_polar2grid_defaults):
288288
parser.print_usage()
289289
parser.exit(
290290
1,
291-
"\nERROR: Reader must be provided (-r flag).\n" "Supported readers:\n\t{}\n".format(
291+
"\nERROR: Reader must be provided (-r flag).\nSupported readers:\n\t{}\n".format(
292292
"\n\t".join(_supported_readers(use_polar2grid_defaults))
293293
),
294294
)
295295
elif len(args.readers) > 1:
296296
parser.print_usage()
297297
parser.exit(
298298
1,
299-
"\nMultiple readers is not currently supported. Got:\n\t" "{}\n".format("\n\t".join(args.readers)),
299+
"\nMultiple readers is not currently supported. Got:\n\t{}\n".format("\n\t".join(args.readers)),
300300
)
301301
return -1
302302
if args.writers is None:
303303
parser.print_usage()
304304
parser.exit(
305305
1,
306-
"\nERROR: Writer must be provided (-w flag) with one or more writer.\n" "Supported writers:\n\t{}\n".format(
306+
"\nERROR: Writer must be provided (-w flag) with one or more writer.\nSupported writers:\n\t{}\n".format(
307307
"\n\t".join(_supported_writers(use_polar2grid_defaults))
308308
),
309309
)
@@ -390,7 +390,7 @@ def add_scene_argument_groups(parser, is_polar2grid=False):
390390
dest="readers",
391391
metavar="READER",
392392
type=_convert_reader_name,
393-
help="Name of reader used to read provided files. " "Supported readers: " + ", ".join(readers),
393+
help="Name of reader used to read provided files. Supported readers: " + ", ".join(readers),
394394
)
395395
group_1.add_argument(
396396
"-f",
@@ -502,7 +502,7 @@ def add_writer_argument_groups(parser, is_polar2grid=False):
502502
dest="writers",
503503
type=_convert_writer_name,
504504
metavar="WRITER",
505-
help="Writer used to save datasets. " "Supported writers: " + ", ".join(writers),
505+
help="Writer used to save datasets. Supported writers: " + ", ".join(writers),
506506
# help="Writers to save datasets with. Multiple writers "
507507
# "can be provided by specifying '-w' multiple "
508508
# "times (ex. '-w geotiff -w awips_tiled'). "
@@ -608,7 +608,7 @@ def add_resample_argument_groups(parser, is_polar2grid=None):
608608
"--grid-coverage",
609609
default=0.1,
610610
type=float,
611-
help="Fraction of target grid that must contain " "data to continue processing product.",
611+
help="Fraction of target grid that must contain data to continue processing product.",
612612
)
613613
group_1.add_argument(
614614
"--cache-dir",
@@ -620,9 +620,7 @@ def add_resample_argument_groups(parser, is_polar2grid=None):
620620
"--grid-configs",
621621
nargs="+",
622622
default=tuple(),
623-
help="Specify additional grid configuration files. "
624-
"(.conf for legacy CSV grids, .yaml for "
625-
"SatPy-style areas)",
623+
help="Specify additional grid configuration files. (.conf for legacy CSV grids, .yaml for SatPy-style areas)",
626624
)
627625
group_1.add_argument(
628626
"--ll-bbox",

polar2grid/add_coastlines.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def _get_colorbar_vmin_vmax(arg_min, arg_max, metadata, input_dtype):
6666
dtype_max = float(np.iinfo(input_dtype).max)
6767
if arg_min is None and scale is None:
6868
LOG.warning(
69-
"Colorbar min/max metadata not found and not provided "
70-
"on the command line. Defaulting to data type limits."
69+
"Colorbar min/max metadata not found and not provided on the command line. Defaulting to data type limits."
7170
)
7271
return dtype_min, dtype_max
7372

@@ -458,7 +457,7 @@ def _args_to_colorbar_kwargs(args):
458457
if args.colorbar_width is None or args.colorbar_height is None:
459458
if args.colorbar_width is not None or args.colorbar_height is not None:
460459
LOG.warning(
461-
"'--colorbar-width' and '--colorbar-height' were not both specified. " "Forcing '--colorbar-extend'."
460+
"'--colorbar-width' and '--colorbar-height' were not both specified. Forcing '--colorbar-extend'."
462461
)
463462
args.colorbar_extend = True
464463

@@ -531,7 +530,7 @@ def _get_colormap_object(input_tiff, num_bands, cmin, cmax):
531530
metadata = rio_ds.tags()
532531
cmap = _convert_table_to_cmap_or_default_bw(input_dtype, rio_ct, num_bands)
533532
if num_bands in (3, 4) and colormap_csv is None:
534-
raise ValueError("RGB and RGBA geotiffs must have a colormap " "specified with '--colorbar-colormap-file'.")
533+
raise ValueError("RGB and RGBA geotiffs must have a colormap specified with '--colorbar-colormap-file'.")
535534
if num_bands in (3, 4) or colormap_csv is not None:
536535
cmap = Colormap.from_string(colormap_csv)
537536
vmin, vmax = _get_colorbar_vmin_vmax(cmin, cmax, metadata, input_dtype)

polar2grid/readers/_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ def get_available_products(
106106
p2g_product_names = self.get_all_products()
107107
if not p2g_product_names:
108108
logger.warning(
109-
"Provided readers are not configured in %s. All "
110-
"products will be listed with internal Satpy names.",
109+
"Provided readers are not configured in %s. All products will be listed with internal Satpy names.",
111110
self._binary_name,
112111
)
113112
return sorted(set([x["name"] for x in possible_satpy_ids])), [], []

polar2grid/readers/modis_l1b.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ def add_reader_argument_groups(
277277
dest="products",
278278
action=ExtendConstAction,
279279
const=_AWIPS_TRUE_COLOR,
280-
help="Add individual CREFL corrected products to create " "the 'true_color' composite in AWIPS.",
280+
help="Add individual CREFL corrected products to create the 'true_color' composite in AWIPS.",
281281
)
282282
group.add_argument(
283283
"--awips-false-color",
284284
dest="products",
285285
action=ExtendConstAction,
286286
const=_AWIPS_FALSE_COLOR,
287-
help="Add individual CREFL corrected products to create " "the 'false_color' composite in AWIPS.",
287+
help="Add individual CREFL corrected products to create the 'false_color' composite in AWIPS.",
288288
)
289289
group.add_argument(
290290
"--mask-saturated",

polar2grid/writers/geotiff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def add_writer_argument_groups(parser, group=None):
7979
"--dtype",
8080
choices=NumpyDtypeList(NUMPY_DTYPE_STRS),
8181
type=str_to_dtype,
82-
help="Data type of the output file (8-bit unsigned " "integer by default - uint8)",
82+
help="Data type of the output file (8-bit unsigned integer by default - uint8)",
8383
)
8484
group.add_argument(
8585
"--no-enhance",

polar2grid/writers/hdf5.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def write_geolocation(
185185
self, fh, fname: str, parent: str, area_def, dtype: np.dtype, append: bool, compression, chunks: tuple[int, int]
186186
) -> tuple[list, list[FakeHDF5]]:
187187
"""Delayed Geolocation Data write."""
188-
msg = ("Adding geolocation 'longitude' and " "'latitude' datasets for grid %s", parent)
188+
msg = ("Adding geolocation 'longitude' and 'latitude' datasets for grid %s", parent)
189189
LOG.info(msg)
190190
lon_data, lat_data = area_def.get_lonlats(chunks=chunks)
191191

@@ -216,7 +216,7 @@ def create_variable(hdf_fh, hdf_subgroup: str, data_arr: xr.DataArray, dtype: np
216216
d_dtype = data_arr.dtype if dtype is None else dtype
217217

218218
if hdf_subgroup in hdf_fh:
219-
LOG.warning("Product %s already in HDF5 group," "will delete existing dataset", hdf_subgroup)
219+
LOG.warning("Product %s already in HDF5 group,will delete existing dataset", hdf_subgroup)
220220
del hdf_fh[hdf_subgroup]
221221

222222
dset = hdf_fh.create_dataset(hdf_subgroup, shape=data_arr.shape, dtype=d_dtype, compression=compression)
@@ -252,7 +252,7 @@ def save_datasets(
252252

253253
filename = output_names[0]
254254
if not all_equal(output_names):
255-
LOG.warning("More than one output filename possible. " "Writing to only '{}'.".format(filename))
255+
LOG.warning("More than one output filename possible. Writing to only '{}'.".format(filename))
256256

257257
HDF5_fh = self.open_HDF5_filehandle(filename, append=append)
258258

0 commit comments

Comments
 (0)