Skip to content

Fix ValueError: not enough values to unpack in PDPlotter if no unstable entries in PD - #2908

Merged
janosh merged 3 commits into
masterfrom
gh-2885
Mar 24, 2023
Merged

Fix ValueError: not enough values to unpack in PDPlotter if no unstable entries in PD#2908
janosh merged 3 commits into
masterfrom
gh-2885

Conversation

@janosh

@janosh janosh commented Mar 24, 2023

Copy link
Copy Markdown
Member

Closes #2885.

933d3eb fix ValueError: not enough values to unpack (expected 2, got 0)
f654d9f add test to prevent regression

janosh added 2 commits March 23, 2023 17:36
in PDPlotter: unstable_entries, unstable_coords = zip(*self.pd_plot_data[2].items())
@janosh
janosh enabled auto-merge (squash) March 24, 2023 00:37
self = <test_phase_diagram.PDPlotterTest testMethod=test_plotly_plots>

    def test_plotly_plots(self):
        # Also very basic tests. Ensures callability and 2D vs 3D properties.
>       self.plotter_binary_plotly.get_plot()

pymatgen/analysis/tests/test_phase_diagram.py:914:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pymatgen/analysis/phase_diagram.py:2226: in get_plot
    stable_marker_plot, unstable_marker_plot = self._create_plotly_markers(label_uncertainties)
pymatgen/analysis/phase_diagram.py:3026: in _create_plotly_markers
    unstable_props = get_marker_props(unstable_coords, unstable_entries, stable=False)
pymatgen/analysis/phase_diagram.py:2979: in get_marker_props
    energy = round(self._pd.get_form_energy_per_atom(entry), 3)
pymatgen/analysis/phase_diagram.py:575: in get_form_energy_per_atom
    return self.get_form_energy(entry) / entry.composition.num_atoms
@janosh
janosh merged commit c6928cc into master Mar 24, 2023
@janosh
janosh deleted the gh-2885 branch March 24, 2023 01:28
jmmshn pushed a commit to jmmshn/pymatgen that referenced this pull request Mar 30, 2023
…le entries in PD (materialsproject#2908)

* fix ValueError: not enough values to unpack (expected 2, got 0)

in PDPlotter: unstable_entries, unstable_coords = zip(*self.pd_plot_data[2].items())

* add test to prevent regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDPlotter fails when there is no unstable entry

1 participant