Skip to content

Commit

Permalink
Update swmmanywhere/preprocessing.py
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com>
  • Loading branch information
barneydobson and dalonsoa authored Mar 1, 2024
1 parent a6dcc46 commit 2f9b169
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions swmmanywhere/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def next_directory(keyword: str, directory: Path) -> int:
int: Next directory number.
"""
existing_dirs = [int(d.name.split("_")[-1]) for d in directory.glob(f"{keyword}_*"))]
next_dir_number = 1 if not existing_dirs else max(existing_dirs) + 1
return next_dir_number
return 1 if not existing_dirs else max(existing_dirs) + 1

def check_bboxes(bbox: tuple[float, float, float, float],
data_dir: Path) -> int | bool:
Expand Down

0 comments on commit 2f9b169

Please sign in to comment.