Tests different invalid parameters that should raise an exception.
()
| 133 | # ============================================================================= |
| 134 | # Tests that are specific to this descriptor. |
| 135 | def test_exceptions(): |
| 136 | """Tests different invalid parameters that should raise an |
| 137 | exception. |
| 138 | """ |
| 139 | # Invalid species |
| 140 | with pytest.raises(ValueError): |
| 141 | ACSF(r_cut=6.0, species=None) |
| 142 | |
| 143 | # Invalid bond_params |
| 144 | with pytest.raises(ValueError): |
| 145 | ACSF(r_cut=6.0, species=[1, 6, 8], g2_params=[1, 2, 3]) |
| 146 | |
| 147 | # Invalid bond_cos_params |
| 148 | with pytest.raises(ValueError): |
| 149 | ACSF(r_cut=6.0, species=[1, 6, 8], g3_params=[[1, 2], [3, 1]]) |
| 150 | |
| 151 | # Invalid bond_cos_params |
| 152 | with pytest.raises(ValueError): |
| 153 | ACSF(r_cut=6.0, species=[1, 6, 8], g3_params=[[1, 2, 4], [3, 1]]) |
| 154 | |
| 155 | # Invalid ang4_params |
| 156 | with pytest.raises(ValueError): |
| 157 | ACSF(r_cut=6.0, species=[1, 6, 8], g4_params=[[1, 2], [3, 1]]) |
| 158 | |
| 159 | # Invalid ang5_params |
| 160 | with pytest.raises(ValueError): |
| 161 | ACSF(r_cut=6.0, species=[1, 6, 8], g5_params=[[1, 2], [3, 1]]) |
| 162 | |
| 163 | |
| 164 | def test_features(): |