Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More dependency upgrades: support for latest pymatgen and numpy #928

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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