From c4d93f076d179c67b33a3c7e9cb97e56ccfcfdb7 Mon Sep 17 00:00:00 2001 From: jiebin chen Date: Mon, 8 Jun 2026 10:21:13 +0000 Subject: [PATCH] fix(abacus-plot): fix reshape parameter and PDOS plotting issues - Remove invalid 'newshape' keyword from np.reshape() call - Remove unnecessary reassignment of dosplot.ax after _plot() calls Fixes #6864 --- tools/plot-tools/abacus_plot/dos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/plot-tools/abacus_plot/dos.py b/tools/plot-tools/abacus_plot/dos.py index f128f931252..a2d74904c51 100644 --- a/tools/plot-tools/abacus_plot/dos.py +++ b/tools/plot-tools/abacus_plot/dos.py @@ -248,7 +248,7 @@ def _read(self): orb['data'] = np.asarray(data, dtype=float) self.orbitals.append(orb) - self.energy = np.reshape(e_list, newshape=(-1, 1)).astype(float) + self.energy = np.reshape(e_list, (-1, 1)).astype(float) def _all_sum(self) -> Tuple[np.ndarray, int]: res = np.zeros_like(self.orbitals[0]["data"], dtype=float) @@ -423,9 +423,9 @@ def _parial_plot(self, dosplot.plot_params["xlabel_params"]) else: dosplot.ax.set_xlabel("Energy(eV)", size=25) - dosplot.ax = self._plot(dosplot, energy_f, tdos, "TDOS") + self._plot(dosplot, energy_f, tdos, "TDOS") for elem in dos.keys(): - dosplot.ax = self._plot(dosplot, energy_f, dos[elem], elem) + self._plot(dosplot, energy_f, dos[elem], elem) if "notes" in dosplot.plot_params.keys(): dosplot._set_figure(energy_range, dos_range, notes=dosplot.plot_params["notes"])