Conversation
chryswoods
approved these changes
Oct 31, 2025
Contributor
chryswoods
left a comment
There was a problem hiding this comment.
Looks good. Sorry not to have implemented it - the migration to the frame-based way of working required stubbed implementations on all the older IO classes. The Gro87 class never got the stub implemented...
Contributor
Author
|
No problem, it was very easy to add. I just wish I had thought to look there first, since it took me a while to backtrack my way via the trajectory code itself :-) |
lohedges
added a commit
that referenced
this pull request
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #375 by implementing the missing
SireIO::Gro87::getFrame()method. Previously, a nullFrame()object would be returned whenever a frame loaded from a Gro87 file was accessed, e.g. via aTrajectoryIterator.The PR also adds support for writing trajectory frames to user-defined filenames, rather than writing the output to a frame directory. This uses a
frame_namemap option, which then modifies the filename passed through toSireIO::MoleculeParser::writeToFile. This is mangling is required, sincewriteToFileis a static method. I've then wrapped the functionality in the new Sire API, allowing a user to pass a list of filenames tosire.savewhen the input (object to write) is aTrajectoryIterator. This allows the user to do things like:A unit test validates that the correct output is generated, and that appropriate exceptions are thrown when the input is malformed, i.e. the number of filenames not matching the number of frames in the
TrajectoryIterator, or there being a mismatch in the file extension between filenames.Just to note the diff looks a bit weird owing to the removal of
Gro87::operator[](int i), which now just returns an exception when used.develinto this branch before issuing this pull request (e.g. by runninggit pull origin devel): [y]