Ejemplo n.º 1
0
def test_setPhaseDefinition(cal):
    calc = CryspyCalculator('')
    interface = QtCalculatorInterface(calc)
    interface.setPhaseDefinition(phase_path)
    phase_added = interface.getPhase('Fe3O4')
    phase_ref = cal.getPhase('Fe3O4')
    assert phase_added['phasename'] == phase_ref['phasename']
    assert phase_added['spacegroup']['crystal_system'].value == phase_ref[
        'spacegroup']['crystal_system'].value
    assert phase_added['spacegroup'][
        'space_group_name_HM_ref'].value == phase_ref['spacegroup'][
            'space_group_name_HM_ref'].value
    assert phase_added['spacegroup'][
        'space_group_IT_number'].value == phase_ref['spacegroup'][
            'space_group_IT_number'].value
    assert phase_added['spacegroup']['origin_choice'].value == phase_ref[
        'spacegroup']['origin_choice'].value
    assert phase_added['cell']['length_a'].value == phase_ref['cell'][
        'length_a'].value
    assert phase_added['cell']['length_b'].value == phase_ref['cell'][
        'length_b'].value
    assert phase_added['cell']['length_c'].value == phase_ref['cell'][
        'length_c'].value
    assert phase_added['cell']['angle_alpha'].value == phase_ref['cell'][
        'angle_alpha'].value
    assert phase_added['cell']['angle_beta'].value == phase_ref['cell'][
        'angle_beta'].value
    assert phase_added['cell']['angle_gamma'].value == phase_ref['cell'][
        'angle_gamma'].value
    assert phase_added['atoms']['Fe3A']['fract_x'].value == phase_ref['atoms'][
        'Fe3A']['fract_x'].value
    assert phase_added['atoms']['Fe3B']['fract_y'].value == phase_ref['atoms'][
        'Fe3B']['fract_y'].value
    assert phase_added['atoms']['O']['fract_z'].value == phase_ref['atoms'][
        'O']['fract_z'].value
Ejemplo n.º 2
0
def test_addExperimentDefinition(cal):
    calc = CryspyCalculator('')
    interface = QtCalculatorInterface(calc)
    interface.setPhaseDefinition(phase_path)
    interface.addExperimentDefinition(exp_path)
    exp_added = interface.getExperiment('pd')
    exp_ref = cal.getExperiment('pd')
    assert exp_added['name'] == exp_ref['name']
    assert exp_added['wavelength'].value == exp_ref['wavelength'].value
    assert exp_added['offset'].value == exp_ref['offset'].value
    assert exp_added['phase']['Fe3O4']['name'] == exp_ref['phase']['Fe3O4'][
        'name']
    assert exp_added['phase']['Fe3O4']['scale'].value == exp_ref['phase'][
        'Fe3O4']['scale'].value
Ejemplo n.º 3
0
def test_setPhaseDefinition_EmptyStr():
    calc = CryspyCalculator('')
    interface = QtCalculatorInterface(calc)
    interface.setPhaseDefinition('')
Ejemplo n.º 4
0
def test_setPhaseDefinition_None():
    calc = CryspyCalculator('')
    interface = QtCalculatorInterface(calc)
    interface.setPhaseDefinition(None)