Skip to content

Commit

Permalink
Merge pull request #928 from hackingmaterials/ml-evs/deps
Browse files Browse the repository at this point in the history
More dependency upgrades: support for latest pymatgen and numpy
  • Loading branch information
ml-evs committed Mar 26, 2024
2 parents bb71c0f + 802a119 commit 7394a39
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 381 deletions.
2 changes: 2 additions & 0 deletions matminer/featurizers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ def featurize_dataframe(
# Check names to avoid overwriting the current columns
# ConversionFeaturizer have attribute called _overwrite_data which
# determines whether an Error is thrown
if not isinstance(labels, list):
labels = labels.tolist()
overwrite = getattr(self, "_overwrite_data", False)
if not overwrite:
for col in df.columns.values:
Expand Down
5 changes: 3 additions & 2 deletions matminer/featurizers/structure/bonding.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ def _species_from_bondstr(self, bondstr):
species = []
for ss in bondstr.split(self.token):
try:
species.append(Specie.from_string(ss))
except ValueError:
species.append(Specie.from_str(ss))
# pymatgen deprecated from_string in favour of from_str, if it is missing then fallback to from_dict
except (ValueError, AttributeError):
d = {"element": ss, "oxidation_state": 0}
species.append(Specie.from_dict(d))
return tuple(species)
Expand Down
Loading

0 comments on commit 7394a39

Please sign in to comment.