Skip to content

Add RDKit formula conversions for canonical/isomeric SMILES#178

Merged
hechth merged 2 commits into
mainfrom
copilot/add-conversion-rdkit-smiles-formula
May 7, 2026
Merged

Add RDKit formula conversions for canonical/isomeric SMILES#178
hechth merged 2 commits into
mainfrom
copilot/add-conversion-rdkit-smiles-formula

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

This PR adds the missing RDKit compute conversion paths from SMILES variants to molecular formula. The issue requested support for smiles, canonical_smiles, and isomeric_smilesformula in the compute converter.

  • RDKit conversion routing

    • Extended RDKit.__init__ conversion map to register:
      • canonical_smiles_to_formula
      • isomeric_smiles_to_formula
    • Both routes reuse existing smiles_to_formula logic (no duplicate formula computation path).
  • Coverage for new conversion entry points

    • Updated tests/test_rdkit.py with focused cases validating:
      • canonical_smiles_to_formula(...) -> {"formula": ...}
      • isomeric_smiles_to_formula(...) -> {"formula": ...}
conversions = [
    ("smiles", "mw", "from_smiles"),
    ("canonical_smiles", "mw", "from_smiles"),
    ("isomeric_smiles", "mw", "from_smiles"),
    ("canonical_smiles", "formula", "smiles_to_formula"),
    ("isomeric_smiles", "formula", "smiles_to_formula"),
]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • idsm.elixir-czech.cz
    • Triggering command: /usr/bin/python python -m pytest (dns block)
  • pubchem.ncbi.nlm.nih.gov
    • Triggering command: /usr/bin/python python -m pytest (dns block)
  • webservice.bridgedb.org
    • Triggering command: /usr/bin/python python -m pytest (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue May 7, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add conversion functions for RDKit from SMILES to formula Add RDKit formula conversions for canonical/isomeric SMILES May 7, 2026
Copilot finished work on behalf of hechth May 7, 2026 14:12
Copilot AI requested a review from hechth May 7, 2026 14:12
@hechth hechth marked this pull request as ready for review May 7, 2026 14:16
@hechth hechth merged commit f3d8555 into main May 7, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add conversion for RDKit from SMILES to Formula

2 participants