Skip to content

Commit

Permalink
added join to reduce code t.rast.series
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit committed Feb 13, 2025
1 parent 1258613 commit 2f26e5f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions temporal/t.rast.series/t.rast.series.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

import grass.script as gs
from grass.exceptions import CalledModuleError
from pathlib import Path

############################################################################

Expand Down Expand Up @@ -136,10 +137,7 @@ def main():
if rows:
# Create the r.series input file
filename = gs.tempfile(True)
with open(filename, "w") as file:
for row in rows:
string = "%s\n" % (row["id"])
file.write(string)
Path(filename).write_text("\n".join(str(row["id"]) for row in rows))

flag = ""
if len(rows) > max_files_open:
Expand Down

0 comments on commit 2f26e5f

Please sign in to comment.