Skip to content

Commit

Permalink
Merge branch 'main' into fix-RET505-superfluous-else-return
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Oct 5, 2024
2 parents d9bb953 + 5281602 commit a2c672e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ ignore = [
"B904", # raise-without-from-inside-except
"B909", # loop-iterator-mutation
"BLE001", # blind-except
"C404", # unnecessary-list-comprehension-dict
"C414", # unnecessary-double-cast-or-process
"C416", # unnecessary-comprehension
"COM812", # missing-trailing-comma
Expand Down
2 changes: 1 addition & 1 deletion python/grass/pydispatch/robustapply.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ def robustApply(receiver, *arguments, **named):
)
# fc does not have a **kwds type parameter, therefore
# remove unacceptable arguments.
named = dict([(k, v) for k, v in named.items() if k in acceptable])
named = {k: v for k, v in named.items() if k in acceptable}
return receiver(*arguments, **named)
6 changes: 2 additions & 4 deletions python/grass/pygrass/modules/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ def read_gisrc(gisrc):
True
"""
with open(gisrc) as gfile:
gis = dict(
[(k.strip(), v.strip()) for k, v in [row.split(":", 1) for row in gfile]]
)
gis = {k.strip(): v.strip() for k, v in [row.split(":", 1) for row in gfile]}
return gis["MAPSET"], gis["LOCATION_NAME"], gis["GISDBASE"]


Expand Down Expand Up @@ -603,7 +601,7 @@ def get_works(self):
indx = row * cols + col
inms[key] = "%s@%s" % (self.inlist[key][indx], self.mset.name)
# set the computational region, prepare the region parameters
bbox = dict([(k[0], str(v)) for k, v in box.items()[:-2]])
bbox = {k[0]: str(v) for k, v in box.items()[:-2]}
bbox["nsres"] = "%f" % reg.nsres
bbox["ewres"] = "%f" % reg.ewres
new_mset = (
Expand Down
9 changes: 3 additions & 6 deletions python/grass/pygrass/modules/interface/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ def get_env():
if gisrc is None:
raise RuntimeError("You are not in a GRASS session, GISRC not found.")
with open(gisrc) as grc:
return dict(
[
(k.strip(), v.strip())
for k, v in [row.split(":", 1) for row in grc if row]
]
)
return {
k.strip(): v.strip() for k, v in [row.split(":", 1) for row in grc if row]
}


def get_debug_level():
Expand Down
2 changes: 1 addition & 1 deletion utils/g.html2man/ghtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@


def setify(d):
return dict([(key, frozenset(val)) for key, val in d.items()])
return {key: frozenset(val) for key, val in d.items()}


def omit(allowed, tags):
Expand Down

0 comments on commit a2c672e

Please sign in to comment.