Commit ·
7368d75
1
Parent(s): 39819ec
handling for name/CAS not found
Browse files
ChemID.py
CHANGED
|
@@ -89,6 +89,13 @@ def ResolveChemical(chemName, IDtype):
|
|
| 89 |
im64 = None
|
| 90 |
error = 4
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
return (name, cas, smiles, Mw, im64, error)
|
| 93 |
|
| 94 |
#Generates an image of the molecule represented by the SMILES code given.
|
|
|
|
| 89 |
im64 = None
|
| 90 |
error = 4
|
| 91 |
|
| 92 |
+
# if we couldn't find a name or CAS (but do have SMILES)
|
| 93 |
+
if not error:
|
| 94 |
+
if not name:
|
| 95 |
+
name = 'Not found'
|
| 96 |
+
if not cas:
|
| 97 |
+
cas = 'Not found'
|
| 98 |
+
|
| 99 |
return (name, cas, smiles, Mw, im64, error)
|
| 100 |
|
| 101 |
#Generates an image of the molecule represented by the SMILES code given.
|