Spaces:
Running
Running
adding extra properties
Browse files
app.py
CHANGED
|
@@ -8,10 +8,10 @@ import numpy as np
|
|
| 8 |
import periodictable
|
| 9 |
from crystal_toolkit.settings import SETTINGS
|
| 10 |
from dash import dcc, html
|
| 11 |
-
from dash.dependencies import Input, Output
|
| 12 |
from datasets import load_dataset
|
|
|
|
| 13 |
from pymatgen.core import Structure
|
| 14 |
-
from pymatgen.ext.matproj import MPRester
|
| 15 |
|
| 16 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 17 |
top_k = 500
|
|
@@ -274,6 +274,8 @@ def display_material(active_cell):
|
|
| 274 |
coords_are_cartesian=True,
|
| 275 |
)
|
| 276 |
|
|
|
|
|
|
|
| 277 |
# Create the StructureMoleculeComponent
|
| 278 |
structure_component = ctc.StructureMoleculeComponent(structure)
|
| 279 |
|
|
@@ -284,6 +286,15 @@ def display_material(active_cell):
|
|
| 284 |
"Energy per atom (eV/atom)": row["energy"] / len(row["species_at_sites"]),
|
| 285 |
"Band Gap (eV)": row["band_gap_direct"] or row["band_gap_indirect"],
|
| 286 |
"Total Magnetization (μB/f.u.)": row["total_magnetization"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
}
|
| 288 |
|
| 289 |
# Format properties as an HTML table
|
|
|
|
| 8 |
import periodictable
|
| 9 |
from crystal_toolkit.settings import SETTINGS
|
| 10 |
from dash import dcc, html
|
| 11 |
+
from dash.dependencies import Input, Output
|
| 12 |
from datasets import load_dataset
|
| 13 |
+
from pymatgen.analysis.structure_analyzer import SpacegroupAnalyzer
|
| 14 |
from pymatgen.core import Structure
|
|
|
|
| 15 |
|
| 16 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 17 |
top_k = 500
|
|
|
|
| 274 |
coords_are_cartesian=True,
|
| 275 |
)
|
| 276 |
|
| 277 |
+
sga = SpacegroupAnalyzer(structure)
|
| 278 |
+
|
| 279 |
# Create the StructureMoleculeComponent
|
| 280 |
structure_component = ctc.StructureMoleculeComponent(structure)
|
| 281 |
|
|
|
|
| 286 |
"Energy per atom (eV/atom)": row["energy"] / len(row["species_at_sites"]),
|
| 287 |
"Band Gap (eV)": row["band_gap_direct"] or row["band_gap_indirect"],
|
| 288 |
"Total Magnetization (μB/f.u.)": row["total_magnetization"],
|
| 289 |
+
"Density (g/cm^3)": structure.density,
|
| 290 |
+
"Fermi energy level (eV)": row["dos_ef"],
|
| 291 |
+
"Crystal system": sga.get_crystal_system(),
|
| 292 |
+
"International Spacegroup": sga.get_symmetry_dataset().international,
|
| 293 |
+
"Magnetic moments (μB/f.u.)": row["magnetic_moments"],
|
| 294 |
+
"Stress tensor (kB)": row["stress_tensor"],
|
| 295 |
+
"Forces on atoms (eV/A)": row["forces"],
|
| 296 |
+
"Bader charges (e-)": row["charges"],
|
| 297 |
+
"DFT Functional": row["functional"],
|
| 298 |
}
|
| 299 |
|
| 300 |
# Format properties as an HTML table
|