Skip to content

abacus-plot is not functioning properly #6864

@Zanthoxylum

Description

@Zanthoxylum

Describe the bug

there are two problems.
first,
File "path/abacus-plot", line 33, in <module> sys.exit(load_entry_point('abacus_plot==1.2.0', 'console_scripts', 'abacus-plot')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "path/lib/python3.11/site-packages/abacus_plot/main.py", line 134, in main args.func(args) File "path/lib/python3.11/site-packages/abacus_plot/main.py", line 113, in show_cmdline pdos = PDOS(pdosfile) ^^^^^^^^^^^^^^ File "path/lib/python3.11/site-packages/abacus_plot/dos.py", line 215, in __init__ self._read() File "path/lib/python3.11/site-packages/abacus_plot/dos.py", line 251, in _read self.energy = np.reshape(e_list, newshape=(-1, 1)).astype(float) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: reshape() got an unexpected keyword argument 'newshape'

and if I delete the "newshape=", and re-install it, I can plot the TDOS properly.

Second, it fails to plot PDOS by "abacus-plot -d -p"
M101 ax [<Axes: > <Axes: > <Axes: > <Axes: >] D511 ax [<Axes: > <Axes: > <Axes: > <Axes: >] D420 ax [<Axes: > <Axes: > <Axes: > <Axes: >] D422 ax [<Axes: > <Axes: > <Axes: > <Axes: >] Traceback (most recent call last): File "path/bin/abacus-plot", line 33, in <module> sys.exit(load_entry_point('abacus_plot==1.2.0', 'console_scripts', 'abacus-plot')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "path/lib/python3.11/site-packages/abacus_plot/main.py", line 135, in main args.func(args) File "path/lib/python3.11/site-packages/abacus_plot/main.py", line 102, in show_cmdline pdos.plot(fig=fig, ax=ax, index=index, atom_index=atom_index, species=species, efermi=efermi, shift=shift, File "path/lib/python3.11/site-packages/abacus_plot/dos.py", line 515, in plot dosplot = self._parial_plot(fig=fig, ax=ax, species=species, efermi=efermi, energy_range=energy_range, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "path/lib/python3.11/site-packages/abacus_plot/dos.py", line 423, in _parial_plot dosplot.ax = self._plot(dosplot, energy_f, tdos, "TDOS") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "path/lib/python3.11/site-packages/abacus_plot/dos.py", line 37, in _plot dosplot.ax.plot(energy_f, dos_up, lw=dosplot._lw, linestyle="-", ^^^^^^^^^^^^^^^ AttributeError: 'numpy.ndarray' object has no attribute 'plot'

Expected behavior

No response

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugsBugs that only solvable with sufficient knowledge of DFTInput&OutputSuitable for coders without knowing too many DFT detailsQuestionsRaise your quesiton! We will answer it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions