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

to_dic bug fixed #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/guide/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Contributors
- |ghi| `llazzaro <https://github.com/llazzaro>`_ (Leonardo Lazzaro)
- |ghi| `bjodah <https://github.com/bjodah>`_ (Björn Dahlgren)
- |ghi| `RickardSjogren <https://github.com/RickardSjogren>`_ (Rickard Sjögren)
- |ghi| `Hyeansung <https://github.com/Hyeansung>`_ (Kim, Hyeonsung)

.. _`source code`: https://github.com/mcs07/PubChemPy
.. _`Issue Tracker`: https://github.com/mcs07/PubChemPy/issues
Expand Down
8 changes: 7 additions & 1 deletion pubchempy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,10 +1113,16 @@ def standardized_cid(self):

May not exist if this Substance was not standardizable.
"""
"""
Some substances of pubchem data doesnot provide compound key
for c in self.record['compound']:
if c['id']['type'] == CompoundIdType.STANDARDIZED:
return c['id']['id']['cid']

"""
if 'compound' in self.record:
for c in self.record['compound']:
if c['id']['type'] == CompoundIdType.STANDARDIZED:
return c['id']['id']['cid']
@memoized_property
def standardized_compound(self):
"""Return the :class:`~pubchempy.Compound` that was produced when this Substance was standardized.
Expand Down