Skip to content

Commit

Permalink
Add noqa for D417
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Nov 21, 2023
1 parent 47f5467 commit 33f354f
Show file tree
Hide file tree
Showing 30 changed files with 49 additions and 1,835 deletions.
2 changes: 1 addition & 1 deletion doc/source/reader_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def rst_table_row(columns=None):
return row


def rst_table_header(name=None, header=None, header_rows=1, widths="auto"):
def rst_table_header(name=None, header=None, header_rows=1, widths="auto"): # noqa: D417
"""Create header for rst table.
Args:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ line_length = 120
# In the future, add "B", "S", "N"
select = ["A", "D", "E", "W", "F", "I", "PT", "TID", "C90", "Q", "T10", "T20"]
line-length = 120
ignore = ["D417"]

[tool.ruff.per-file-ignores]
"satpy/tests/*" = ["S101"] # assert allowed in tests
Expand Down
12 changes: 6 additions & 6 deletions satpy/composites/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class CategoricalDataCompositor(CompositeBase):
res = [[20, 40, 30], [50, 30, 10]]
"""

def __init__(self, name, lut=None, **kwargs):
def __init__(self, name, lut=None, **kwargs): # noqa: D417
"""Get look-up-table used to recategorize data.
Args:
Expand Down Expand Up @@ -381,7 +381,7 @@ class GenericCompositor(CompositeBase):

modes = {1: "L", 2: "LA", 3: "RGB", 4: "RGBA"}

def __init__(self, name, common_channel_mask=True, **kwargs):
def __init__(self, name, common_channel_mask=True, **kwargs): # noqa: D417
"""Collect custom configuration values.
Args:
Expand Down Expand Up @@ -679,7 +679,7 @@ class DayNightCompositor(GenericCompositor):
of the image (night or day). See the documentation below for more details.
"""

def __init__(self, name, lim_low=85., lim_high=88., day_night="day_night", include_alpha=True, **kwargs):
def __init__(self, name, lim_low=85., lim_high=88., day_night="day_night", include_alpha=True, **kwargs): # noqa: D417
"""Collect custom configuration values.
Args:
Expand Down Expand Up @@ -1014,7 +1014,7 @@ def __call__(self, projectables, *args, **kwargs):
class CloudCompositor(GenericCompositor):
"""Detect clouds based on thresholding and use it as a mask for compositing."""

def __init__(self, name, transition_min=258.15, transition_max=298.15,
def __init__(self, name, transition_min=258.15, transition_max=298.15, # noqa: D417
transition_gamma=3.0, **kwargs):
"""Collect custom configuration values.
Expand Down Expand Up @@ -1357,7 +1357,7 @@ class StaticImageCompositor(GenericCompositor, DataDownloadMixin):
"""

def __init__(self, name, filename=None, url=None, known_hash=None, area=None,
def __init__(self, name, filename=None, url=None, known_hash=None, area=None, # noqa: D417
**kwargs):
"""Collect custom configuration values.
Expand Down Expand Up @@ -1735,7 +1735,7 @@ def _get_flag_value(mask, val):
class LongitudeMaskingCompositor(SingleBandCompositor):
"""Masks areas outside defined longitudes."""

def __init__(self, name, lon_min=None, lon_max=None, **kwargs):
def __init__(self, name, lon_min=None, lon_max=None, **kwargs): # noqa: D417
"""Collect custom configuration values.
Args:
Expand Down
2 changes: 1 addition & 1 deletion satpy/composites/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SimulatedGreen(GenericCompositor):
"""

def __init__(self, name, fractions=(0.465, 0.465, 0.07), **kwargs):
def __init__(self, name, fractions=(0.465, 0.465, 0.07), **kwargs): # noqa: D417
"""Initialize fractions for input channels.
Args:
Expand Down
2 changes: 1 addition & 1 deletion satpy/composites/agri.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SimulatedRed(GenericCompositor):
"""

def __init__(self, name, fractions=(1.0, 0.13, 0.87), **kwargs):
def __init__(self, name, fractions=(1.0, 0.13, 0.87), **kwargs): # noqa: D417
"""Initialize fractions for input channels.
Args:
Expand Down
2 changes: 1 addition & 1 deletion satpy/composites/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HighlightCompositor(GenericCompositor):
"""

def __init__(self, name, min_highlight=0.0, max_highlight=10.0,
def __init__(self, name, min_highlight=0.0, max_highlight=10.0, # noqa: D417
max_factor=(0.8, 0.8, -0.8, 0), **kwargs):
"""Initialize composite with highlight factor options.
Expand Down
4 changes: 2 additions & 2 deletions satpy/dataset/data_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_best_dataset_key(key, choices):
return [choice for choice, distance in zip(sorted_choices, distances) if distance == distances[0]]


def get_key(key, key_container, num_results=1, best=True, query=None,
def get_key(key, key_container, num_results=1, best=True, query=None, # noqa: D417
**kwargs):
"""Get the fully-specified key best matching the provided key.
Expand Down Expand Up @@ -139,7 +139,7 @@ def keys(self, names=False, wavelengths=False):
else:
return keys

def get_key(self, match_key, num_results=1, best=True, **dfilter):
def get_key(self, match_key, num_results=1, best=True, **dfilter): # noqa: D417
"""Get multiple fully-specified keys that match the provided query.
Args:
Expand Down
8 changes: 4 additions & 4 deletions satpy/dependency_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def _create_subtree_from_reader(self, dataset_key, query):
LOG.trace("Found reader provided dataset:\n\tRequested: {}\n\tFound: {}".format(dataset_key, node.name))
return node

def _find_reader_node(self, dataset_key, query):
def _find_reader_node(self, dataset_key, query): # noqa: D417
"""Attempt to find a `DataID` in the available readers.
Args:
Expand Down Expand Up @@ -517,7 +517,7 @@ def get_modifier(self, comp_id):

raise KeyError("Could not find modifier '{}'".format(modifier))

def _create_required_subtrees(self, parent, prereqs, query=None):
def _create_required_subtrees(self, parent, prereqs, query=None): # noqa: D417
"""Determine required prerequisite Nodes for a composite.
Args:
Expand All @@ -531,7 +531,7 @@ def _create_required_subtrees(self, parent, prereqs, query=None):
raise MissingDependencies(unknown_datasets)
return prereq_nodes

def _create_optional_subtrees(self, parent, prereqs, query=None):
def _create_optional_subtrees(self, parent, prereqs, query=None): # noqa: D417
"""Determine optional prerequisite Nodes for a composite.
Args:
Expand All @@ -549,7 +549,7 @@ def _create_optional_subtrees(self, parent, prereqs, query=None):

return prereq_nodes

def _create_prerequisite_subtrees(self, parent, prereqs, query=None):
def _create_prerequisite_subtrees(self, parent, prereqs, query=None): # noqa: D417
"""Determine prerequisite Nodes for a composite.
Args:
Expand Down
10 changes: 5 additions & 5 deletions satpy/enhancements/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def wrapper(data, **kwargs):
return on_dask_array(wrapper)


def piecewise_linear_stretch(
def piecewise_linear_stretch( # noqa: D417
img: XRImage,
xp: ArrayLike,
fp: ArrayLike,
Expand Down Expand Up @@ -229,7 +229,7 @@ def _cira_stretch(band_data):
return band_data


def reinhard_to_srgb(img, saturation=1.25, white=100, **kwargs):
def reinhard_to_srgb(img, saturation=1.25, white=100, **kwargs): # noqa: D417
"""Stretch method based on the Reinhard algorithm, using luminance.
Args:
Expand Down Expand Up @@ -293,7 +293,7 @@ def _lookup_table(band_data, luts=None, index=-1):
return lut[band_data]


def colorize(img, **kwargs):
def colorize(img, **kwargs): # noqa: D417
"""Colorize the given image.
Args:
Expand Down Expand Up @@ -365,7 +365,7 @@ def _merge_colormaps(kwargs, img=None):
return full_cmap


def create_colormap(palette, img=None):
def create_colormap(palette, img=None): # noqa: D417
"""Create colormap of the given numpy file, color vector, or colormap.
Args:
Expand Down Expand Up @@ -525,7 +525,7 @@ def _three_d_effect_delayed(band_data, kernel, mode):
return new_data.reshape((1, band_data.shape[0], band_data.shape[1]))


def btemp_threshold(img, min_in, max_in, threshold, threshold_out=None, **kwargs):
def btemp_threshold(img, min_in, max_in, threshold, threshold_out=None, **kwargs): # noqa: D417
"""Scale data linearly in two separate regions.
This enhancement scales the input data linearly by splitting the data
Expand Down

0 comments on commit 33f354f

Please sign in to comment.