Robert Elder commited on
Commit ·
b5ed7d2
1
Parent(s): 4ba85cc
fixed total quantity module ID failure message
Browse files- ChemID.py +1 -1
- quantity_module/data/solvent-viscosity.xlsx +2 -2
- quantity_module/quantity.py +16 -1
ChemID.py
CHANGED
|
@@ -14,7 +14,7 @@ import requests
|
|
| 14 |
import json
|
| 15 |
import logging
|
| 16 |
|
| 17 |
-
_CIRPY_CHECK_TIMEOUT = float(os.environ.get('CIRPY_CHECK_TIMEOUT', '
|
| 18 |
_logger = logging.getLogger(__name__)
|
| 19 |
|
| 20 |
def _check_cirpy_access():
|
|
|
|
| 14 |
import json
|
| 15 |
import logging
|
| 16 |
|
| 17 |
+
_CIRPY_CHECK_TIMEOUT = float(os.environ.get('CIRPY_CHECK_TIMEOUT', '5'))
|
| 18 |
_logger = logging.getLogger(__name__)
|
| 19 |
|
| 20 |
def _check_cirpy_access():
|
quantity_module/data/solvent-viscosity.xlsx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1981623bba77ebda97107ece1e0b4d6b638a633cb5a91ed6a88a1a1bf26f513b
|
| 3 |
+
size 13815
|
quantity_module/quantity.py
CHANGED
|
@@ -54,8 +54,23 @@ def exp_post():
|
|
| 54 |
LogP_origin, rho_origin, mp_origin = '','',''
|
| 55 |
iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
if error > 0:
|
| 58 |
-
return render_template('quantity_error.html', message=
|
| 59 |
|
| 60 |
#MW = SigFigs(MW, 6)
|
| 61 |
if 'logp' not in get_properties:
|
|
|
|
| 54 |
LogP_origin, rho_origin, mp_origin = '','',''
|
| 55 |
iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
|
| 56 |
|
| 57 |
+
error_message = """
|
| 58 |
+
<div style="font-size:2rem;text-align:center">
|
| 59 |
+
<p>We could not automatically identify the chemical from the information provided.</p>
|
| 60 |
+
<p>
|
| 61 |
+
Return to the previous page and try a different identifier or check the identifier for errors.
|
| 62 |
+
If the chemical still cannot be identified, use one of the resources below to find its SMILES or InChI,
|
| 63 |
+
then submit that structural identifier in CHRIS.
|
| 64 |
+
</p>
|
| 65 |
+
<p>
|
| 66 |
+
<a href="https://cactus.nci.nih.gov/chemical/structure">NCI/CADD Chemical Identifier Resolver</a>,
|
| 67 |
+
<a href="https://pubchem.ncbi.nlm.nih.gov/">PubChem</a>, or
|
| 68 |
+
<a href="https://webbook.nist.gov/chemistry/">NIST Chemistry WebBook</a>
|
| 69 |
+
</p>
|
| 70 |
+
</div>
|
| 71 |
+
"""
|
| 72 |
if error > 0:
|
| 73 |
+
return render_template('quantity_error.html', message=error_message + f'<br><br>Error code: {error} <br>Error message: {ERROR_CODES[error]}')
|
| 74 |
|
| 75 |
#MW = SigFigs(MW, 6)
|
| 76 |
if 'logp' not in get_properties:
|