Skip to content

Update doc strings#72

Open
hannahbaumann wants to merge 9 commits intomainfrom
fix_docstrings
Open

Update doc strings#72
hannahbaumann wants to merge 9 commits intomainfrom
fix_docstrings

Conversation

@hannahbaumann
Copy link
Contributor

No description provided.

@hannahbaumann hannahbaumann self-assigned this Jan 26, 2026
@hannahbaumann hannahbaumann linked an issue Jan 28, 2026 that may be closed by this pull request
@hannahbaumann
Copy link
Contributor Author

pre-commit.ci autofix

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.10%. Comparing base (5260e3b) to head (b41bd7e).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #72      +/-   ##
==========================================
+ Coverage   88.16%   96.10%   +7.94%     
==========================================
  Files           7        6       -1     
  Lines         338      334       -4     
==========================================
+ Hits          298      321      +23     
+ Misses         40       13      -27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hannahbaumann
Copy link
Contributor Author

pre-commit.ci autofix

@IAlibay IAlibay requested a review from jthorton February 10, 2026 13:38

Choose a reason for hiding this comment

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

use a consistent type for the dataset it seems to interchange nc.Dataset and netCDF4.Dataset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this!

) -> dict[str, list[float]]:
"""Generate structural analysis of RBFE simulation
"""
Compute structural RMSD-based metrics for a multistate RBFE simulation.

Choose a reason for hiding this comment

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

Just checking this is correct and it only works on RBFEs and not ABFEs as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should also work for ABFE so I changed this to BFE.

consecutive frames, it is translated by an integer number of box
vectors to keep its motion continuous.

The transformation operates in-place on the AtomGroup coordinates

Choose a reason for hiding this comment

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

Maybe this should be in the notes as well with the other caveats?

Comment on lines 26 to +42
Identifies two AtomGroups:
- protein, defined as having standard amino acid names, then filtered
down to CA
- ligand, defined as resname UNK

Then applies some transformations.
Depending on whether a protein is present, a sequence of trajectory
transformations is applied:

If a protein is present:
- prevents the protein from jumping between periodic images
- moves the ligand to the image closest to the protein
- aligns the entire system to minimise the protein RMSD
(class:`NoJump`)
- moves the ligand to the image closest to the protein (:class:`Minimiser`)
- aligns the entire system to minimise the protein RMSD (:class:`Aligner`)

If only a ligand:
If only a ligand is present:
- prevents the ligand from jumping between periodic images
- Aligns the ligand to minimize its RMSD

Choose a reason for hiding this comment

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

Details on the method should go under Notes I think.

Comment on lines +106 to +116
For each thermodynamic state (lambda), this function:
- Loads the trajectory using ``FEReader``
- Applies standard PBC-handling and alignment transformations
- Computes protein and ligand structural metrics over time

The following analyses are produced per state:
- 1D protein CA RMSD time series
- 1D ligand RMSD time series
- Ligand center-of-mass displacement from its initial position
(``ligand_wander``)
- Flattened 2D protein RMSD matrix (pairwise RMSD between frames)

Choose a reason for hiding this comment

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

I think method details are best in a Notes section.

Comment on lines +102 to +105
This transformation performs an on-the-fly least-squares alignment
of the entire universe to a reference AtomGroup.
At each frame, the coordinates are translated and rotated to minimize the
RMSD of the atoms relative to their positions in the reference.

Choose a reason for hiding this comment

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

Lets put all method details in notes sections.

Comment on lines +19 to +23
The timestep is inferred from the serialized MCMC move stored in the
``mcmc_moves`` group of the NetCDF file. Specifically, this assumes the
move defines both a ``timestep`` and ``n_steps`` parameter, such that

dt_iteration = n_steps * timestep

Choose a reason for hiding this comment

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

Probably should be in the notes section?

Copy link

@jthorton jthorton left a comment

Choose a reason for hiding this comment

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

Just a couple of changes: I think it would be great to unify the functions to discuss implementation details and background in the notes sections, and keep the extended description to clarify functionality that might not be clear from the short description.

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.

Fix doc strings

2 participants