Water Yield - TypeError: ufunc 'isfinite'

Hello everyone,

I’m trying to run the Wayer Yield model, always receiving the TypeError: ufunc ‘isfinite’. I tried to use different versions of InVEST but this hasn’t helped.

I’ve read that other users had a similar problem in the past. I can confirm that I checked if I had no-data values and all my shapefiles are in the same coordinate system.

I attach here the logfile and my inputs (they are quite large)

Thank you for your help and assistance.

Marco[InVEST-Hydropower-Water-Yield-log-2020-09-12–19_05_43.txt|attachment]

In this link you’ll find a compressed folder with the needed data (check only the folder WaterYield please) WaterYield - Google Drive

Hey @marco.guzzetti -

Would you please re-post the log file? It doesn’t seem to have attached. Thanks!

~ Stacie

I just looked at your data, and it looks like none of the spatial layers have a NoData value set, the “background” pixels are set to 0. I know this has caused a problem with models in the past, so one thing to try is setting a NoData value and see if that helps.

~ Stacie

Just to follow up on this, the undefined nodata value is almost certainly what’s causing it (this is something we’ve seen pretty regularly across a lot of InVEST models). Defining a nodata value should be all that’s needed to fix the issue for now, and then this case will be handled properly in InVEST 3.9.

Hi @swolny and @jdouglass

thank you for your replies. I attach the log file.

Also, you are both saying that I should define a Nodata value, but I wonder whether I should assign another value different than 0.

Thank you wy_biophysical_table_lulc300.csv (885 Bytes) both,
Marco

InVEST-Hydropower-Water-Yield-log-2020-09-12–19_05_43.txt (15.7 KB)

Thanks for providing your logfile, Marco! In this case, the isfinite issue has to do with the fact that a nodata value isn’t defined at all. If a nodata value of 0 makes sense for your inputs, then it would be completely fine to use it as your nodata value.