-
Notifications
You must be signed in to change notification settings - Fork 825
Description
Is your feature request related to a problem? Please describe.
The analysis.hbonds.hbond_analysis.HydrogenBondAnalysis class is very useful and widely used but the code is messy and old and thus hard to maintain, to debug (see e.g. #1687), or to extend. It also does not follow the Analysis API. Performance is also not stellar (e.g. does not use capped_distances())
Describe the solution you'd like
Refactor/rewrite, ideally without breaking the API, which includes
- signature of
HydrogenBondAnalysis - stored time series (attributes timeseries and table
- convenience functions such as
count_by_time(),count_by_type(),timesteps_by_type()
The data structures should be clean, see #2177 for a discussion.
The class should implement the Analysis API ("Bauhaus") from #719.
Describe alternatives you've considered
- Leave the old code in place. This has the advantage that all the users that have been using this piece of code heavily won't get their code broken... See @kain88-de 's The format of timerseries for hydrogen bond and water bridge analysis #2177 (comment)
Before you make any changes to the water bridge output please consider [HydrogenBondAnalysis] is a very widely used feature of MDAnalysis. It is the most frequently cited analysis in papers! I don’t have exact numbers but I looked at almost every paper this year citing MDAnalysis.
Maybe we keep the old time series and add the improved version with a new name.
- Keep old version of the code and deprecated it for release 2.0 (!), i.e., keep it around forever in maintenance mode. Add the new module under a different name.
Current work
Currently there are two PRs with different solutions
- @xiki-tempula wants to base HydrogenBondAnalysis on the more general WaterBridgeAnalysis. PR Move the water bridge analysis to the new analysis class #2087
- @p-j-smith and @bieniekmateusz completely rewrote it in PR Hbond analysis #2237