OasisLMF / ktools

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

Event ID should not exceed MAX_INT when converting footprint file from csv to binary #383

Closed hchagani-oasislmf closed 3 months ago

hchagani-oasislmf commented 4 months ago

Issue Description

Model file validation checks have been a part of the corresponding csv to binary conversion tools since ktools v3.12.0 (see PR https://github.com/OasisLMF/ktools/pull/370). Currently, when using footprinttobin to convert footprint csv files to binary format, there is no check that event ID does not exceed the MAX_INT limit. This can lead to negative event IDs as a result of integer overflow, or even more dangerously positive event IDs that are reported as being 232 less than that in the csv file.

A check for this should be introduced in a similar fashion to the check on vulnerability ID in vulnerabilitytobin.

Version / Environment information

ktools >v3.12.0