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

feat: Remove hardcoded snappy-pipeline steps #174

Merged
merged 19 commits into from
Jul 6, 2023
Merged

Conversation

xiamaz
Copy link
Member

@xiamaz xiamaz commented Jun 1, 2023

This wip code removes the need to have hardcoded pipeline steps in cubi-tk. Instead pipeline dependencies will be automatically parsed from the installed snappy-pipeline.

These changes only depend on some conventions in the snappy-pipeline project that should be fairly static (Snakefile needs to contain a wf variable), as otherwise finding the correct pipeline class is difficult.

This partially fixes #165, but can be easily extended to fully support custom pipeline stage names.

@holtgrewe
Copy link
Member

looks good to me in principle, please continue

cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
@xiamaz
Copy link
Member Author

xiamaz commented Jun 7, 2023

TODO:

  • update docs

@xiamaz xiamaz changed the title WIP: Remove hardcoded snappy-pipeline steps feat: Remove hardcoded snappy-pipeline steps Jun 7, 2023
@xiamaz
Copy link
Member Author

xiamaz commented Jun 7, 2023

Docs PR added in bihealth/snappy-pipeline#400

@xiamaz
Copy link
Member Author

xiamaz commented Jun 7, 2023

@holtgrewe This now closes #165, as support for arbitrarily named workflow step folders has been added.

@xiamaz xiamaz requested a review from holtgrewe June 7, 2023 15:52
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Patch coverage: 57.51% and project coverage change: -0.29 ⚠️

Comparison is base (d614fcc) 75.87% compared to head (a9b1c82) 75.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #174      +/-   ##
==========================================
- Coverage   75.87%   75.58%   -0.29%     
==========================================
  Files          95       98       +3     
  Lines        7668     7807     +139     
==========================================
+ Hits         5818     5901      +83     
- Misses       1850     1906      +56     
Impacted Files Coverage Δ
cubi_tk/snappy/kickoff.py 28.37% <20.00%> (+0.07%) ⬆️
cubi_tk/snappy/snappy_workflows.py 47.76% <47.76%> (ø)
tests/hide_modules.py 85.36% <85.36%> (ø)
cubi_tk/snappy/common.py 78.43% <100.00%> (-0.42%) ⬇️
tests/test_snappy_workflows.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@holtgrewe holtgrewe requested review from Nicolai-vKuegelgen and removed request for holtgrewe June 28, 2023 13:33
@Nicolai-vKuegelgen
Copy link
Contributor

Meta question: is there any way to get rid of / hide these warning boxes in the code review?
image

They make the code quite unreadable :(

Copy link
Contributor

@Nicolai-vKuegelgen Nicolai-vKuegelgen left a comment

Choose a reason for hiding this comment

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

Most important general points, rest is in details:

  1. I don't think we should add the snappy code as a general requirement/dependency of cubi-tk, this can (or maybe should be) discussed though. I think checking for the possibility to import snappy_pipeline and then using that is reasonable though.
  2. Several of the new functions defined in cubi-tk/snappy/common.py can probably be replaced by importing things already defined in snappy_pipeline. Doing this should also reduce the amount of new - and not test-covered - code. Also it might make sense to bundle all of the functionality to interface with the snappy code into a single class.

README.md Outdated Show resolved Hide resolved
cubi_tk/snappy/kickoff.py Show resolved Hide resolved
cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
Comment on lines 89 to 94
config, lookup_paths, config_paths = expand_ref(
str(config_path),
config_data,
[str(workflow_step_path), str(workflow_step_path.parent / ".snappy_pipeline")],
)
return config, lookup_paths, config_paths
Copy link
Contributor

Choose a reason for hiding this comment

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

The config object returned as first element of the retruned tuple here is a string. However, most functions working with this expect it to be a (yaml representing) dictionary, likely objects are switched?

cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
cubi_tk/snappy/common.py Outdated Show resolved Hide resolved
cubi_tk/snappy/kickoff.py Outdated Show resolved Hide resolved
cubi_tk/snappy/common.py Show resolved Hide resolved
@xiamaz
Copy link
Member Author

xiamaz commented Jul 5, 2023

@Nicolai-vKuegelgen All comments have been adressed. Import is now optional and the logic for optional imports is also tested.

@xiamaz xiamaz requested a review from Nicolai-vKuegelgen July 5, 2023 16:27
Copy link
Contributor

@Nicolai-vKuegelgen Nicolai-vKuegelgen left a comment

Choose a reason for hiding this comment

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

I think this looks good overall.

A few comments on things that I think could be further improved, but nothing that is absolutely needed.

cubi_tk/snappy/snappy_workflows.py Show resolved Hide resolved
cubi_tk/snappy/kickoff.py Outdated Show resolved Hide resolved
cubi_tk/snappy/kickoff.py Outdated Show resolved Hide resolved
tests/test_snappy_workflows.py Outdated Show resolved Hide resolved
@xiamaz xiamaz merged commit f171217 into bihealth:main Jul 6, 2023
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.

cubi-tk snappyis not yet adapted to new/renamed snappy steps
4 participants