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 method to extend trajectory #242

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Add method to extend trajectory #242

merged 2 commits into from
Jan 31, 2024

Conversation

stefsmeets
Copy link
Contributor

This PR adds a method to extend the current trajectory with another trajectory. I mimicked the api from list.extend. Extending fails if any of the metadata (time step, lattice, etc) does not match.

Closes #236

@stefsmeets
Copy link
Contributor Author

Hi @SCiarella , Could you review this PR and let me know what you think?

@stefsmeets stefsmeets requested a review from SCiarella January 23, 2024 13:22
@SCiarella
Copy link
Contributor

I found this extend method from pymatgen, which is very similar to what you implemented except for being a bit more strict on the metadata. Can we directly use this one?

@stefsmeets
Copy link
Contributor Author

Ah, I should have checked. Yes that's way better! I will check if it works and then close this PR. Thanks!

@stefsmeets
Copy link
Contributor Author

We may still need to have some custom code to make sure the extended trajectory is actually a gemdat trajectory.

@stefsmeets
Copy link
Contributor Author

OK, seems like the pymatgen implementation covers our use case. I added a test so that we can keep track of this functionality.

@stefsmeets stefsmeets merged commit c0b76ce into main Jan 31, 2024
3 checks passed
@stefsmeets stefsmeets deleted the trajectory_extend branch January 31, 2024 09:05
Copy link
Contributor

@SCiarella SCiarella left a comment

Choose a reason for hiding this comment

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

Perfect!

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.

Merge consecutive trajectories
2 participants