From 67181d9aac8e3c7fcf9418a640c45ada484c7980 Mon Sep 17 00:00:00 2001 From: Sean Kavanagh Date: Sat, 22 Jun 2024 18:23:16 -0400 Subject: [PATCH] Minor fix, only normalise `proj_xyz` if `normalise = True` --- easyunfold/procar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/easyunfold/procar.py b/easyunfold/procar.py index 2d75f53..58ac1e1 100644 --- a/easyunfold/procar.py +++ b/easyunfold/procar.py @@ -154,10 +154,10 @@ def _read(self, fobj, parsed_kpoints=None): if self.normalise: self.normalise_projs(proj_data) - if proj_xyz is not None: - proj_sum = np.sum(proj_xyz, axis=(-3, -2, -1), keepdims=True) - proj_sum[proj_sum == 0] = 1 - proj_xyz /= proj_sum + if proj_xyz is not None: + proj_sum = np.sum(proj_xyz, axis=(-3, -2, -1), keepdims=True) + proj_sum[proj_sum == 0] = 1 + proj_xyz /= proj_sum # Update the parsed kpoints parsed_kpoints.update({kvec_section_counter_tuple[0] for kvec_section_counter_tuple in this_procar_parsed_kpoints})