gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
380 stars 276 forks source link

Source file parser not working with arbitrary mfd and None bin_width #3083

Closed klunk386 closed 6 years ago

klunk386 commented 7 years ago

When trying to parse a multisource file with arbitrary mfd (discrete) using:

conv = SourceConverter()
group = nrml.parse(xml_file, conv)

the parser fails if the bin_width parameter is None: ValueError: node bin_width: Could not convert bin_width->positivefloats: could not convert string to float: None, line 41 of Data/GridMultiSources_S10_Inc_Mod.xml

I guess this parameter should not be mandatory for this type of mfd. If so, however, then the bug is within the write_source_model, which does not perform a check or use a default value.

micheles commented 6 years ago

I need the file to be able to debug the issue