-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix: SpectrumPlotter.add_spectra #3529
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @minhsueh! Can you add a test for this method to prevent future regressions?
Hi @janosh, I have added a test in pymatgen.tests.vis.test_plotters Also, I added a line to check the given object has attributes x and y in SpectrumPlotter.add_spectrum. This can directly point out the problem that the given object has no x and y.
Please let me know if anything is needed. |
…ename extension instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @minhsueh! 👍
PR labeled breaking because I dropped superfluous img_format="eps"
kwarg.
Specify image format via filename extension instead.
Original
SpectrumPlotter
inpymatgen.vis.plotters
Issue 1:
The original docstring suggests using the Dos object, but attributes x and y were already overridden to energies and densities in Dos, which caused the error:
Although the
DosPlotter
is available to plot DOS, I think this function shouldn't be deprecated because it can still parseSpectrum
.Suggestion 1:
Update the docstring to reflect Spectrum support.
Issue 2:
When I passed in
Spectrum
, it resulted in the error:Reason: Recursive call within the function.
Suggestion 2:
Modify:
to:
Note:
pymatgen.tests.vis.test_plotters.py
to test.