fuellib.gcm.gani.GaniDecomposer
- class fuellib.gcm.gani.GaniDecomposer(method, table_groups, first_order_groups)
Bases:
DecomposerDecomposer for first and second order Gani-Constantinou 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 from SMARTS patterns and non-aromatic rings.
- second_order_counts(mol, smiles)
Count second order groups from SMARTS patterns and non-aromatic rings.
- 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]