Skip to content

Conversation

@Dreamstick9
Copy link

@Dreamstick9 Dreamstick9 commented Jan 1, 2026

Fixes #4665

Changes made in this Pull Request:

  • Refactored HydrogenBondAutoCorrel to inherit from AnalysisBase instead of AnalysisFromFunction.
  • Updated the run() method to accept standard arguments (start, stop, step, verbose) and utilize self._slice_traj.
  • Added a client_HydrogenBondAutoCorrel fixture to testsuite/MDAnalysisTests/analysis/conftest.py (excluding multiprocessing).
  • Added a hbond_autocorrel fixture to testsuite/MDAnalysisTests/analysis/conftest.py for test instantiation.
  • Updated TestHydrogenBondAutoCorrel to use the new client fixture.
  • Added a validation check in _slice_traj to raise ValueError for unslicable trajectories.

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS? (I added that in another PR that is under review)

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.


📚 Documentation preview 📚: https://mdanalysis--5195.org.readthedocs.build/en/5195/

@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.74%. Comparing base (1e7644f) to head (77d58ce).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5195      +/-   ##
===========================================
+ Coverage    92.72%   92.74%   +0.01%     
===========================================
  Files          180      180              
  Lines        22472    22475       +3     
  Branches      3188     3187       -1     
===========================================
+ Hits         20838    20845       +7     
+ Misses        1176     1174       -2     
+ Partials       458      456       -2     

☔ 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.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

I'm sorry I'm going to block this PR, there's a few things here that are incorrect.

  1. The original issue is unclear to me, but I assume the idea is to actually implement the class using AnalysisBase.
  2. This isn't the correct subclass pattern for AnalysisBase. You should look at our docs or other analysis classes to see what should be done. You most definitely shouldn't be re-implementing the run method.
  3. The client_HydrogenBondAutoCorrel fixture you added to the tests is doing nothing.
  4. The hbond_autocorrel fixture is also doing nothing.
  5. Your additions to _slice_traj are incorrect - you're adding code before a docstring for some reason. Also I'm not convinced that indexing the zeroth frame is a reasonable check here.
  6. Your message says you refactored by switching away from AnalysisFromFunction, but you didn't do that at all.

The number of errors / inaccuracies here makes me think you've been using an LLM for this contribution, before you continue, can you confirm if you are doing this?

@Dreamstick9
Copy link
Author

Dreamstick9 commented Jan 1, 2026

Hi @IAlibay , thank you for the detailed feedback to answer your question. Yes, I did use an LLM assist with this contribution. My intention was to use it to help me understand the analysis structure and generate this initial refacing logic as I'm new to the code base. The errors you pointed out, especially the code placement before the docstring and the incorrect run() implementation were oversights on my part in reviewing the generated suggestions. I apologise for submitting a pr that wasn't up to the standard and for wasting your time, I will close this pr now. I plan to take a step back and study the documentation properly, so I can understand the class architecture before attempting to contribute again.

@Dreamstick9 Dreamstick9 closed this Jan 1, 2026
@Dreamstick9 Dreamstick9 deleted the fix-hbond-autocorrel branch January 1, 2026 16:46
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.

MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel: Implement parallelization or mark as unparallelizable

2 participants