Habitat risk assessment - TypeError: float() argument must be a string or a real number, not 'NoneType'

Hi All, i have problem when executing the HRA model, the error messages as below:

06/18/2024 11:04:43 natcap.invest.hra INFO The maximum pairwise risk score for multiplicative risk is 9.0
06/18/2024 11:04:43 natcap.invest.utils ERROR Exception while executing natcap.invest.hra
Traceback (most recent call last):
File “natcap\invest\utils.py”, line 164, in prepare_workspace
File “invest\cli.py”, line 470, in main
File “natcap\invest\hra.py”, line 531, in execute
File “natcap\invest\hra.py”, line 1934, in _parse_criteria_table
TypeError: float() argument must be a string or a real number, not ‘NoneType’
06/18/2024 11:04:43 natcap.invest.utils INFO Elapsed time: 0.09s
06/18/2024 11:04:43 natcap.invest.utils INFO Execution finished

I was attahced the tabel, please to have your comment and solution… thank you
criteria_score_newcsv_180624.csv (3.2 KB)
tabel habitat stressor.csv (392 Bytes)

Hello @faizal , welcome to the forums!

It appears that the quoting has gotten very messed up in your CSV formatting. All of your criteria table rows are quoted like this:

"recruitment rate,2,2,2,2,2,2,3,2,2,C,""<enter (3) every 2+ yrs,  (2) every 1-2 yrs, (1) every <1 yrs, or (0) no score>"""

You can see that there are an increasing number of quotes every time one appears (not sure how that happened). Your best bet here will be to open up Notepad or your text editor of choice and properly quote all of the text fields so that each field is individually quoted:

"recruitment rate",2,2,2,2,2,2,3,2,2,"C","<enter (3) every 2+ yrs,  (2) every 1-2 yrs, (1) every <1 yrs, or (0) no score>"

And you’ll need to do this for the entire file. Once you have finished this, please try re-running the model with the new table.

Let us know if you have any questions,
James

Hi @jdouglass thank you for your prompt response. I just find the problem, there is a different format of csv in my office, and now the problem was solved.

I have another problem, since I ran the HRA model, the result of total_risk_ecosystem looks only half of the area of interest, here I attached the pic.

Well, the fact that there are some areas present and not others make this look like a data issue. I can’t identify just from this image which layer might be at fault, but could you make sure that your AOI covers the whole area you expect, and also that each of the aligned_* rasters in your intermediate folder look as you would expect?

If that doesn’t get you to the specific layer that’s missing data, please share your complete set of inputs so I can take a closer look. The easiest way to do this is by sharing a data archive from the InVEST workbench.

Thanks,
James

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