TypeError: ufunc 'isfinite' not supported for the input types

Hello,

I’m trying to run the habitat quality model but am now stuck with the following error:

TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’

You can also find the full log here:
InVEST-natcap.invest.habitat_quality-log-2024-10-27–19_05_16.txt (5.8 KB)

I thought there might be a problem with the tiff that contains the lulc data, but to me everything looks in order (the fields have a numeric data type).

I would be grateful for some help!

Hannah

Hi @hannah_m , thanks for reporting this issue. If the LULC raster looks okay, the problem could be in the table used to reclassify the raster. Perhaps a missing value in the Sensitivity table for example.

If you can share your LULC raster and CSV inputs, we can try to reproduce this. If there is a data problem, we can try to provide a better error message in the future.

Thanks,

Hello dave,

thank you for your reply. I couldn’t find anything in the sensitivity table, but I will be checking it again to be sure.

Here is my input data:
Hannah_habitat_model_data.zip (4.1 MB)

The lulc is for a relatively big area, originally I wanted to run this to test the runtime and wether I’d need to choose a smaller study area. So I hope that is not a problem.

Thanks for sharing your data! It looks like there is a row in the sensitivity table that has a missing value in the lulc column. Could you try filling in the value or removing the row and let us know if that solves the problem?

Hi dave,

I removed the row and now everything works. Thank you for your help!

Hannah

1 Like