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 --fix to update the meta.yml file of subworkflows. #3077

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

mirpedrol
Copy link
Member

Follow up from #3028 and #3032

Add the option --fix to update the meta.yml file of subworkflows.

@mirpedrol mirpedrol mentioned this pull request Sep 17, 2024
4 tasks
@mirpedrol mirpedrol marked this pull request as ready for review September 20, 2024 08:57
@mirpedrol mirpedrol added this to the 3.0 milestone Sep 26, 2024
@ewels
Copy link
Member

ewels commented Sep 26, 2024

Needs nf-core/modules#6679 to be merged at the same time.

Comment on lines +311 to +314
if self.component_type == "modules":
inputs_table.add_column("Pattern", justify="right", style="green")
elif self.component_type == "subworkflows":
inputs_table.add_column("Structure", justify="right", style="green")
Copy link
Contributor

Choose a reason for hiding this comment

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

because this in the following is basically the same, like the inputs table, can't we just have a generic generate_params_table function to reduce code duplication?

@@ -170,65 +171,95 @@ def _get_included_components_in_chained_tests(self, main_nf_test: Union[Path, st

def get_inputs_from_main_nf(self) -> None:
"""Collect all inputs from the main.nf file."""
inputs: list[list[dict[str, dict[str, str]]]] = []
inputs: Any = [] # Can be 'list[list[dict[str, dict[str, str]]]]' or 'list[str]'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
inputs: Any = [] # Can be 'list[list[dict[str, dict[str, str]]]]' or 'list[str]'
inputs: Union[List[List[Dict[str, Dict[str, str]]]],List[str]] = []

Copy link
Member Author

Choose a reason for hiding this comment

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

This wasn't working, because we append one of the types later on :( I learnt about the overload decorator, but in our case it's not a function.

@@ -230,3 +237,56 @@ def lint_subworkflow(self, swf, progress_bar, registry, local=False):
self.failed += warned

self.failed += [LintResult(swf, *s) for s in swf.failed]

def update_meta_yml_file(self, swf):
Copy link
Contributor

Choose a reason for hiding this comment

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

can't this be shared component code between modules and subworkflows?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not the same structure, subworkflows have the channel name and description and then we will add a new level called structure which describes the channel components

Copy link
Contributor

Choose a reason for hiding this comment

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

but that can be handled like pattern on a modules level, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

but we want the description of the input and output channels for the subworkflow, at the meta.yml level we don't know about the modules.

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.

3 participants