def test_POAV_angles(self):
        atoms = \
            generate_atoms(generator_class='SWNTGenerator', n=10, m=0, nz=2)
        # atoms.NNrc = 2.0
        atoms.assign_unique_ids()
        atoms.compute_POAVs()

        for i, atom in enumerate(atoms):
            print('atom{}: {}'.format(atom.id, atom))
            for POAV in ('POAV1', 'POAV2', 'POAVR'):
                if getattr(atom, POAV) is not None:
                    atom_POAV = getattr(atom, POAV)
                    sigma_pi_angles = np.degrees(atom_POAV.sigma_pi_angles)
                    assert_false(np.all(np.isclose(sigma_pi_angles,
                                                   3 * [np.nan],
                                                   equal_nan=True)))
                    print('atom{}.{}.sigma_pi_angles:\n{}'.format(
                        atom.id, POAV, sigma_pi_angles))

                    pyramidalization_angles = \
                        np.degrees(atom_POAV.pyramidalization_angles)
                    print('atom{}.{}.pyramidalization_angles:\n{}'.format(
                        atom.id, POAV, pyramidalization_angles))
                    assert_false(np.all(np.isclose(pyramidalization_angles,
                                                   3 * [np.nan],
                                                   equal_nan=True)))

                    misalignment_angles = \
                        np.degrees(atom_POAV.misalignment_angles)
                    print('atom{}.{}.misalignment_angles:\n{}\n'.format(
                        atom.id, POAV, misalignment_angles))
                    assert_false(np.all(np.isclose(misalignment_angles,
                                                   3 * [np.nan],
                                                   equal_nan=True)))
    def test_POAV_angles(self):
        atoms = \
            generate_atoms(generator_class='SWNTGenerator', n=10, m=0, nz=2)
        # atoms.NNrc = 2.0
        atoms.assign_unique_ids()
        atoms.compute_POAVs()

        for i, atom in enumerate(atoms):
            print('atom{}: {}'.format(atom.id, atom))
            for POAV in ('POAV1', 'POAV2', 'POAVR'):
                if getattr(atom, POAV) is not None:
                    atom_POAV = getattr(atom, POAV)
                    sigma_pi_angles = np.degrees(atom_POAV.sigma_pi_angles)
                    assert_false(
                        np.all(
                            np.isclose(sigma_pi_angles,
                                       3 * [np.nan],
                                       equal_nan=True)))
                    print('atom{}.{}.sigma_pi_angles:\n{}'.format(
                        atom.id, POAV, sigma_pi_angles))

                    pyramidalization_angles = \
                        np.degrees(atom_POAV.pyramidalization_angles)
                    print('atom{}.{}.pyramidalization_angles:\n{}'.format(
                        atom.id, POAV, pyramidalization_angles))
                    assert_false(
                        np.all(
                            np.isclose(pyramidalization_angles,
                                       3 * [np.nan],
                                       equal_nan=True)))

                    misalignment_angles = \
                        np.degrees(atom_POAV.misalignment_angles)
                    print('atom{}.{}.misalignment_angles:\n{}\n'.format(
                        atom.id, POAV, misalignment_angles))
                    assert_false(
                        np.all(
                            np.isclose(misalignment_angles,
                                       3 * [np.nan],
                                       equal_nan=True)))
 def test3(self):
     atoms = generate_atoms(elements='periodic_table')
     atoms.assign_unique_ids()
     atoms.kNN = 3
     atoms_cp = atoms.copy()
     assert_equal(atoms.kNN, atoms_cp.kNN)
 def test3(self):
     atoms = generate_atoms(elements='periodic_table')
     atoms.assign_unique_ids()
     atoms.kNN = 3
     atoms_cp = atoms.copy()
     assert_equal(atoms.kNN, atoms_cp.kNN)