Skip to content

Select a subset of all masses in CenterOfMassesTrajectory - #1281

Merged
MBartkowiakSTFC merged 1 commit into
protosfrom
maciej/fix-com
Aug 13, 2026
Merged

Select a subset of all masses in CenterOfMassesTrajectory#1281
MBartkowiakSTFC merged 1 commit into
protosfrom
maciej/fix-com

Conversation

@MBartkowiakSTFC

Copy link
Copy Markdown
Collaborator

Description of work
Changes CenterOfMassesTrajectory so that the mass array passed to np.average has the same length as the array of atom distances from the molecule centre.

closes #1280

Fixes

  1. Use a list of masses built using the atom indices of the molecule to calculate the average position.
  2. Use a trajectory containing named molecules for testing CenterOfMassesTrajectory in unit tests.

To test
Load a trajectory containing molecules and run CentreOfMassesTrajectory on it.

@oerc0122 oerc0122 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good if it does its job.

@MBartkowiakSTFC
MBartkowiakSTFC merged commit f6e58fe into protos Aug 13, 2026
48 checks passed
@MBartkowiakSTFC
MBartkowiakSTFC deleted the maciej/fix-com branch August 13, 2026 16:04
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.

[BUG] CentreOfMassesTrajectory fails on first step

2 participants