Skip to content

Commit

Permalink
style: Fix multiple-leading-hashes-for-block-comment (E266)
Browse files Browse the repository at this point in the history
Ruff rule: https://docs.astral.sh/ruff/rules/multiple-leading-hashes-for-block-comment/

For gui/wxpython/psmap/frame.py, the commented code was present since it was moved from addons to the main repo 13 years ago. At the time, both pair of lines had the same indentation, before PEP8 only formatted the second lines.

File temporal/t.rast.what/t.rast.what.py is ignored for E265 and E266, as it is being addressed in OSGeo#4550
  • Loading branch information
echoix committed Oct 20, 2024
1 parent 3e30ac8 commit b57ae32
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/psmap/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3619,7 +3619,7 @@ def _rasterLegend(self, notebook):
self.Bind(wx.EVT_CHECKBOX, self.OnIsLegend, self.isRLegend)
self.Bind(wx.EVT_RADIOBUTTON, self.OnDiscrete, self.discrete)
self.Bind(wx.EVT_RADIOBUTTON, self.OnDiscrete, self.continuous)
## self.Bind(wx.EVT_CHECKBOX, self.OnDefaultSize, panel.defaultSize)
# self.Bind(wx.EVT_CHECKBOX, self.OnDefaultSize, panel.defaultSize)
self.Bind(wx.EVT_CHECKBOX, self.OnRange, self.range)
self.rasterSelect.GetTextCtrl().Bind(wx.EVT_TEXT, self.OnRaster)

Expand Down
4 changes: 0 additions & 4 deletions gui/wxpython/psmap/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,6 @@ def OnAddRaster(self, event):
if not self._checkMapFrameExists(type_id=id):
return

## dlg = RasterDialog(self, id = id, settings = self.instruction)
# dlg.ShowModal()
if "mapNotebook" in self.openDialogs:
self.openDialogs["mapNotebook"].notebook.ChangeSelection(1)
else:
Expand All @@ -800,8 +798,6 @@ def OnAddVect(self, event):
if not self._checkMapFrameExists(type_id=id):
return

## dlg = MainVectorDialog(self, id = id, settings = self.instruction)
# dlg.ShowModal()
if "mapNotebook" in self.openDialogs:
self.openDialogs["mapNotebook"].notebook.ChangeSelection(2)
else:
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ ignore = [
"DTZ006", # call-datetime-fromtimestamp
"DTZ007", # call-datetime-strptime-without-zone
"DTZ011", # call-date-today
"E265", # no-space-after-block-comment
"E266", # multiple-leading-hashes-for-block-comment
"E402", # module-import-not-at-top-of-file
"E501", # line-too-long
"E721", # type-comparison
Expand Down Expand Up @@ -367,7 +365,7 @@ ignore = [
"temporal/t.rast.algebra/testsu*/*_algebra_arithmetic.py" = ["FLY002"]
"temporal/t.rast.colors/t.rast.colors.py" = ["SIM115"]
"temporal/t.rast.series/t.rast.series.py" = ["SIM115"]
"temporal/t.rast.what/t.rast.what.py" = ["SIM115"]
"temporal/t.rast.what/t.rast.what.py" = ["E265", "E266", "SIM115"]
"temporal/t.register/testsu*/*_raster_different_local.py" = ["FLY002"]
"temporal/t.register/testsu*/*_raster_mapmetadata.py" = ["FLY002"]
"temporal/t.register/testsuite/test_t_register_raster.py" = ["FLY002"]
Expand Down
20 changes: 10 additions & 10 deletions raster/r.proj/testsuite/test_rproj.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run_rproj_test(self, method, statics):
The expected statics of the output raster
"""
output = method
## Get the boundary and set up region for the projected map
# Get the boundary and set up region for the projected map
stdout = call_module(
"r.proj",
project=src_project,
Expand All @@ -80,7 +80,7 @@ def run_rproj_test(self, method, statics):
res=1,
)

## Project the map
# Project the map
self.assertModule(
"r.proj",
project=src_project,
Expand All @@ -91,13 +91,13 @@ def run_rproj_test(self, method, statics):
quiet=True,
)

## Validate the output
# Validate the output
self.assertRasterFitsUnivar(output, reference=statics, precision=1e-7)
self.assertRasterFitsInfo(output, reference=raster_info, precision=1e-7)

def test_nearest(self):
"""Testing method nearest"""
## Set up variables and validation values
# Set up variables and validation values
method = "nearest"
statics = """n=40930
min=55.5787925720215
Expand All @@ -109,7 +109,7 @@ def test_nearest(self):

def test_bilinear(self):
"""Testing method bilinear"""
## Set up variables and validation values
# Set up variables and validation values
method = "bilinear"
statics = """n=40845
min=56.3932914733887
Expand All @@ -121,7 +121,7 @@ def test_bilinear(self):

def test_bicubic(self):
"""Testing method bicubic"""
## Set up variables and validation values
# Set up variables and validation values
method = "bicubic"
statics = """n=40677
min=56.2407836914062
Expand All @@ -133,7 +133,7 @@ def test_bicubic(self):

def test_lanczos(self):
"""Testing method lanczos"""
## Set up variables and validation values
# Set up variables and validation values
method = "lanczos"
statics = """n=40585
min=56.2350921630859
Expand All @@ -145,7 +145,7 @@ def test_lanczos(self):

def test_bilinear_f(self):
"""Testing method bilinear_f"""
## Set up variables and validation values
# Set up variables and validation values
method = "bilinear_f"
statics = """n=40930
min=55.5787925720215
Expand All @@ -157,7 +157,7 @@ def test_bilinear_f(self):

def test_bicubic_f(self):
"""Testing method bicubic_f"""
## Set up variables and validation values
# Set up variables and validation values
method = "bicubic_f"
statics = """n=40930
min=55.5787925720215
Expand All @@ -169,7 +169,7 @@ def test_bicubic_f(self):

def test_lanczos_f(self):
"""Testing method lanczos_f"""
## Set up variables and validation values
# Set up variables and validation values
method = "lanczos_f"
statics = """n=40930
min=55.5787925720215
Expand Down

0 comments on commit b57ae32

Please sign in to comment.