Skip to content

Commit

Permalink
Minor check
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanbasten-ns committed Sep 8, 2023
1 parent 6b8ffd9 commit 6218814
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions threedi_plugin_model_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def validate_grid(self, grid_file: str, result_slug: str = None) -> ThreeDiGridI
logger.warning(f"Found other grid with grid slug {grid_model_slug}, setting that grid as parent.")
return grid

if grid_file is None:
if not grid_file:
logger.error("No appropriate grid file detected, aborting")
return None

# Check whether model already contains this grid file.
for i in range(self.model.invisibleRootItem().rowCount()):
grid_item = self.model.invisibleRootItem().child(i)
if grid_item.path.with_suffix("") == Path(grid_file).with_suffix(""):
logger.warning("Model already contains this file")
logger.warning("Model already contains this grid file")
self.grid_invalid.emit(ThreeDiGridItem(Path(grid_file), ""))
return grid_item

Expand Down Expand Up @@ -124,7 +124,7 @@ def fail(msg):
result_item = ThreeDiResultItem(Path(results_path))

if self.model.contains(Path(results_path), True):
return fail("Model already contains this file")
return fail("Model already contains this result file")

# Check correct file name
if not result_item.path.name == "results_3di.nc":
Expand Down

0 comments on commit 6218814

Please sign in to comment.