librascal icon indicating copy to clipboard operation
librascal copied to clipboard

Wrong error message if kernel zeta is not given

Open max-veit opened this issue 3 years ago • 0 comments

Trying to construct a librascal kernel without specifying the (undocumented!) zeta parameter produces the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-75-3e74d2b5343a> in <module>
----> 1 rascal_kernel = Kernel(si, name="Cosine", target_type="Atom")

/local/scratch/mveit/codes/librascal/build/rascal/models/kernels.py in __init__(self, representation, name, kernel_type, target_type, **kwargs)
     82                 raise ValueError("The given zeta has to be a positive integer.")
     83         else:
---> 84             raise RuntimeError("Kernel name must be one of: Cosine, GAP.")
     85         hypers = dict(name=name, target_type=target_type)
     86         hypers.update(**kwargs)

RuntimeError: Kernel name must be one of: Cosine, GAP.

This is false and misleading. Additionally, the zeta parameter must be documented (since it is required for both Cosine and GAP kernels (what's the difference? GAP uses a type of "Cosine" kernel when it's used with SOAP...) ).

max-veit avatar Apr 06 '21 14:04 max-veit