Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndigoException: stoi when reading USPTO CDX file #1159

Closed
eloyfelix opened this issue Jun 20, 2023 · 0 comments · Fixed by #1170
Closed

IndigoException: stoi when reading USPTO CDX file #1159

eloyfelix opened this issue Jun 20, 2023 · 0 comments · Fixed by #1170
Assignees
Labels
Projects

Comments

@eloyfelix
Copy link
Contributor

Steps to Reproduce

  1. Use Indigo library (Bingo cartridge). Describe environment
    Indigo built from master branch, commit: 1fd76de
    Python 3.11.3 in Ubuntu Linux

  2. Add script or SQL to reproduce the issue

from indigo import Indigo

indigo = Indigo()

for mol in indigo.iterateCDXFile("US06168934-20010102-C00008.CDX"):
    print("heavy atoms:", mol.countHeavyAtoms())
    print("smiles:", mol.smiles())
---------------------------------------------------------------------------
IndigoException                           Traceback (most recent call last)
Cell In[18], line 6
      3 indigo = Indigo()
      5 for mol in indigo.iterateCDXFile("US06168934-20010102-C00008.CDX"):
----> 6     print("heavy atoms:", mol.countHeavyAtoms())
      7     print("smiles:", mol.smiles())

File [~/.pyenv/versions/3.11.3/envs/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_object.py:3009](https://file+.vscode-resource.vscode-cdn.net/home/eloy/patent_chem/example_files/~/.pyenv/versions/3.11.3/envs/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_object.py:3009), in IndigoObject.countHeavyAtoms(self)
   3002 def countHeavyAtoms(self):
   3003     """Molecule method returns the number of heavy atoms
   3004 
   3005     Returns:
   3006         int: heavy atom count
   3007     """
-> 3009     return IndigoLib.checkResult(
   3010         self._lib().indigoCountHeavyAtoms(self.id)
   3011     )

File [~/.pyenv/versions/3.11.3/envs/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_lib.py:1001](https://file+.vscode-resource.vscode-cdn.net/home/eloy/patent_chem/example_files/~/.pyenv/versions/3.11.3/envs/uspto-patents/lib/python3.11/site-packages/indigo/indigo/indigo_lib.py:1001), in IndigoLib.checkResult(result, exception_class)
    999 if result < 0:
   1000     assert IndigoLib.lib
-> 1001     raise exception_class(IndigoLib.lib.indigoGetLastError())
   1002 return result

IndigoException: stoi

Expected behavior
Molecule being parsed

Actual behavior
it seems some items in CDX file fail to parse. The issue happens in several of the USPTO CDX files. I could upload more examples.

Attachments
US06168934-20010102-C00008.zip

Indigo/Bingo version
Indigo built from master branch, commit: 1fd76de

@eloyfelix eloyfelix added the Bug label Jun 20, 2023
@even1024 even1024 self-assigned this Jun 26, 2023
@even1024 even1024 added this to Product Backlog in Indigo via automation Jun 26, 2023
@even1024 even1024 added this to the Indigo-1.13.0-rc.1 milestone Jun 26, 2023
@even1024 even1024 moved this from Product Backlog to In progress in Indigo Jul 4, 2023
@even1024 even1024 moved this from In progress to Done in Indigo Jul 4, 2023
@even1024 even1024 linked a pull request Jul 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Indigo
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants