Skip to content

Commit 7394a39

Browse files
authored
Merge pull request #928 from hackingmaterials/ml-evs/deps
More dependency upgrades: support for latest pymatgen and numpy
2 parents bb71c0f + 802a119 commit 7394a39

File tree

5 files changed

+266
-381
lines changed

5 files changed

+266
-381
lines changed

matminer/featurizers/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ def featurize_dataframe(
334334
# Check names to avoid overwriting the current columns
335335
# ConversionFeaturizer have attribute called _overwrite_data which
336336
# determines whether an Error is thrown
337+
if not isinstance(labels, list):
338+
labels = labels.tolist()
337339
overwrite = getattr(self, "_overwrite_data", False)
338340
if not overwrite:
339341
for col in df.columns.values:

matminer/featurizers/structure/bonding.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ def _species_from_bondstr(self, bondstr):
356356
species = []
357357
for ss in bondstr.split(self.token):
358358
try:
359-
species.append(Specie.from_string(ss))
360-
except ValueError:
359+
species.append(Specie.from_str(ss))
360+
# pymatgen deprecated from_string in favour of from_str, if it is missing then fallback to from_dict
361+
except (ValueError, AttributeError):
361362
d = {"element": ss, "oxidation_state": 0}
362363
species.append(Specie.from_dict(d))
363364
return tuple(species)

0 commit comments

Comments
 (0)