From 92cf465412d31ff57728dc8eb3c58fafbd419816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 10 Jul 2024 23:03:21 -0400 Subject: [PATCH] style: Fix if-expr-min-max (FURB136) (#4026) --- pyproject.toml | 1 - python/grass/pygrass/modules/grid/split.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 25832ce3ea5..19c011d7bb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,7 +162,6 @@ ignore = [ "FURB118", # reimplemented-operator "FURB129", # readlines-in-for "FURB131", # delete-full-slice - "FURB136", # if-expr-min-max "FURB140", # reimplemented-starmap "FURB142", # for-loop-set-mutations "FURB148", # unnecessary-enumerate diff --git a/python/grass/pygrass/modules/grid/split.py b/python/grass/pygrass/modules/grid/split.py index afd747090b0..cac604327d8 100644 --- a/python/grass/pygrass/modules/grid/split.py +++ b/python/grass/pygrass/modules/grid/split.py @@ -29,10 +29,10 @@ def get_bbox(reg, row, col, width, height, overlap): east = reg.west + ((col + 1) * width + overlap) * reg.ewres west = reg.west + (col * width - overlap) * reg.ewres return Bbox( - north=north if north <= reg.north else reg.north, - south=south if south >= reg.south else reg.south, - east=east if east <= reg.east else reg.east, - west=west if west >= reg.west else reg.west, + north=min(north, reg.north), + south=max(south, reg.south), + east=min(east, reg.east), + west=max(west, reg.west), )