haddock3 icon indicating copy to clipboard operation
haddock3 copied to clipboard

Inconsistent parameter name `top_cluster` / `top_clusters`

Open amjjbonvin opened this issue 10 months ago • 6 comments

There is an inconsitent use of top_cluster and top_clusters in the files of the seletopclusts module, which causes this parameter not to be used. As a consequence be default all clusters are passed to the next stage.

Module/Workflow/Library affected

seletopclusters

Expected behavior

When defining top_cluster the number of clusters passed to the next stage should be limited to the value set.

Actual behavior

default.yaml and __init__.py use top_cluster as variable, while seletopclusts.py uses top_clusters

As a consequence the selection of topX clusters is not working and all clusters are selected, which can lead to a lot of models being passed to the next stage.

Suggestions on how to fix it

change top_cluster to top_clusters in default.yaml and __init__.py

Version

036a68a12a9937edb168405727e1791dd3fd14f7

Additional context

This might have affected work where cluster selection was applied after rigidbody.

amjjbonvin avatar Mar 13 '25 01:03 amjjbonvin

Note that the variable name should then also be changes in two test files. Also it makes more sense to use top_clusters rather than top_cluster as one would expect to select typically more than one cluster

amjjbonvin avatar Mar 13 '25 01:03 amjjbonvin

@amjjbonvin can you give me a practical example where you encountered the problem? top_cluster is passed as an argument to the function select_top_clusts_models (here https://github.com/haddocking/haddock3/blob/036a68a12a9937edb168405727e1791dd3fd14f7/src/haddock/modules/analysis/seletopclusts/seletopclusts.py#L10), so the variable's name doesn't matter. I ran several examples and the selection is working fine.

mgiulini avatar Mar 13 '25 09:03 mgiulini

I agree that top_clusters with an s is better than top_cluster. But, same as marco, I also do not see the error in the current version

VGPReys avatar Mar 13 '25 15:03 VGPReys

None of our current examples test that actually... But there must have been a glitch somewhere as I currently can't reproduce the issue anymore...

amjjbonvin avatar Mar 13 '25 15:03 amjjbonvin

@amjjbonvin i think you forgot to add the steps to replicate - could you please update the issue description?

rvhonorato avatar Mar 18 '25 14:03 rvhonorato

Actually I could not replicate the problem. Must have been some glitch. So in principle, unless we want to change the syntax for consistency, this one can be closed.

amjjbonvin avatar Mar 18 '25 14:03 amjjbonvin