Skip to content

Commit c239fc6

Browse files
committed
remove legacy import for pymatgen.core.periodic_table.Specie, now called Species
1 parent 3d08f81 commit c239fc6

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

crystal_toolkit/components/structure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def get_font_color(hex_code):
604604
try:
605605
formula = Composition.from_dict(legend["composition"]).reduced_formula
606606
except Exception:
607-
# TODO: fix legend for Dummy Specie compositions
607+
# TODO: fix legend for DummySpecies compositions
608608
formula = "Unknown"
609609

610610
legend_colors = OrderedDict(

crystal_toolkit/components/transformations/substitution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def options_layouts(self, state=None, structure=None):
3838
state=state,
3939
help_str="A mapping from an original species (element or element with oxidation state, e.g. O or O2-) "
4040
"to a new species (element, element with oxidation state, or a composition, e.g. O or O2- or "
41-
'{"Au": 0.5, "Cu": 0.5}). In pymatgen, these are Element, Specie and Composition classes '
41+
'{"Au": 0.5, "Cu": 0.5}). In pymatgen, these are Element, Species and Composition classes '
4242
"respectively.",
4343
key_name="Original Species",
4444
value_name="New Species",

crystal_toolkit/core/legend.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from monty.serialization import loadfn
1313
from palettable.colorbrewer.qualitative import Set1_9
1414
from pymatgen.analysis.molecule_structure_comparator import CovalentRadius
15-
from pymatgen.core.periodic_table import Element, Specie
15+
from pymatgen.core.periodic_table import Element, Species
1616
from pymatgen.core.structure import Molecule, Site, SiteCollection
1717
from pymatgen.util.string import unicodeify_species
1818
from sklearn.preprocessing import LabelEncoder
@@ -255,13 +255,13 @@ def generate_categorical_color_scheme_on_the_fly(
255255

256256
return color_scheme
257257

258-
def get_color(self, sp: Specie | Element, site: Site | None = None) -> str:
258+
def get_color(self, sp: Species | Element, site: Site | None = None) -> str:
259259
"""
260260
Get a color to render a specific species. Optionally, you can provide
261261
a site for context, since ...
262262
263263
Args:
264-
sp: Specie or Element
264+
sp: Species or Element
265265
site: Site
266266
267267
Returns: Color
@@ -332,7 +332,7 @@ def get_color(self, sp: Specie | Element, site: Site | None = None) -> str:
332332

333333
return html5_serialize_simple_color(color)
334334

335-
def get_radius(self, sp: Specie | Element, site: Site | None = None) -> float:
335+
def get_radius(self, sp: Species | Element, site: Site | None = None) -> float:
336336

337337
# allow manual override by user
338338
if site and "display_radius" in site.properties:
@@ -351,7 +351,7 @@ def get_radius(self, sp: Specie | Element, site: Site | None = None) -> float:
351351
radius = float(sp.atomic_radius)
352352
elif (
353353
self.radius_scheme == "specified_or_average_ionic"
354-
and isinstance(sp, Specie)
354+
and isinstance(sp, Species)
355355
and sp.oxi_state
356356
):
357357
radius = float(sp.ionic_radius)
@@ -395,10 +395,10 @@ def analyze_site_props(site_collection: SiteCollection) -> dict[str, list[str]]:
395395
return dict(site_prop_names)
396396

397397
@staticmethod
398-
def get_species_str(sp: Specie | Element) -> str:
398+
def get_species_str(sp: Species | Element) -> str:
399399
"""
400400
Args:
401-
sp: Specie or Element
401+
sp: Species or Element
402402
403403
Returns: string representation
404404
"""

0 commit comments

Comments
 (0)