Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +11 -7
src/streamlit_app.py
CHANGED
|
@@ -1280,13 +1280,17 @@ if atoms is not None:
|
|
| 1280 |
|
| 1281 |
with open(tmp_filepath_opt, 'r') as file_opt:
|
| 1282 |
xyz_content_opt = file_opt.read()
|
| 1283 |
-
|
| 1284 |
-
|
| 1285 |
-
|
| 1286 |
-
|
| 1287 |
-
|
| 1288 |
-
|
| 1289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1290 |
os.unlink(tmp_filepath_opt)
|
| 1291 |
|
| 1292 |
# Convert trajectory to XYZ for download
|
|
|
|
| 1280 |
|
| 1281 |
with open(tmp_filepath_opt, 'r') as file_opt:
|
| 1282 |
xyz_content_opt = file_opt.read()
|
| 1283 |
+
@st.fragment
|
| 1284 |
+
def show_optimized_structure_download_button():
|
| 1285 |
+
# st.button("Release the balloons", help="Fragment rerun")
|
| 1286 |
+
# st.balloons()
|
| 1287 |
+
st.download_button(
|
| 1288 |
+
label="Download Optimized Structure (XYZ)",
|
| 1289 |
+
data=xyz_content_opt,
|
| 1290 |
+
file_name="optimized_structure.xyz",
|
| 1291 |
+
mime="chemical/x-xyz"
|
| 1292 |
+
)
|
| 1293 |
+
show_optimized_structure_download_button()
|
| 1294 |
os.unlink(tmp_filepath_opt)
|
| 1295 |
|
| 1296 |
# Convert trajectory to XYZ for download
|