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

add missing data in format atoms #276

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

lory-w
Copy link
Contributor

@lory-w lory-w commented Aug 19, 2024

Related to #275
Part of the problem is ase atoms is missing ptr and batch when converting to dictionary.

@laserkelvin laserkelvin self-requested a review August 19, 2024 18:13
Copy link
Collaborator

@laserkelvin laserkelvin left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@laserkelvin laserkelvin merged commit 262a094 into IntelLabs:main Aug 19, 2024
3 checks passed
@lory-w lory-w deleted the 275-ase-missing-data branch August 19, 2024 18:18
@melo-gonzo
Copy link
Collaborator

A note for the future if any other errors pop up around this : we can also use concatenate_keys from matsciml.datasets.utils to add these attributes in a more robust way.

@laserkelvin
Copy link
Collaborator

@melo-gonzo can you elaborate?

Just checking to make sure I understand what you mean

@melo-gonzo
Copy link
Collaborator

I patched this in my mp-tests branch by just using that function as a final step before passing into .predict in the calculate function. Just wanted to note it in case we see any issues again

    def calculate(
        self,
        atoms=None,
        properties: list[Literal["energy", "forces"]] = ["energy", "forces"],
        system_changes=...,
    ) -> None:
        # retrieve atoms even if not passed
        Calculator.calculate(self, atoms)
        # get into format ready for matsciml model
        data_dict = self._format_pipeline(atoms)
        # run the data structure through the model
        data_dict = concatenate_keys([data_dict])
        output = self.task_module.predict(data_dict)
        ...

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.

3 participants