Skip to content

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