theochem / iodata

Assert statement used outside of tests BAN-B101
Security
Major
3 months ago4 months old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
149                matrix2 = d2[key]
150                np.testing.assert_equal(matrix1, matrix2)
151            else:
152                assert key not in d2153
154
155def check_orthonormal(mo_coeffs: NDArray[float], ao_overlap: NDArray[float], atol: float = 1e-5):
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
142        d2 = getattr(mol2, attrname)
143        for key in keys:
144            if key in d1:
145                assert key in d2146                matrix1 = d1[key]
147                matrix1 = matrix1[perm] * sgn.reshape(-1, 1)
148                matrix1 = matrix1[:, perm] * sgn
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
126        assert mol2.obasis is None
127    # wfn
128    perm, sgn = convert_conventions(mol1.obasis, mol2.obasis.conventions)
129    assert mol1.mo.kind == mol2.mo.kind130    assert_allclose(mol1.mo.occs, mol2.mo.occs, atol=atol, rtol=rtol)
131    assert_allclose(mol1.mo.coeffs[perm] * sgn.reshape(-1, 1), mol2.mo.coeffs, atol=atol, rtol=rtol)
132    assert_allclose(mol1.mo.energies, mol2.mo.energies, atol=atol, rtol=rtol)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
117            assert_equal(shell1.kinds, shell2.kinds)
118            assert_allclose(shell1.exponents, shell2.exponents, atol=atol, rtol=rtol)
119            assert_allclose(shell1.coeffs, shell2.coeffs, atol=atol, rtol=rtol)
120        assert mol1.obasis.primitive_normalization == mol2.obasis.primitive_normalization121        # compute and compare Mulliken charges
122        charges1 = compute_mulliken_charges(mol1)
123        charges2 = compute_mulliken_charges(mol2)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
112        # compare dictionaries
113        assert len(mol1.obasis.shells) == len(mol2.obasis.shells)
114        for shell1, shell2 in zip(mol1.obasis.shells, mol2.obasis.shells):
115            assert shell1.icenter == shell2.icenter116            assert_equal(shell1.angmoms, shell2.angmoms)
117            assert_equal(shell1.kinds, shell2.kinds)
118            assert_allclose(shell1.exponents, shell2.exponents, atol=atol, rtol=rtol)