SINGROUP/dscribe

AttributeError: 'SOAP' object has no attribute '_check_system_list'

Iximiel opened this issue · 4 comments

When I try to calculate the derivative of the soap descriptor I get the following error:

Traceback (most recent call last):
  File "testSoap.py", line 63, in work
    dev, res = soapEngine.derivatives(
  File "/venv/lib/python3.8/site-packages/dscribe/descriptors/soap.py", line 718, in derivatives
    self._check_system_list(system)
AttributeError: 'SOAP' object has no attribute '_check_system_list'

I'm using dscribe installed with pip install "dscribe==1.2.0

If I comment the line with the call to '_check_system_list' I get no errors, but the value of the derivatives differ from the ones calculated with the 1.1.0 version

Thanks in advance
Daniele

Hi @Iximiel,

You are completely right. Our test pipeline was not picking up on this error due to a mistake in our scripts. I will make a hotfix for this.

Can you @Iximiel provide an example where the derivatives differ between v1.1.0 and v1.2.0? I could not reproduce any difference with a simple system using the following snippet:

import numpy as np
import pkg_resources
from ase.build import molecule
from dscribe.descriptors import SOAP

H2O = molecule("H2O")

soap = SOAP(
    species=[1, 8],
    rcut=3,
    nmax=2,
    lmax=0,
    rbf="gto",
    sparse=False,
    periodic=False,
)
D_a = soap.derivatives(H2O, method="analytical", return_descriptor=False)
D_n = soap.derivatives(H2O, method="numerical", return_descriptor=False)

version = pkg_resources.get_distribution("dscribe").version
with open(f"derivatives_v{version}.txt", "w") as f:
    f.write(str(D_a))
    f.write(str(D_n))

Here are the resulting files when I run this with v1.1.0 from pip, and using v1.2.0 with the problematic line removed:

derivatives_v1.1.0.txt,
derivatives_v1.2.0.txt

At least for this simple system, the results are identical. Also, our test pipeline does not detect any problems with the derivatives.

Hi @lauri-codes,

I'm sorry about the derivatives:
I calculated the derivatives on a single configuration, and I saved the results of SOAP.derivatives in an .npy file with numpy.save and then I checked if the files from the two version were equal with md5sum.

I just verified that the numerical results are the very same, but in my script the 1.1.0 saves the results in an numpy array with one more dimension and this makes the .npy file look different with md5sum.

Ok, that's good. I will fix our test pipeline and make a new working release v1.2.1. In the meantime there is no harm in disabling _check_system_list: It is only used to check your input parameter.