From 73defc9d133c3e74454cf87879f69b09aeb2de49 Mon Sep 17 00:00:00 2001 From: raffaele Date: Wed, 8 Nov 2023 14:27:15 +0000 Subject: [PATCH] Fix error plot_kkr --- aiida_kkr/tools/plot_kkr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aiida_kkr/tools/plot_kkr.py b/aiida_kkr/tools/plot_kkr.py index a74caa6d..a5667c2a 100644 --- a/aiida_kkr/tools/plot_kkr.py +++ b/aiida_kkr/tools/plot_kkr.py @@ -1141,12 +1141,14 @@ def make_kkrimp_rmsplot(self, rms_all, stot_all, pks_all, rms_goal, ptitle, **kw # plotting of convergence properties (rms etc.) if len(rms_all) > 0: # sort rms values and flatten array - reorder_rms = array(pks_all).argsort() + reorder_rms = array(pks_all).argsort()[::-1] rms, niter_calcs, stot = [], [0], [] - for i in array(rms_all)[reorder_rms]: + rms_all_sorted = [rms_all[i] for i in reorder_rms] + for i in rms_all_sorted: rms += list(i) niter_calcs.append(len(i) - 0.5) - for i in array(stot_all)[reorder_rms]: + stot_sorted = [stot_all[i] for i in reorder_rms] + for i in stot_sorted: if i is not None: stot += list(i) # now plot