Merge branch 'develop' into enhancement/licenses

This commit is contained in:
2025-11-12 02:19:13 +13:00
99 changed files with 5496 additions and 1326 deletions

View File

@ -255,6 +255,30 @@ class FormatConverter(object):
except Exception:
return False
@staticmethod
def is_valid_smarts(smarts: str) -> bool:
"""
Checks whether a given string is a valid SMARTS pattern.
Parameters
----------
smarts : str
The SMARTS string to validate.
Returns
-------
bool
True if the SMARTS string is valid, False otherwise.
"""
if not isinstance(smarts, str) or not smarts.strip():
return False
try:
mol = Chem.MolFromSmarts(smarts)
return mol is not None
except Exception:
return False
@staticmethod
def apply(
smiles: str,