From 4006186b8110220bd824170a872aed9be1133132 Mon Sep 17 00:00:00 2001 From: Edan Bainglass Date: Mon, 30 Dec 2024 09:33:51 +0000 Subject: [PATCH] Add structure properties to summary --- .../app/result/components/summary/model.py | 12 ++++++++ .../templates/workflow_list_summary.jinja | 22 +++++++++++++- .../templates/workflow_table_summary.jinja | 30 ++++++++++++++++--- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/aiidalab_qe/app/result/components/summary/model.py b/src/aiidalab_qe/app/result/components/summary/model.py index a588fa7c1..c81e75c4d 100644 --- a/src/aiidalab_qe/app/result/components/summary/model.py +++ b/src/aiidalab_qe/app/result/components/summary/model.py @@ -168,6 +168,7 @@ def _generate_report_parameters(self): # drop support for old ui parameters if "workchain" not in ui_parameters: return {} + initial_structure = qeapp_wc.inputs.structure report = { "pk": qeapp_wc.pk, "uuid": str(qeapp_wc.uuid), @@ -177,6 +178,17 @@ def _generate_report_parameters(self): "creation_time_relative": relative_time(qeapp_wc.ctime), "modification_time": format_time(qeapp_wc.mtime), "modification_time_relative": relative_time(qeapp_wc.mtime), + "formula": initial_structure.get_formula(), + "num_atoms": len(initial_structure.sites), + "space_group": "{} ({})".format( + *initial_structure.get_pymatgen().get_space_group_info() + ), + "cell_lengths": "{:.3f} {:.3f} {:.3f}".format( + *initial_structure.cell_lengths + ), + "cell_angles": "{:.0f} {:.0f} {:.0f}".format( + *initial_structure.cell_angles + ), "relaxed": None if ui_parameters["workchain"]["relax_type"] == "none" else ui_parameters["workchain"]["relax_type"], diff --git a/src/aiidalab_qe/app/static/templates/workflow_list_summary.jinja b/src/aiidalab_qe/app/static/templates/workflow_list_summary.jinja index 421cb35a8..4588d070c 100644 --- a/src/aiidalab_qe/app/static/templates/workflow_list_summary.jinja +++ b/src/aiidalab_qe/app/static/templates/workflow_list_summary.jinja @@ -24,11 +24,31 @@ +
+

Structure properties

+ +

Basic settings

+
+

Structure properties

+ + + + + + + + + + + + + + + + + + + + + +
Chemical formula{{ formula }}
Number of atoms{{ num_atoms }}
Space group{{ space_group }}
Cell lengths in Å{{ cell_lengths }}
Cell angles in °{{ cell_angles }}
+

Basic settings

- + {% if relaxed %} @@ -58,7 +83,6 @@ -
Structure geometry optimizedStructure geometry optimization {{ relaxed | fmt_yes_no }}
Periodicity {{ periodicity }}
@@ -126,7 +150,6 @@ Van der Waals correction {{ vdw_corr }} - {% if material_magnetic == "collinear" %} {% if tot_magnetization %} @@ -152,7 +175,6 @@ {{ spin_orbit }} {% endif %} -