Skip to content

Commit

Permalink
Modify fix for phonon bs plotter to support older pymatgen versions
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Jan 10, 2024
1 parent b7fe5af commit f421905
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
==========

v2.3.7
------

Bugfixes:

- Fixed bug with sumo-phonon-bandplot and recent versions of pymatgen (@utf, #227)

v2.3.6
------

Expand Down
4 changes: 2 additions & 2 deletions sumo/plotting/phonon_bs_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _plot_lines(data, ax, color=None, alpha=1, zorder=1):

# nd is branch index, nb is band index, nk is kpoint index
for nd, nb in itertools.product(
range(len(data["distances"])), range(self.n_bands)
range(len(data["distances"])), range(self._bs.nb_bands)
):
f = freqs[nd][nb]

Expand All @@ -176,7 +176,7 @@ def _plot_lines(data, ax, color=None, alpha=1, zorder=1):
# raise Exception(bs.qpoints)
json_plotter = PhononBSPlotter(bs)
json_data = json_plotter.bs_plot_data()
if json_plotter.n_bands != self.n_bands:
if json_plotter.n_bands != self._bs.nb_bands:
raise Exception(
f"Number of bands in {bs_json} does not match main plot"
)
Expand Down

0 comments on commit f421905

Please sign in to comment.