From 7ec2adbc55d3356f164f06e65c9a2b29496fc0a1 Mon Sep 17 00:00:00 2001 From: mikibonacci Date: Sat, 21 Sep 2024 09:11:10 +0000 Subject: [PATCH] Small changes in the results - setting automatic autoscale of the phonon bands - putting INS results at the end --- src/aiidalab_qe_vibroscopy/app/result.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/aiidalab_qe_vibroscopy/app/result.py b/src/aiidalab_qe_vibroscopy/app/result.py index 04ac1fa..e0b532d 100644 --- a/src/aiidalab_qe_vibroscopy/app/result.py +++ b/src/aiidalab_qe_vibroscopy/app/result.py @@ -90,7 +90,11 @@ def _update_view(self): _bands_plot_view_class = PhononBandPdosPlotly( bands_data=phonon_data["bands"][0], pdos_data=phonon_data["pdos"][0], + ).bandspdosfigure + _bands_plot_view_class.update_layout( + yaxis=dict(autorange=True), # Automatically scale the y-axis ) + # the data (bands and pdos) are the first element of the lists phonon_data["bands"] and phonon_data["pdos"]! downloadBandsPdos_widget = DownloadBandsPdosWidget( @@ -101,7 +105,7 @@ def _update_view(self): ) phonon_children += ( - _bands_plot_view_class.bandspdosfigure, + _bands_plot_view_class, ipw.HBox( children=[ downloadBandsPdos_widget, @@ -158,11 +162,6 @@ def _update_view(self): ), ), ) # the comma is required! otherwise the tuple is not detected. - # euphonic - if ins_data: - intensity_maps = EuphonicSuperWidget(fc=ins_data["fc"]) - children_result_widget += (intensity_maps,) - tab_titles.append("Inelastic Neutrons") if spectra_data: # Here we should provide the possibility to have both IR and Raman, @@ -210,6 +209,13 @@ def _update_view(self): dielectric_results = DielectricResults(dielectric_data) children_result_widget += (dielectric_results,) tab_titles.append("Dielectric properties") + + # euphonic + if ins_data: + intensity_maps = EuphonicSuperWidget(fc=ins_data["fc"]) + children_result_widget += (intensity_maps,) + tab_titles.append("Inelastic Neutrons") + self.result_tabs = ipw.Tab(children=children_result_widget)