def test_selected_atoms_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.selected_atoms = ["H"] expected_settings = Settings({ 'selected_atoms': ['H'], 'specific': { 'dftb': { 'constraints': { 'atom 1': '', 'atom 2': '' }, 'geometry': { 'optim': 'cartesian' } } } }) assert dftb.generic2specific(s, mol) == expected_settings s.selected_atoms = [3, 4, 5, 6] expected_settings = Settings({ 'selected_atoms': [3, 4, 5, 6], 'specific': { 'dftb': { 'constraints': { 'atom 1': '', 'atom 2': '' }, 'geometry': { 'optim': 'cartesian' } } } }) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)
def test_freeze_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.freeze = ["C", "O"] expected_settings = Settings({ 'freeze': ['C', 'O'], 'specific': { 'dftb': { 'constraints': { 'atom 1': '', 'atom 2': '' }, 'geometry': { 'optim': 'cartesian' } } } }) assert str(dftb.generic2specific(s, mol)) == str(expected_settings) s.freeze = [1, 2] expected_settings = Settings({ 'freeze': [1, 2], 'specific': { 'dftb': { 'constraints': { 'atom 1': '', 'atom 2': '' }, 'geometry': { 'optim': 'cartesian' } } } }) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)
def test_selected_atoms_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.selected_atoms = ["H"] expected_settings = Settings( {'selected_atoms': ['H'], 'specific': dftb_const}) assert dftb.generic2specific(s, mol) == expected_settings s.selected_atoms = indices expected_settings = Settings( {'selected_atoms': indices, 'specific': dftb_const}) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)
def test_freeze_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.freeze = ["C", "O"] expected_settings = Settings( {'freeze': ['C', 'O'], 'specific': dftb_const}) assert str(dftb.generic2specific(s, mol)) == str(expected_settings) s.freeze = [1, 2] expected_settings = Settings( {'freeze': [1, 2], 'specific': dftb_const}) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)
def test_selected_atoms_with_dftb(): """Test the DFTB selection atoms funcionality.""" mol = molkit.from_smiles('CO') s = Settings() s.selected_atoms = ["H"] expected_settings = Settings( {'selected_atoms': ['H'], 'specific': dftb_const}) assertion.eq(dftb.generic2specific(s, mol), expected_settings) s.selected_atoms = indices expected_settings = Settings( {'selected_atoms': indices, 'specific': dftb_const}) assertion.eq(str(dftb.generic2specific(s, mol)), str(expected_settings))
def test_freeze_with_dftb(): """Test freeze keyword for DFTB.""" mol = molkit.from_smiles('CO') s = Settings() s.freeze = ["C", "O"] expected_settings = Settings( {'freeze': ['C', 'O'], 'specific': dftb_const}) assertion.eq(str(dftb.generic2specific(s, mol)), str(expected_settings)) s.freeze = [1, 2] expected_settings = Settings( {'freeze': [1, 2], 'specific': dftb_const}) assertion.eq(str(dftb.generic2specific(s, mol)), str(expected_settings))
def test_freeze_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.freeze = ["C", "O"] expected_settings = Settings({ 'freeze': ['C', 'O'], 'specific': dftb_const }) assert str(dftb.generic2specific(s, mol)) == str(expected_settings) s.freeze = [1, 2] expected_settings = Settings({'freeze': [1, 2], 'specific': dftb_const}) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)
def test_selected_atoms_with_dftb(): mol = molkit.from_smiles('CO') s = Settings() s.selected_atoms = ["H"] expected_settings = Settings({ 'selected_atoms': ['H'], 'specific': dftb_const }) assert dftb.generic2specific(s, mol) == expected_settings s.selected_atoms = indices expected_settings = Settings({ 'selected_atoms': indices, 'specific': dftb_const }) assert str(dftb.generic2specific(s, mol)) == str(expected_settings)