Skip to content

Replace-species#2291

Merged
mkhorton merged 1 commit intomaterialsproject:masterfrom
janosh:replace-species
Nov 18, 2021
Merged

Replace-species#2291
mkhorton merged 1 commit intomaterialsproject:masterfrom
janosh:replace-species

Conversation

@janosh
Copy link
Copy Markdown
Member

@janosh janosh commented Nov 5, 2021

Structure().replace_species doc string should make it clear that original structure is modified in place.

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 5, 2021

Coverage Status

Coverage decreased (-0.6%) to 83.115% when pulling d1d01d6 on janosh:replace-species into 9276567 on materialsproject:master.

return False
for site in self:
if site not in other:
def __eq__(self, other: object) -> bool:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not make this change. I am unclear why your PR is mentioning a replace method but you are modifying the way structure checks for equality.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this wasn't meant to be bunched in with the other small changes in this PR. I'll revert it.

In general, updating all Pymatgen rich comparison functions to send NotImplemented follows recommended practice. See https://docs.python.org/3/library/constants.html#NotImplemented. So maybe worth tackling in a separate PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR mentioned the Structure.replace_species() method cause my original intent was just to update its doc string to make it clearer it makes in-place modifications.

@mkhorton
Copy link
Copy Markdown
Member

Thanks @janosh, I see you reverted the other commit so going to merge this

@mkhorton mkhorton merged commit 8fd02cf into materialsproject:master Nov 18, 2021
@janosh janosh deleted the replace-species branch November 18, 2021 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants