Exemplo n.º 1
0
 def test_reorder1(self):
     atom = Atoms(['C', 'Au'])
     atom = atom.sub(1)
     atom = atom.reorder()
     assert_true(atom[0] == Atom['Au'])
     assert_true(len(atom) == 1)
     assert_true(len(atom.atom) == 2)
Exemplo n.º 2
0
def test_reorder1():
    atom = Atoms(['C', 'Au'])
    atom = atom.sub(1)
    atom1 = atom.reorder()
    # Check we haven't done anything to the original Atoms object
    assert atom[0] == Atom['Au']
    assert atom.specie[0] == 1
    assert len(atom) == 1
    assert len(atom.atom) == 2
    assert atom1[0] == Atom['Au']
    assert atom1.specie[0] == 0
    assert len(atom1) == 1
    assert len(atom1.atom) == 2
    # Do in-place
    atom.reorder(True)
    assert atom[0] == Atom['Au']
    assert atom.specie[0] == 0
    assert len(atom) == 1
    assert len(atom.atom) == 2
Exemplo n.º 3
0
def test_reorder2():
    atom1 = Atoms(['C', 'Au'])
    atom2 = atom1.reorder()
    assert atom1 == atom2