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

Don't change global state when hashing molecule #315

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

awvwgk
Copy link
Contributor

@awvwgk awvwgk commented Aug 1, 2023

Description

Changelog description

Status

  • Code base linted
  • Ready to go

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #315 (b236fdf) into master (7b04890) will increase coverage by 1.12%.
Report is 3 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files

@loriab
Copy link
Collaborator

loriab commented Aug 1, 2023

does this need to be a 0.26.1 patch release?

@@ -768,7 +768,6 @@ def get_hash(self):
m = hashlib.sha1()
concat = ""

np.set_printoptions(precision=16)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would the below do what you need or is the precision=16 actually throwing off your hashes in some way?

with np.printoptions(precision=16):
    for field
       ...
       concat +=

Copy link
Contributor Author

@awvwgk awvwgk Aug 2, 2023

Choose a reason for hiding this comment

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

From my testing this actually does not change any hashes. It just is surprising to have mol.get_hash() change the output of printed arrays. The change in the printoptions seems like an artifact to me, rather than an integral part for the hashing.

@loriab loriab merged commit d554646 into MolSSI:master Sep 29, 2023
10 checks passed
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.

2 participants