Skip to content

Commit 858ac96

Browse files
committed
make pourbaix compatible w/ latest pmg
1 parent c51ea91 commit 858ac96

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crystal_toolkit/components/pourbaix.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
from dash.dependencies import Component, Input, Output, State
99
from dash.exceptions import PreventUpdate
1010
from frozendict import frozendict
11-
from pymatgen.analysis.pourbaix_diagram import ELEMENTS_HO, PREFAC, PourbaixDiagram
12-
from pymatgen.core import Composition
11+
from pymatgen.analysis.pourbaix_diagram import PREFAC, PourbaixDiagram
12+
from pymatgen.core import Composition, Element
1313
from pymatgen.util.string import unicodeify
1414
from shapely.geometry import Polygon
1515

1616
import crystal_toolkit.helpers.layouts as ctl
1717
from crystal_toolkit.core.mpcomponent import MPComponent
1818

19+
try:
20+
from pymatgen.analysis.pourbaix_diagram import ELEMENTS_HO
21+
except ImportError:
22+
ELEMENTS_HO = {Element("H"), Element("O")}
23+
1924
__author__ = "Joseph Montoya"
2025
__email__ = "joseph.montoya@tri.global"
2126

0 commit comments

Comments
 (0)