Skip to content

Commit fd5c797

Browse files
committed
Fix test regression.
1 parent 1b44fea commit fd5c797

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pymatgen/analysis/structure_prediction/dopant_predictor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_dopants_from_shannon_radii(bonded_structure, num_dopants=5, match_oxi_si
8181
- "original_species": The substituted species.
8282
"""
8383
# get a list of all Species for all elements in all their common oxidation states
84-
all_species = [Species(el, oxi) for el in Element for oxi in el.common_oxidation_states]
84+
all_species = [Species(el.symbol, oxi) for el in Element for oxi in el.common_oxidation_states]
8585

8686
# get a series of tuples with (coordination number, specie)
8787
cn_and_species = {

src/pymatgen/core/periodic_table.py

+1
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ def __init__(
10561056
ValueError: If oxidation state passed both in symbol string and via
10571057
oxidation_state kwarg.
10581058
"""
1059+
symbol = str(symbol) # First ensure that any symbol is converted to a string.
10591060
if oxidation_state is not None and symbol.endswith(("+", "-")):
10601061
raise ValueError(
10611062
f"Oxidation state should be specified either in {symbol=} or as {oxidation_state=}, not both."

0 commit comments

Comments
 (0)