-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move calculation and plot methods (#17)
* history, test fixes * refactor history, introduce ExecutedStep dataclass * start using history in run, think about CLI * add max_quant_import * expand CLI example * add History.pop_step, disk_memory mode * added back function to run * moved "small plots" to protzilla2 and created single methods for each plot type * initial exploration of integration plots into data preprocessing * add docstrings for history * separated calculation and plots in data preprocessing * added create_plot and create_plot_from_location to Run class * black * small changes and fix test protein filter * moved normalisation methods and tests test for reference protein normalisation is not working * fixed normalisation tests * added group_by parameter in normalisation * renamed fixtures * moved test_plotting to test_run and renamed it to test_run_calculate_from_location * fixed some merge conflicts * added docstring to migrated methds * add docstring to filter proteins and minor changes * reformatting * Update protzilla/constants/method_mapping.py Co-authored-by: antonneubauer <[email protected]> * renamed method_mapping to location_mapping and added short description for data structures * Update protzilla/data_preprocessing/normalisation.py Co-authored-by: antonneubauer <[email protected]> * Update protzilla/data_preprocessing/plots.py Co-authored-by: antonneubauer <[email protected]> * Update protzilla/data_preprocessing/plots.py Co-authored-by: antonneubauer <[email protected]> * added conftest with option show-figures * added show_figure to test_filter_proteins and renamed fixture * normalisation plot methods return now a list * added z_score normalisation * small changes in docstring from normalisation and filter proteins * added log_transformation * added outlier detection methds * added outlier detection plots * added tests for filter_samples * added filter_samples plot * added knn imputation * added all imputation methods * fixed tests, added plot tests for imputation * starting test_plots, not finished * adding test_plots and fixing pytest_dependencies * merge from main * Apply suggestions from code review Co-authored-by: antonneubauer <[email protected]> * adopting changes * reformatted with black * reformat with precommithook * remove comment --------- Co-authored-by: brokkoli71 <[email protected]> Co-authored-by: Fynn <[email protected]> Co-authored-by: antonneubauer <[email protected]> Co-authored-by: brokkoli71 <[email protected]>
- Loading branch information
1 parent
89fd3b2
commit 148ba0e
Showing
57 changed files
with
4,572 additions
and
1,845 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[coverage:run] | ||
relative_files = True | ||
omit = user_data/*, db.sqlite3, constants/*, | ||
[coverage:run] | ||
relative_files = True | ||
omit = user_data/*, db.sqlite3, constants/*, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
--- | ||
name: Issue Template | ||
about: Standard Issue Template | ||
title: | ||
labels: | ||
project: PROTzilla 2 | ||
|
||
--- | ||
|
||
<Useful Description> | ||
|
||
|
||
|
||
## Acceptance Criteria | ||
- [ ] | ||
--- | ||
name: Issue Template | ||
about: Standard Issue Template | ||
title: | ||
labels: | ||
project: PROTzilla 2 | ||
|
||
--- | ||
|
||
<Useful Description> | ||
|
||
|
||
|
||
## Acceptance Criteria | ||
- [ ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
--- | ||
name: TODO Template | ||
about: TODO Issue Template | ||
title: '#TODO <issue_nr>' | ||
labels: todo | ||
project: 'PROTzilla2' | ||
|
||
--- | ||
|
||
<Description> | ||
|
||
search for #TODO <issue_nr> | ||
--- | ||
name: TODO Template | ||
about: TODO Issue Template | ||
title: '#TODO <issue_nr>' | ||
labels: todo | ||
project: 'PROTzilla2' | ||
|
||
--- | ||
|
||
<Description> | ||
|
||
search for #TODO <issue_nr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
PR for #<Issue Number> | ||
|
||
Description (what might a Reviewer want to know) | ||
|
||
## PR checklist | ||
|
||
- [ ] main-branch has been merged into local branch to resolve conflicts | ||
- [ ] tests and linter have passed AFTER local merge | ||
- [ ] at least one other dev reviewed and approved | ||
- [ ] documentation | ||
- [ ] tests | ||
PR for #<Issue Number> | ||
|
||
Description (what might a Reviewer want to know) | ||
|
||
## PR checklist | ||
|
||
- [ ] main-branch has been merged into local branch to resolve conflicts | ||
- [ ] tests and linter have passed AFTER local merge | ||
- [ ] at least one other dev reviewed and approved | ||
- [ ] documentation | ||
- [ ] tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
name: CI Pipeline | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Analysing the code with autoflake | ||
run: python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables --expand-star-imports --ignore-init-module-imports $(git ls-files '*.py') | ||
|
||
- name: run tests, build coverage file | ||
run: | | ||
export PYTHONPATH=. pytest | ||
pytest --cache-clear --cov=. --cov-branch --cov-report term-missing tests/protzilla | ||
- name: format with black | ||
run: python -m black . | ||
|
||
- name: Coverage comment | ||
id: coverage_comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Store Pull Request comment to be posted | ||
uses: actions/upload-artifact@v3 | ||
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | ||
with: | ||
name: python-coverage-comment-action | ||
path: python-coverage-comment-action.txt | ||
name: CI Pipeline | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Analysing the code with autoflake | ||
run: python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables --expand-star-imports --ignore-init-module-imports $(git ls-files '*.py') | ||
|
||
- name: run tests, build coverage file | ||
run: | | ||
export PYTHONPATH=. pytest | ||
pytest --cache-clear --cov=. --cov-branch --cov-report term-missing tests/protzilla | ||
- name: format with black | ||
run: python -m black . | ||
|
||
- name: Coverage comment | ||
id: coverage_comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Store Pull Request comment to be posted | ||
uses: actions/upload-artifact@v3 | ||
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | ||
with: | ||
name: python-coverage-comment-action | ||
path: python-coverage-comment-action.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
name: Post coverage comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
test: | ||
name: Run tests & display coverage | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
# DO NOT run actions/checkout@v2 here, for security reasons | ||
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
- name: Post comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }} | ||
# Update those if you changed the default values: | ||
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action | ||
# COMMENT_FILENAME: python-coverage-comment-action.txt | ||
name: Post coverage comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
test: | ||
name: Run tests & display coverage | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
# DO NOT run actions/checkout@v2 here, for security reasons | ||
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
- name: Post comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }} | ||
# Update those if you changed the default values: | ||
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action | ||
# COMMENT_FILENAME: python-coverage-comment-action.txt |
Oops, something went wrong.