def test_atoms_extend__on_nonbonded_structure_reindexes_new_bonds_to_proper_atoms( linear_cnnc): linear_cnnc_no_bonds = Atoms(elements='CNNC', positions=[(0., 0., 0), (1.0, 0., 0.), (2.0, 0., 0.), (3.0, 0., 0.)]) linear_cnnc_no_bonds.extend(linear_cnnc) assert np.array_equal(linear_cnnc_no_bonds.bonds, [(4, 5), (5, 6), (6, 7)])
def test_atoms_extend__new_types_come_after_old_types1(linear_cnnc): a = Atoms(elements="C", positions=[[0, 0, 0]]) b = Atoms(elements="H", positions=[[1, 1, 1]]) a.extend(b) assert np.array_equal(a.elements, ["C", "H"])