def recipe(request): parser = MyParser() parser.parseFile(NI_GR) stru = request.param(NI_CIF) recipe = multi_phase([(F.sphericalCF, stru)], parser, fit_range=(2., 8.0, .1), values={ 'psize_G0': 200}, sg_params={'G0': 225}) return recipe
def test_MyParser_parseFile(db, data_key, meta): data_file = db[data_key] parser = MyParser() parser.parseFile(data_file, meta=meta) if meta: for key, value in meta.items(): assert parser._meta[key] == value
def test_make_contribution(db): parser = MyParser() parser.parseFile(db['Ni_gr_file']) gen_config = GenConfig("G", db['Ni_stru']) fun_config = FunConfig("f", F.sphericalCF) con_config = ConConfig(name="test", parser=parser, fit_range=(0, 8, 0.01), eq="G + B", funconfigs=[fun_config], genconfigs=[gen_config], baselines=[GaussianGenerator("B")]) con = make_contribution(con_config) assert len(con.generators) == 2
def test_ConConfig(db, kwargs, expect): parser = MyParser() parser.parseFile(db['Ni_gr_file']) stru = db['Ni_stru'] con_config = ConConfig( name="con", parser=parser, fit_range=(0., 8., .1), genconfigs=[GenConfig('G0', stru)], eq="G0", **kwargs ) for key, value in expect.items(): assert getattr(con_config, key) == value
def data(db): parser = MyParser() parser.parseFile(db["Ni_gr_file"], {"qdamp": 0.04, "qbroad": 0.02}) return parser