Change the XML representation of a hazard source¶
Each hazardlib source has an XML representation and there are utilities to convert from and to XML. Here is what you need to do if you want to change the XML representation of a source, the typical use case being adding new attributes.
- decide the new format and update the file nrml_examples/source_model/mixed.xml
- decide the new validations needed and update the modules valid.py, nrml.py and sourceconverter.py accordingly
- run source_test.py and fight until all tests pass
- update sourcewriter.py and make sure all the tests in sourcewriter_test.py pass, up to reformatting of the XML
- if needed, add new tests, especially for tricky validations