fuellib.gcm.nannoolal.NannoolalDecomposer
- class fuellib.gcm.nannoolal.NannoolalDecomposer(method, table_groups, first_order_groups)
Bases:
DecomposerDecomposer for first and second order Nannoolal groups.
Initialize the decomposer with a GCM’s group data.
- Parameters:
method (str) – Display name of the GCM used in error messages.
table_groups (Index) – Group names that are columns of the GCM parameter table.
first_order_groups (Sequence[tuple[str, str]]) –
(group name, SMARTS)pairs ordered by priority.
Methods
contextBuild the shared prefix of every decomposition error message.
first_order_countsCount first order groups, requiring that they cover every atom.
parse_smartsParse a SMARTS pattern used to decompose a molecule.
parse_smilesValidate and parse a SMILES string.
Count second order groups, hydrogen counts, rings, and aromatic pairs.
- second_order_counts(mol, smiles)
Count second order groups, hydrogen counts, rings, and aromatic pairs.
- Parameters:
mol (Mol) – The parsed molecule.
smiles (str) – The SMILES string being decomposed, used in error messages.
- Returns:
A mapping of second order group name to its number of occurrences.
- Return type:
dict[str, int]