Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
110 method
Browse files
app.py
CHANGED
@@ -76,6 +76,7 @@ for subset in subsets:
|
|
76 |
|
77 |
def create_phase_diagram(
|
78 |
elements,
|
|
|
79 |
plot_style,
|
80 |
functional,
|
81 |
finite_temp,
|
@@ -97,7 +98,7 @@ def create_phase_diagram(
|
|
97 |
|
98 |
# entries_df = df.to_pandas()
|
99 |
|
100 |
-
entries_df = entries_df[~entries_df[
|
101 |
|
102 |
isubset = lambda x: set(x).issubset(element_list)
|
103 |
isintersection = lambda x: len(set(x).intersection(element_list)) > 0
|
@@ -116,6 +117,16 @@ def create_phase_diagram(
|
|
116 |
# entries_df = df.to_pandas()
|
117 |
|
118 |
# Fetch all entries from the Materials Project database
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
entries = [
|
120 |
ComputedStructureEntry(
|
121 |
Structure(
|
@@ -125,11 +136,7 @@ def create_phase_diagram(
|
|
125 |
coords_are_cartesian=True,
|
126 |
),
|
127 |
energy=row["energy"],
|
128 |
-
correction=(
|
129 |
-
row["energy_corrected"] - row["energy"]
|
130 |
-
if not np.isnan(row["energy_corrected"])
|
131 |
-
else 0
|
132 |
-
),
|
133 |
entry_id=row["immutable_id"],
|
134 |
parameters={"run_type": row["functional"]},
|
135 |
)
|
@@ -180,9 +187,10 @@ elements_input = gr.Textbox(
|
|
180 |
# max_e_above_hull_slider = gr.Slider(
|
181 |
# minimum=0, maximum=1, value=0.1, label="Maximum Energy Above Hull (eV)"
|
182 |
# )
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
186 |
plot_style_dropdown = gr.Dropdown(choices=["2D", "3D"], label="Plot Style")
|
187 |
functional_dropdown = gr.Dropdown(choices=["PBE", "PBESol", "SCAN"], label="Functional")
|
188 |
finite_temp_toggle = gr.Checkbox(label="Enable Finite Temperature Estimation")
|
@@ -207,7 +215,7 @@ iface = gr.Interface(
|
|
207 |
inputs=[
|
208 |
elements_input,
|
209 |
# max_e_above_hull_slider,
|
210 |
-
|
211 |
plot_style_dropdown,
|
212 |
functional_dropdown,
|
213 |
finite_temp_toggle,
|
|
|
76 |
|
77 |
def create_phase_diagram(
|
78 |
elements,
|
79 |
+
energy_correction,
|
80 |
plot_style,
|
81 |
functional,
|
82 |
finite_temp,
|
|
|
98 |
|
99 |
# entries_df = df.to_pandas()
|
100 |
|
101 |
+
entries_df = entries_df[~entries_df["immutable_id"].isna()]
|
102 |
|
103 |
isubset = lambda x: set(x).issubset(element_list)
|
104 |
isintersection = lambda x: len(set(x).intersection(element_list)) > 0
|
|
|
117 |
# entries_df = df.to_pandas()
|
118 |
|
119 |
# Fetch all entries from the Materials Project database
|
120 |
+
def get_energy_correction(energy_correction, row):
|
121 |
+
if energy_correction == "Database specific, or MP2020":
|
122 |
+
return (
|
123 |
+
row["energy_corrected"] - row["energy"]
|
124 |
+
if not np.isnan(row["energy_corrected"])
|
125 |
+
else 0
|
126 |
+
)
|
127 |
+
elif energy_correction == "The 110 PBE Method":
|
128 |
+
return row["energy"] * 1.1
|
129 |
+
|
130 |
entries = [
|
131 |
ComputedStructureEntry(
|
132 |
Structure(
|
|
|
136 |
coords_are_cartesian=True,
|
137 |
),
|
138 |
energy=row["energy"],
|
139 |
+
correction=get_energy_correction(energy_correction, row),
|
|
|
|
|
|
|
|
|
140 |
entry_id=row["immutable_id"],
|
141 |
parameters={"run_type": row["functional"]},
|
142 |
)
|
|
|
187 |
# max_e_above_hull_slider = gr.Slider(
|
188 |
# minimum=0, maximum=1, value=0.1, label="Maximum Energy Above Hull (eV)"
|
189 |
# )
|
190 |
+
energy_correction_dropdown = gr.Dropdown(
|
191 |
+
choices=["Database specific, or MP2020", "The 110 PBE Method"],
|
192 |
+
label="Energy correction",
|
193 |
+
)
|
194 |
plot_style_dropdown = gr.Dropdown(choices=["2D", "3D"], label="Plot Style")
|
195 |
functional_dropdown = gr.Dropdown(choices=["PBE", "PBESol", "SCAN"], label="Functional")
|
196 |
finite_temp_toggle = gr.Checkbox(label="Enable Finite Temperature Estimation")
|
|
|
215 |
inputs=[
|
216 |
elements_input,
|
217 |
# max_e_above_hull_slider,
|
218 |
+
energy_correction_dropdown,
|
219 |
plot_style_dropdown,
|
220 |
functional_dropdown,
|
221 |
finite_temp_toggle,
|