Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement element filtering in the Ace datasets #206

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

Closed
wants to merge 3 commits into from

Conversation

raimis
Copy link
Collaborator

@raimis raimis commented Jul 19, 2023

Example: load sample containing only H and C

from torchmdnet.datasets import Ace

ds = Ace(".", paths="dataset.h5", atomic_numbers=[1, 6])

@raimis raimis requested a review from RaulPPelaez July 19, 2023 16:52
@raimis raimis self-assigned this Jul 19, 2023
max_gradient=None,
subsample_molecules=1,
):
assert isinstance(paths, (str, list))

arg_hash = f"{paths}{max_gradient}{subsample_molecules}"
arg_hash = f"{paths}{atomic_numbers}{max_gradient}{subsample_molecules}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

atomic_numbers is a list, this string will be something like:
"some_path[1, 2, 3]None1"
Previously it had no spaces, now it does. Is this ok?
Also, atomic_numbers can be [1,2] in some instance and [2,1] in another.
While being functionally equivalent they will have different hashes. Is this what you want?
Otherwise a simple sort fixes it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Store the elements as a set. Now the hash will be the same for different atom order.

@raimis
Copy link
Collaborator Author

raimis commented Jan 4, 2024

@RaulPPelaez at the end, I don't need this.

@raimis raimis closed this Jan 4, 2024
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