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

Replace-species #2291

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Replace-species #2291

merged 1 commit into from
Nov 18, 2021

Conversation

janosh
Copy link
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

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
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
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
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
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.

None yet

4 participants