def test_unique(self): # AB == BA - one structure O = OqmdInterface() atoms_data = O.get_atoms_for_prototype(chemical_formula='TiMo', proto_name='AB_4_ab_ab_186') atoms = [a['atoms'] for a in atoms_data] assert len(atoms) == 1 # ABC3 != BAC3 - two structures atoms_data = O.get_atoms_for_prototype(chemical_formula='TiMoO3', proto_name='ABC3_1_a_a_b_160') atoms = [a['atoms'] for a in atoms_data] assert len(atoms) == 2
def test_get_same_formula(self): # Should get same formula if exists O = OqmdInterface() atoms_data = O.get_atoms_for_prototype(chemical_formula='TiO2', proto_name='AB2_2_a_f_136')[0] assert atoms_data['chemical_formula'] == atoms_data['original_formula']
def test_substitute_atoms(self): O = OqmdInterface() atoms_data = O.get_atoms_for_prototype(chemical_formula='TiMoO2', proto_name='ABC2_2_a_c_f_194')[0] atoms = atoms_data['atoms'] atoms_list = O.substitute_atoms( atoms, new_symbols=['Nb', 'V', 'O', 'O']) assert len(atoms_list) == 2