robert.elder commited on
Commit ·
2fd5c00
1
Parent(s): 9a142a2
fixed issue with ceramics logic
Browse files- ChemID.py +3 -0
- color2_module/colors.py +2 -1
- exposure2_module/exposure.py +1 -1
ChemID.py
CHANGED
|
@@ -183,6 +183,9 @@ def ResolveChemical(chemName, IDtype, debug=False, get_properties=['logp','rho',
|
|
| 183 |
name = 'Not found'
|
| 184 |
if not cas:
|
| 185 |
cas = 'Not found'
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
if debug:
|
| 188 |
return (name, cas, smiles, Mw, LogP, LogP_origin, rho, rho_origin, mp, mp_origin, im64, error)
|
|
|
|
| 183 |
name = 'Not found'
|
| 184 |
if not cas:
|
| 185 |
cas = 'Not found'
|
| 186 |
+
|
| 187 |
+
if mp is not None:
|
| 188 |
+
mp = float(mp)
|
| 189 |
|
| 190 |
if debug:
|
| 191 |
return (name, cas, smiles, Mw, LogP, LogP_origin, rho, rho_origin, mp, mp_origin, im64, error)
|
color2_module/colors.py
CHANGED
|
@@ -7,6 +7,7 @@ from polymers import Polymers, Polymers3
|
|
| 7 |
from ChemID import ResolveChemical, ImageFromSmiles, Imageto64
|
| 8 |
import rdkit
|
| 9 |
from rdkit.Chem import AllChem as Chem
|
|
|
|
| 10 |
|
| 11 |
# get additional physical properties, options are: logp, rho, mp
|
| 12 |
#get_properties = [] # don't get any; this breaks ceramics logic
|
|
@@ -146,7 +147,7 @@ def app_post():
|
|
| 146 |
else:
|
| 147 |
# get number of carbon-carbon bonds
|
| 148 |
num_CC_bonds = sum([1 if b.GetBeginAtom().GetAtomicNum() == 6 and b.GetEndAtom().GetAtomicNum() == 6 else 0 for b in mol.GetBonds()])
|
| 149 |
-
if not num_CC_bonds and (
|
| 150 |
# if not a metal, no C-C bonds, and mp > 700 (sodium chloride has mp ~ 800), assume ceramic...
|
| 151 |
MW = 1100.
|
| 152 |
ceramic = True
|
|
|
|
| 7 |
from ChemID import ResolveChemical, ImageFromSmiles, Imageto64
|
| 8 |
import rdkit
|
| 9 |
from rdkit.Chem import AllChem as Chem
|
| 10 |
+
import numbers
|
| 11 |
|
| 12 |
# get additional physical properties, options are: logp, rho, mp
|
| 13 |
#get_properties = [] # don't get any; this breaks ceramics logic
|
|
|
|
| 147 |
else:
|
| 148 |
# get number of carbon-carbon bonds
|
| 149 |
num_CC_bonds = sum([1 if b.GetBeginAtom().GetAtomicNum() == 6 and b.GetEndAtom().GetAtomicNum() == 6 else 0 for b in mol.GetBonds()])
|
| 150 |
+
if not num_CC_bonds and (mp is not None) and mp > 700.:
|
| 151 |
# if not a metal, no C-C bonds, and mp > 700 (sodium chloride has mp ~ 800), assume ceramic...
|
| 152 |
MW = 1100.
|
| 153 |
ceramic = True
|
exposure2_module/exposure.py
CHANGED
|
@@ -88,7 +88,7 @@ def exp_post():
|
|
| 88 |
else:
|
| 89 |
# get number of carbon-carbon bonds
|
| 90 |
num_CC_bonds = sum([1 if b.GetBeginAtom().GetAtomicNum() == 6 and b.GetEndAtom().GetAtomicNum() == 6 else 0 for b in mol.GetBonds()])
|
| 91 |
-
if not num_CC_bonds and (
|
| 92 |
# if not a metal, and mp > 700 (sodium chloride has mp ~ 800), and no C-C bonds, assume ceramic...
|
| 93 |
#if (type(mp) is float or type(mp) is int) and mp > 1000.:
|
| 94 |
# if not a metal but melting point > 1000, assume ceramic
|
|
|
|
| 88 |
else:
|
| 89 |
# get number of carbon-carbon bonds
|
| 90 |
num_CC_bonds = sum([1 if b.GetBeginAtom().GetAtomicNum() == 6 and b.GetEndAtom().GetAtomicNum() == 6 else 0 for b in mol.GetBonds()])
|
| 91 |
+
if not num_CC_bonds and (mp is not None) and mp > 700.:
|
| 92 |
# if not a metal, and mp > 700 (sodium chloride has mp ~ 800), and no C-C bonds, assume ceramic...
|
| 93 |
#if (type(mp) is float or type(mp) is int) and mp > 1000.:
|
| 94 |
# if not a metal but melting point > 1000, assume ceramic
|