From b73eae5edb5300605f0e2bd022cb50cc44bf382e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:40:43 -0400 Subject: [PATCH] style: Fix not-in-test (E713) and not-is-test (E714) (#4011) * style: Fix not-is-test (E714) * style: Fix not-in-test (E713) --- gui/wxpython/gmodeler/model.py | 4 ++-- gui/wxpython/gui_core/forms.py | 6 +++--- gui/wxpython/psmap/dialogs.py | 4 ++-- gui/wxpython/vnet/vnet_data.py | 2 +- pyproject.toml | 2 -- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gui/wxpython/gmodeler/model.py b/gui/wxpython/gmodeler/model.py index 1c572e8d618..d729c43a87a 100644 --- a/gui/wxpython/gmodeler/model.py +++ b/gui/wxpython/gmodeler/model.py @@ -2166,9 +2166,9 @@ def _processData(self): prompt = param.get("prompt", None) value = self._filterValue(self._getNodeText(param, "value")) - intermediate = not data.find("intermediate") is None + intermediate = data.find("intermediate") is not None - display = not data.find("display") is None + display = data.find("display") is not None rels = [] for rel in data.findall("relation"): diff --git a/gui/wxpython/gui_core/forms.py b/gui/wxpython/gui_core/forms.py index 14b21515478..95cbf55d7e9 100644 --- a/gui/wxpython/gui_core/forms.py +++ b/gui/wxpython/gui_core/forms.py @@ -995,7 +995,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar not_hidden = [ p for p in self.task.params + self.task.flags - if not p.get("hidden", False) is True + if p.get("hidden", False) is not True ] self.label_id = [] # wrap titles on resize @@ -1057,7 +1057,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar # flags # visible_flags = [ - f for f in self.task.flags if not f.get("hidden", False) is True + f for f in self.task.flags if f.get("hidden", False) is not True ] for f in visible_flags: # we don't want another help (checkbox appeared in r58783) @@ -1124,7 +1124,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar # parameters # visible_params = [ - p for p in self.task.params if not p.get("hidden", False) is True + p for p in self.task.params if p.get("hidden", False) is not True ] try: diff --git a/gui/wxpython/psmap/dialogs.py b/gui/wxpython/psmap/dialogs.py index 73653bbfd3a..6094c805e60 100644 --- a/gui/wxpython/psmap/dialogs.py +++ b/gui/wxpython/psmap/dialogs.py @@ -4284,7 +4284,7 @@ def updateRasterLegend(self): else: self.rLegendDict["range"] = False - if not self.id[0] in self.instruction: + if self.id[0] not in self.instruction: rasterLegend = RasterLegend(self.id[0], env=self.env) self.instruction.AddInstruction(rasterLegend) self.instruction[self.id[0]].SetInstruction(self.rLegendDict) @@ -4404,7 +4404,7 @@ def updateVectorLegend(self): else: self.vLegendDict["border"] = "none" - if not self.id[1] in self.instruction: + if self.id[1] not in self.instruction: vectorLegend = VectorLegend(self.id[1], env=self.env) self.instruction.AddInstruction(vectorLegend) self.instruction[self.id[1]].SetInstruction(self.vLegendDict) diff --git a/gui/wxpython/vnet/vnet_data.py b/gui/wxpython/vnet/vnet_data.py index 51c3d374cef..f7803439e60 100644 --- a/gui/wxpython/vnet/vnet_data.py +++ b/gui/wxpython/vnet/vnet_data.py @@ -694,7 +694,7 @@ def _getInvalidParams(self, params): except (KeyError, ValueError): table = None - if not table or not params[col] in list(columnchoices.keys()): + if not table or params[col] not in list(columnchoices.keys()): invParams.append(col) continue diff --git a/pyproject.toml b/pyproject.toml index 5e9d68915d3..f7cc89a7257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,8 +139,6 @@ ignore = [ "DTZ011", # call-date-today "E401", # multiple-imports-on-one-line "E402", # module-import-not-at-top-of-file - "E713", # not-in-test - "E714", # not-is-test "E721", # type-comparison "E722", # bare-except "E731", # lambda-assignment