rakhimov / scram

Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)
https://scram-pra.org
GNU General Public License v3.0
131 stars 54 forks source link

floating point format mismatch between loading and saving files #282

Open swilske opened 5 years ago

swilske commented 5 years ago

Having a simple model with only one basic event which has a constant value of "25e-9". If you save this model to xml, close scram-gui, reopen it and load the file you get an error.

The file i get:

<?xml version="1.0" encoding="UTF-8"?>
<opsa-mef>
  <model-data>
    <define-basic-event name="BE">
      <label>BE1</label>
      <float value="2,5e-08"/>
    </define-basic-event>
  </model-data>
</opsa-mef>

The error i get:

Invalid input file

File: /home/user/theses/computation/safety/testFile.xml
Line: 6

Error details:

scram::xml::ValidityError

Element float failed to validate attributes

If you change the float value to 25e-9 instead of 2,5e-8 (2.5e-8 does not work as well), it now works fine.

EDIT: SCRAM 0.16.2 on Ubuntu 18.04 64 bit

rakhimov commented 5 years ago

Thank you for reporting in a so detailed manner. Yes, it seems GUI is localizing floats upon saves.