Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revised number of rows in eos precision plot #242

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/aiida_sssp_workflow/cli/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import random
from pathlib import Path
from math import ceil

import click
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -333,7 +334,7 @@ def inspect(node, output):
pass

# if there are 5 plots, need 3 rows, since the output_parametres is in the dict len(precision) / 2 is the number of rows
rows = len(precision) // 2
rows = ceil(len(results) / 2)

# create a figure with 2 columns and rows rows on a a4 size paper
fig, axs = plt.subplots(rows, 2, figsize=(8.27, 11.69), dpi=100)
Expand Down
25 changes: 13 additions & 12 deletions src/aiida_sssp_workflow/workflows/convergence/cohesive_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def compute_xy(

reference_node = orm.load_node(report.reference.uuid)
output_parameters_r: orm.Dict = reference_node.outputs.output_parameters
y_ref = output_parameters_r['cohesive_energy_per_atom']
y_ref = output_parameters_r["cohesive_energy_per_atom"]

xs = []
ys = []
Expand All @@ -198,24 +198,25 @@ def compute_xy(
if node_point.exit_status != 0:
# TODO: log to a warning file for where the node is not finished_okay
continue

x = node_point.wavefunction_cutoff
xs.append(x)

node = orm.load_node(node_point.uuid)
output_parameters_p: orm.Dict = node.outputs.output_parameters

y = (output_parameters_p['cohesive_energy_per_atom'] - y_ref) / y_ref * 100
y = (output_parameters_p["cohesive_energy_per_atom"] - y_ref) / y_ref * 100
ys.append(y)
ys_cohesive_energy_per_atom.append(output_parameters_p['cohesive_energy_per_atom'])
ys_cohesive_energy_per_atom.append(
output_parameters_p["cohesive_energy_per_atom"]
)

return {
'xs': xs,
'ys': ys,
'ys_relative_diff': ys,
'ys_cohesive_energy_per_atom': ys_cohesive_energy_per_atom,
'metadata': {
'unit': '%',
}
"xs": xs,
"ys": ys,
"ys_relative_diff": ys,
"ys_cohesive_energy_per_atom": ys_cohesive_energy_per_atom,
"metadata": {
"unit": "%",
},
}

4 changes: 3 additions & 1 deletion src/aiida_sssp_workflow/workflows/transferability/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ def extract_eos(
continue

raw_eos[k] = point_node.outputs.eos.output_volume_energy.get_dict()
birch_murnaghan_fit[k] = point_node.outputs.eos.output_birch_murnaghan_fit.get_dict()
birch_murnaghan_fit[k] = (
point_node.outputs.eos.output_birch_murnaghan_fit.get_dict()
)
metric_dict[k] = point_node.outputs.output_parameters.get_dict()

return raw_eos, birch_murnaghan_fit, metric_dict