Spaces:
Runtime error
Runtime error
Add alternative online tools for molecular orbitals when Psi4 is unavailable
Browse files
app.py
CHANGED
|
@@ -118,6 +118,28 @@ def smiles_to_molecular_orbitals(smiles_input: str, name_input: str) -> str:
|
|
| 118 |
"<p><strong>Molecular orbital rendering requires Psikit + Psi4.</strong> "
|
| 119 |
"Install them locally with <code>pip install psikit psi4 py3Dmol</code> "
|
| 120 |
"and run this app on your machine.</p>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
)
|
| 122 |
|
| 123 |
try:
|
|
|
|
| 118 |
"<p><strong>Molecular orbital rendering requires Psikit + Psi4.</strong> "
|
| 119 |
"Install them locally with <code>pip install psikit psi4 py3Dmol</code> "
|
| 120 |
"and run this app on your machine.</p>"
|
| 121 |
+
"<p><strong>Alternative online tools:</strong></p>"
|
| 122 |
+
"<ul>"
|
| 123 |
+
"<li><a href='https://www.webmo.net/' target='_blank'>WebMO</a> - Web-based molecular modeling</li>"
|
| 124 |
+
"<li><a href='https://gaussian.com/' target='_blank'>Gaussian</a> - Quantum chemistry software</li>"
|
| 125 |
+
"<li><a href='https://www.chemcraftprog.com/' target='_blank'>ChemCraft</a> - Molecular visualization</li>"
|
| 126 |
+
"</ul>"
|
| 127 |
+
f"<p>You can copy this SMILES to these tools: <code>{canonical_smiles}</code></p>"
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
try:
|
| 131 |
+
import psi4 # Check if psi4 is available
|
| 132 |
+
except ImportError:
|
| 133 |
+
return (
|
| 134 |
+
"<p><strong>Psi4 is not available on this platform.</strong> "
|
| 135 |
+
"Molecular orbital calculations require Psi4, which is not supported on Hugging Face Spaces.</p>"
|
| 136 |
+
"<p><strong>Alternative online tools:</strong></p>"
|
| 137 |
+
"<ul>"
|
| 138 |
+
"<li><a href='https://www.webmo.net/' target='_blank'>WebMO</a> - Web-based molecular modeling</li>"
|
| 139 |
+
"<li><a href='https://gaussian.com/' target='_blank'>Gaussian</a> - Quantum chemistry software</li>"
|
| 140 |
+
"<li><a href='https://www.chemcraftprog.com/' target='_blank'>ChemCraft</a> - Molecular visualization</li>"
|
| 141 |
+
"</ul>"
|
| 142 |
+
f"<p>You can copy this SMILES to these tools: <code>{canonical_smiles}</code></p>"
|
| 143 |
)
|
| 144 |
|
| 145 |
try:
|