diff --git a/gui/wxpython/animation/temporal_manager.py b/gui/wxpython/animation/temporal_manager.py index 2273ccfd9d6..9f9eafd41d0 100644 --- a/gui/wxpython/animation/temporal_manager.py +++ b/gui/wxpython/animation/temporal_manager.py @@ -288,26 +288,23 @@ def _getLabelsAndMaps(self, timeseries): followsPoint = True lastTimeseries = series end = None - else: - end = end - # interval data - if series: - # map exists, stop point mode - listOfMaps.append(series) - afterPoint = False - elif afterPoint: - # check point mode - if followsPoint: - # skip this one, already there - followsPoint = False - continue - else: - # append the last one (of point time) - listOfMaps.append(lastTimeseries) - end = None + elif series: + # map exists, stop point mode + listOfMaps.append(series) + afterPoint = False + elif afterPoint: + # check point mode + if followsPoint: + # skip this one, already there + followsPoint = False + continue else: - # append series which is None - listOfMaps.append(series) + # append the last one (of point time) + listOfMaps.append(lastTimeseries) + end = None + else: + # append series which is None + listOfMaps.append(series) timeLabels.append((start, end, unit)) return timeLabels, listOfMaps diff --git a/gui/wxpython/psmap/frame.py b/gui/wxpython/psmap/frame.py index 2334dc0acab..3cb9a9f48ae 100644 --- a/gui/wxpython/psmap/frame.py +++ b/gui/wxpython/psmap/frame.py @@ -2230,9 +2230,7 @@ def ComputeZoom(self, rect): zoomFactor = 1 # when zooming to full extent, in some cases, there was zoom # 1.01..., which causes problem - if abs(zoomFactor - 1) > 0.01: - zoomFactor = zoomFactor - else: + if abs(zoomFactor - 1) <= 0.01: zoomFactor = 1.0 if self.mouse["use"] == "zoomout": diff --git a/gui/wxpython/psmap/instructions.py b/gui/wxpython/psmap/instructions.py index 8b71c3d2df9..2ae68a91069 100644 --- a/gui/wxpython/psmap/instructions.py +++ b/gui/wxpython/psmap/instructions.py @@ -1733,17 +1733,13 @@ def Read(self, instruction, text, **kwargs): def EstimateHeight(self, raster, discrete, fontsize, cols=None, height=None): """Estimate height to draw raster legend""" if discrete == "n": - if height: - height = height - else: + if not height: height = self.unitConv.convert( value=fontsize * 10, fromUnit="point", toUnit="inch" ) if discrete == "y": - if cols: - cols = cols - else: + if not cols: cols = 1 rinfo = gs.raster_info(raster) @@ -1772,9 +1768,7 @@ def EstimateWidth( if discrete == "n": rinfo = gs.raster_info(raster) minim, maxim = rinfo["min"], rinfo["max"] - if width: - width = width - else: + if not width: width = self.unitConv.convert( value=fontsize * 2, fromUnit="point", toUnit="inch" ) @@ -1785,14 +1779,10 @@ def EstimateWidth( width += textPart elif discrete == "y": - if cols: - cols = cols - else: + if not cols: cols = 1 - if width: - width = width - else: + if not width: paperWidth = ( paperInstr["Width"] - paperInstr["Right"] - paperInstr["Left"] ) @@ -1872,14 +1862,10 @@ def Read(self, instruction, text, **kwargs): def EstimateSize(self, vectorInstr, fontsize, width=None, cols=None): """Estimate size to draw vector legend""" - if width: - width = width - else: + if not width: width = fontsize / 24.0 - if cols: - cols = cols - else: + if not cols: cols = 1 vectors = vectorInstr["list"] diff --git a/pyproject.toml b/pyproject.toml index 09f17caef7c..2b7f41dd947 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -183,7 +183,6 @@ ignore = [ "PLR6104", # non-augmented-assignment "PLR6201", # literal-membership "PLR6301", # no-self-use - "PLW0127", # self-assigning-variable "PLW0406", # import-self "PLW0602", # global-variable-not-assigned "PLW0603", # global-statement diff --git a/python/grass/temporal/core.py b/python/grass/temporal/core.py index 0df95106e0f..60479cf4e08 100644 --- a/python/grass/temporal/core.py +++ b/python/grass/temporal/core.py @@ -479,7 +479,6 @@ def get_available_temporal_mapsets(): tgis_mapsets = {} for mapset in mapsets: - mapset = mapset driver = c_library_interface.get_driver_name(mapset) database = c_library_interface.get_database_name(mapset) diff --git a/temporal/t.rast.accdetect/t.rast.accdetect.py b/temporal/t.rast.accdetect/t.rast.accdetect.py index 49953246037..887616f7a1c 100644 --- a/temporal/t.rast.accdetect/t.rast.accdetect.py +++ b/temporal/t.rast.accdetect/t.rast.accdetect.py @@ -238,7 +238,7 @@ def main(): ) ) if indicator.find("@") >= 0: - indicator = indicator + indicator_id = indicator else: indicator_id = indicator + "@" + mapset diff --git a/temporal/t.rast.accumulate/t.rast.accumulate.py b/temporal/t.rast.accumulate/t.rast.accumulate.py index 46ea4d7c326..9f711667000 100644 --- a/temporal/t.rast.accumulate/t.rast.accumulate.py +++ b/temporal/t.rast.accumulate/t.rast.accumulate.py @@ -272,7 +272,7 @@ def main(): ) if upper.find("@") >= 0: - upper = upper + upper_id = upper else: upper_id = upper + "@" + mapset