OasisLMF / ktools

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

footprinttocsv produces no output for large event IDs #382

Closed hchagani-oasislmf closed 4 months ago

hchagani-oasislmf commented 4 months ago

Issue Description

The component footprinttocsv allows the user to select a range of event ID values to convert. Should a range not be specified, a default range of [1, 999999999] is used. Therefore, in cases where the event ID lies above the upper default value but lower than INT_MAX, no output for those events would be produced, even though the event ID is valid.

Steps to Reproduce (Bugs only)

  1. Create a footprint file in csv format with a single entry with event ID greater than 999,999,999.
  2. Convert it to binary format with footprinttobin.
  3. Convert the binary file back to csv format with footprinttocsv without specifying a range for event IDs.

Version / Environment information

Bug found in ktools v3.12.2, but likely to have existed for a while.

Example data / logs

Using footprint file where event IDs are greater than the default maximum value:

$ footprinttocsv | head -5
event_id, areaperil_id, intensity_bin_id, probability

$ footprinttocsv -e 1-2000000000 | head -5
event_id, areaperil_id, intensity_bin_id, probability
1000000001, 1, 3, 1.0000000000e+00
1000000001, 2, 1, 1.0000000000e+00
1000000001, 3, 1, 1.0000000000e+00
1000000002, 1, 5, 1.0000000000e+00