Skip to content

Commit

Permalink
Pre-commit fixings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikibonacci committed Sep 23, 2024
1 parent 8b066d0 commit 1b19624
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/aiidalab_qe_vibroscopy/utils/euphonic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(self, mode="aiidalab-qe app plugin", fc=None, q_path=None):
fc : optional
Force constants if provided.
"""

self.mode = mode

self.upload_widget = UploadPhonopyWidget()
Expand All @@ -154,7 +154,7 @@ def __init__(self, mode="aiidalab-qe app plugin", fc=None, q_path=None):

if fc:
self.fc = fc

self.q_path = q_path

self.plot_button = ipw.Button(
Expand Down
31 changes: 19 additions & 12 deletions src/aiidalab_qe_vibroscopy/utils/euphonic/intensity_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def join_q_paths(coordinates: list, labels: list, delta_q=0.1, G=[0, 0, 0]):
def produce_bands_weigthed_data(
params: Optional[List[str]] = parameters,
fc: ForceConstants = None,
linear_path = None,
linear_path=None,
plot=False,
) -> None:
blockPrint()
Expand Down Expand Up @@ -752,23 +752,30 @@ def export_euphonic_data(node, fermi_energy=None):
return None

output_set = node.outputs.vibronic.phonon_bands
if any(not element for element in node.inputs.structure.pbc):

if any(not element for element in node.inputs.structure.pbc):
vibro_bands = node.inputs.vibronic.phonopy_bands_dict.get_dict()
# Group the band and band_labels
band = vibro_bands['band']
band_labels = vibro_bands['band_labels']

grouped_bands = [item for sublist in [band_labels[i:i+2] for i in range(len(band_labels)-1)] for item in sublist]
grouped_q = [[tuple(band[i:i+3]), tuple(band[i+3:i+6])] for i in range(0, len(band)-3,3)]
band = vibro_bands["band"]
band_labels = vibro_bands["band_labels"]

grouped_bands = [
item
for sublist in [band_labels[i : i + 2] for i in range(len(band_labels) - 1)]
for item in sublist
]
grouped_q = [
[tuple(band[i : i + 3]), tuple(band[i + 3 : i + 6])]
for i in range(0, len(band) - 3, 3)
]
q_path = {
"coordinates":grouped_q,
"labels":grouped_bands,
"delta_q":0.01, #1/A
"coordinates": grouped_q,
"labels": grouped_bands,
"delta_q": 0.01, # 1/A
}
else:
q_path = None

phonopy_calc = output_set.creator
fc = generate_force_constant_instance(phonopy_calc)
# bands = compute_bands(fc)
Expand Down

0 comments on commit 1b19624

Please sign in to comment.