Skip to content

Commit

Permalink
Add structure properties to summary
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 30, 2024
1 parent a0c1893 commit e8d78a4
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/aiidalab_qe/app/result/components/summary/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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"],
Expand Down
22 changes: 21 additions & 1 deletion src/aiidalab_qe/app/static/templates/workflow_list_summary.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,31 @@
</li>
</ul>
</div>
<div class="summary-table" id="structure-properties">
<h2>Structure properties</h2>
<ul>
<li>
<strong>Chemical formula:</strong> {{ formula }}
</li>
<li>
<strong>Number of atoms:</strong> {{ num_atoms }}
</li>
<li>
<strong>Space group:</strong> {{ space_group }}
</li>
<li>
<strong>Cell lengths in Å:</strong> {{ cell_lengths }}
</li>
<li>
<strong>Cell angles in °:</strong> {{ cell_angles }}
</li>
</ul>
</div>
<div class="summary-table" id="basic-settings">
<h2>Basic settings</h2>
<ul>
<li>
<strong>Structure geometry optimized:</strong> {{ relaxed | fmt_yes_no }}
<strong>Structure geometry optimization:</strong> {{ relaxed | fmt_yes_no }}
</li>
{% if relaxed %}
<li>
Expand Down
30 changes: 26 additions & 4 deletions src/aiidalab_qe/app/static/templates/workflow_table_summary.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,36 @@
</tr>
</table>
</div>
<div class="summary-table" id="structure-properties">
<h2>Structure properties</h2>
<table>
<tr>
<td>Chemical formula</td>
<td>{{ formula }}</td>
</tr>
<tr>
<td>Number of atoms</td>
<td>{{ num_atoms }}</td>
</tr>
<tr>
<td>Space group</td>
<td>{{ space_group }}</td>
</tr>
<tr>
<td>Cell lengths in Å</td>
<td>{{ cell_lengths }}</td>
</tr>
<tr>
<td>Cell angles in °</td>
<td>{{ cell_angles }}</td>
</tr>
</table>
</div>
<div class="summary-table" id="basic-settings">
<h2>Basic settings</h2>
<table>
<tr>
<td>Structure geometry optimized</td>
<td>Structure geometry optimization</td>
<td>{{ relaxed | fmt_yes_no }}</td>
</tr>
{% if relaxed %}
Expand All @@ -58,7 +83,6 @@
<td>Periodicity</td>
<td>{{ periodicity }}</td>
</tr>

</table>
</div>
<div class="summary-table" id="advanced-settings">
Expand Down Expand Up @@ -126,7 +150,6 @@
<td>Van der Waals correction</td>
<td>{{ vdw_corr }}</td>
</tr>

{% if material_magnetic == "collinear" %}
{% if tot_magnetization %}
<tr>
Expand All @@ -152,7 +175,6 @@
<td>{{ spin_orbit }}</td>
</tr>
{% endif %}

</table>
</div>

Expand Down

0 comments on commit e8d78a4

Please sign in to comment.