def test_well_formed_ruptures(self): converter = s.RuptureConverter(rupture_mesh_spacing=1.5, complex_fault_mesh_spacing=1.5) for fname in (SIMPLE_FAULT_RUPTURE, COMPLEX_FAULT_RUPTURE, SINGLE_PLANE_RUPTURE, MULTI_PLANES_RUPTURE): node, = read_nodes(fname, filter_ruptures, ValidNode) converter.convert_node(node)
def get_rupture(oqparam): """ Returns a hazardlib rupture by reading the `rupture_model` file. :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance """ rup_model = oqparam.inputs['rupture_model'] rup_node, = read_nodes(rup_model, lambda el: 'Rupture' in el.tag, source.nodefactory['sourceModel']) conv = sourceconverter.RuptureConverter(oqparam.rupture_mesh_spacing, oqparam.complex_fault_mesh_spacing) return conv.convert_node(rup_node)