def get_gsims(oqparam): """ Return an ordered list of GSIM instances from the gsim name in the configuration file or from the gsim logic tree file. :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance """ return [valid.gsim(str(rlz)) for rlz in get_gsim_lt(oqparam)]
def test_gsim(self): class FakeGsim(object): def __init__(self, arg): self.arg = arg def __repr__(self): return '<FakeGsim(%s)>' % self.arg valid.GSIM['FakeGsim'] = FakeGsim try: gsim = valid.gsim('FakeGsim', arg='0.1') self.assertEqual(repr(gsim), '<FakeGsim(0.1)>') finally: del valid.GSIM['FakeGsim']