NRCan / CanFlood

Flood Risk modelling toolbox for Canada
MIT License
29 stars 7 forks source link

Store Inventory assertion error (at 95%) #31

Closed blhumphreys closed 2 years ago

blhumphreys commented 2 years ago

I am trying to follow tutorial 2a with my own data. Several of the nested 'cap' fields in my inventory feature class are entirely null, which leads to a warning message and the finv CSV not being stored in the working folder. I have tried manually exporting the inventory attribute table to CSV, but found that the model could not be validated when using this.

The following warning message is generated when I attempt to store the inventory data: WARNING cf.BuildDialog.finv_to_csv: CanFlood_RiskL2_SimpleEvents1_SFD_R0a dropping 3 (of 44) empty fields

The following warning message is generated when I attempt to validate the model: WARNING cf.BuildDialog.run_validate: risk2 error 2: no value provided for 'risk_fps.dmgs'. optional=False INFO cf.BuildDialog.set_cf_pars: updated control file w/ 2 pars at : FILE_PATH\CanFlood_RiskL2_SimpleEvents1_SFD_R0a.txt INFO cf.BuildDialog.cf_mark: risk2=False INFO cf.BuildDialog.run_validate: passed 0 (of 2) validations. see log for errors

Additional info:

cefect commented 2 years ago

hi @blhumphreys, sorry to hear of your struggles. Are you able to run tutorial 2a with the tutorial data?

The empty fields should not be the issue (to test this, you could drop them before running the finv store tool).

As for the failed validation, it looks like you have not specified the damage curves yet... thus the validation is failing. There may be a second issue... but I don't think you've provided enough log info for us to see this.

To investigate the failure of the inventory compiler further we'll need:

jdngibson commented 2 years ago

Hi @blhumphreys, I have received the data you have provided and I will see if I can identify the source of the error.

blhumphreys commented 2 years ago

Thanks @jdngibson. Please let me know if you have any questions.

cefect commented 2 years ago

hi @blhumphreys, wrt your 'Store' inventory issue, if you read the python error log, you should see that the 'scale' fields in your inventory are of the wrong type:

image002

We'll improve this error message in the next release. You can change the field types using the Refactor tool. NOTE all of the scale fields are the wrong type (I'm not sure how this happened to the LMFRA sfd inventory).

Also, from your log file it seems like you're trying to use an incomplete curve library (the LMFRA inventory uses some rfda curves). You'll need to combine all the curves you need in your inventory into a single curves.xls (like this one).

As for the validation error, review tutorial 2a where it explains what's required.

Hope this helps,

blhumphreys commented 2 years ago

Thank you for the help @cefect. This solved my problem, and the merging the curves into a single file allowed the model to run.