InVest 3.9.0 HRA ZeroDivisionError: float division by zero

Dear support team and InVEST community,

I’m trying to run the HRA model, yet I keep encountering the error “ZeroDivisionError: float division by zero”. I’ve checked and re-checked my spatially-explicit data (UTM projected) and their path, and apparently everything looks fine. I’m probably doing the procedure wrongly, but I’ve been looking to the dataset and model for a couple of days now, and I could really use your experience, thoughts and help to solve the issue.Log and (25.0 KB)

I would be much appreciated for any help!
Thank you :slight_smile:

Hi @ASVAZ , thanks for reporting this. Your tables look fine, except that there is a bug in the model that can’t handle those 0s in the DQ and Weight columns of the criteria table. If you leave the 0 in the Rating column, but use any other number for DQ and Weight, then those criteria will be ignored, which is the intent of using a value of 0 for the rating.

Let us know if that works and we’ll work on a fix to this big for a future release.

Actually there may be multiple bugs working together here. It might also be necessary to export your xlsx to a csv file.

Hi @dave , Thank you so much for the prompt and helpful reply. The model worked :relaxed: I simply changed the 0s in DQ and Weight for those criteria for which I have no data, thank you so much. A side note: the model only worked with xlsx files; for some reason when I use the csv format, it does not recognise the first column and does not proceed. Thank you!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.