xnn.common.config.coerce.coerce_species#

xnn.common.config.coerce.coerce_species(value, default=None)[source]#

Coerce a configured species list to a list of atomic numbers.

Accepts atomic numbers, chemical symbols (upstream NequIP chemical_symbols), a mix of both, or the string form of such a list.

Parameters:
  • value (Any) – The raw config value; None selects default.

  • default (sequence of int or None, optional) – Fallback when value is None.

Returns:

The atomic numbers, in the configured (channel) order.

Return type:

list of int

Raises:

ValueError – If the resulting list is empty or contains an unknown symbol.