Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to select all clusters in seletopclusts #286

Merged
merged 4 commits into from
Jan 25, 2022
Merged

Add option to select all clusters in seletopclusts #286

merged 4 commits into from
Jan 25, 2022

Conversation

rvhonorato
Copy link
Member

This pr closes #282 by implementing a different logic to loop over the target cluster rankings

@@ -14,13 +15,8 @@ class HaddockModule(BaseHaddockModule):

name = RECIPE_PATH.name

def __init__(
Copy link
Member

Choose a reason for hiding this comment

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

Black lint is killing us. Much better before, also contributions signatures.

Copy link
Member Author

Choose a reason for hiding this comment

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

*killing you, the linting is passing 😉

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, because is not a matter of lint, is a matter of style :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Mine or the lack of yours? 🔥

@@ -34,20 +30,32 @@ def _run(self):

# how many models should we output?
models = []
for target_ranking in self.params['top_cluster']:
if self.params['top_models'] == 'all':
if not self.params["top_cluster"]:
Copy link
Member

Choose a reason for hiding this comment

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

What happen if the user inputs top_cluster = 0 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

good question! let me address that

Copy link
Member Author

Choose a reason for hiding this comment

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

Added an extra check, thanks!

@@ -1,2 +1,2 @@
top_cluster = [1, 2, 3, 4]
top_models = 4
top_cluster = []
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want the defaults to provide all models? Or should the defaults have a more natural value?

Copy link
Member

Choose a reason for hiding this comment

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

Not all models, but models for all clusters - this is a different thing. There is no warranty that the correct solutions are in the top4... and further refinement could well change the ranking at the end.

@@ -26,6 +26,15 @@ def confirm_installation(cls):

def _run(self):
"""Execute the module's protocol."""

if self.params["top_models"] <= 0:
Copy link
Member

Choose a reason for hiding this comment

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

Okay, fine for now but I need to find a better way around this. Also to make sure the right types are passed in the user config files.

@rvhonorato rvhonorato merged commit 30b4b22 into main Jan 25, 2022
@rvhonorato rvhonorato deleted the 282 branch January 25, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add top_cluster=all option to seletopclusts
3 participants