Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Oct 22, 2024
1 parent be16ac6 commit 776d99e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions python/grass/temporal/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,8 @@ def aggregate_by_topology(
filename = gs.tempfile(True)
with open(filename, "w") as file:
if weighting:
for i, name in enumerate(aggregation_list):
string = name
weight = aggregation_weights[i]
file.write("%s|%f\n" % (string, weight))
for name, weight in zip(aggregation_list, aggregation_weights):
file.write(f"{name}|{weight}\n")
else:
for name in aggregation_list:
string = "%s\n" % (name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_weighted_aggregation(self):
rasters = [
item
for item in t_rast_list.outputs.stdout.split(os.linesep)
if (len(item) > 0 and item.startswith("b_"))
if item.startswith("b_")
]
self.assertEqual(
5,
Expand Down

0 comments on commit 776d99e

Please sign in to comment.