coarse-graining / cgnet

learning coarse-grained force fields
BSD 3-Clause "New" or "Revised" License
57 stars 26 forks source link

Angle fix #96

Closed brookehus closed 5 years ago

brookehus commented 5 years ago

Development:

Here is a fix for the angle stuff. The angles were done not by the normal convention (always subtracting the vertex point from the non vertex point) and weren't the same as mdtraj. The convention has been fixed.

brookehus commented 5 years ago

Since there's a lot of formatting edits all around, the major changes are:

base, offset = self.get_vectorize_inputs(angle_inds, data)
base *= -1

where the multiplication is new, and in

in get_angles in feature/geometry.py, and the corresponding change in test_backbone_angle_features in tests/test_geometry_features is:

ba = a - b
cb = c - b

where before it was ba = b - a. The changed convention always subtracts the vertex point b.

nec4 commented 5 years ago

I think that this works well. Here is a comparison of GeometryStatistics (orange) and mdtraj.compute_angles (blue) before the changes:

Screen Shot 2019-09-10 at 2 28 04 AM
nec4 commented 5 years ago

and the same plot after the changes: Screen Shot 2019-09-10 at 6 05 43 PM

nec4 commented 5 years ago

Tests also pass for me.

nec4 commented 5 years ago

Other than one tiny doc suggestion, LGTM!

nec4 commented 5 years ago

LGTM!