OasisLMF / ktools

In-memory simulation kernel for loss modelling.
BSD 3-Clause "New" or "Revised" License
29 stars 18 forks source link

validatevulnerability: rules for checking damage_bin_index (damage bin IDs are contiguous and start at bin index 1) not necessary #397

Open FangWeihua opened 4 days ago

FangWeihua commented 4 days ago

Issue Description

    while (fread(&vulnerability, sizeof(vulnerability), 1, fin) != 0) {
      if (v.find(vulnerability.vulnerability_id) !=
   v.end()) { // only process those vulnerabilities that are in the item
       // file
 assignProbabilities(vulnerability.vulnerability_id,
       current_vulnerability_id,
       vulnerability.intensity_bin_id,
       vulnerability.damage_bin_id,
       vulnerability.probability);
      }
    }

Steps to Reproduce (Bugs only)

For example, the damage bin IDs does not start at bin index 1, in the vulnerability file of the following url, but it works.

https://github.com/OasisLMF/OasisLMF/tree/main/tests/assets/test_model_1

Version / Environment information

ktool. Release v3.12.4