protein-quest 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of protein-quest might be problematic. Click here for more details.

Files changed (90) hide show
  1. protein_quest-0.10.0/.github/workflows/ci.yml +84 -0
  2. protein_quest-0.10.0/.github/workflows/pages.yml +68 -0
  3. protein_quest-0.10.0/.github/workflows/pypi-publish.yml +26 -0
  4. protein_quest-0.10.0/.gitignore +89 -0
  5. protein_quest-0.10.0/.python-version +1 -0
  6. protein_quest-0.10.0/.vscode/extensions.json +8 -0
  7. protein_quest-0.10.0/CITATION.cff +26 -0
  8. protein_quest-0.10.0/CODE_OF_CONDUCT.md +128 -0
  9. protein_quest-0.10.0/CONTRIBUTING.md +108 -0
  10. protein_quest-0.10.0/LICENSE +201 -0
  11. protein_quest-0.10.0/PKG-INFO +325 -0
  12. protein_quest-0.10.0/README.md +293 -0
  13. protein_quest-0.10.0/docs/CONTRIBUTING.md +1 -0
  14. protein_quest-0.10.0/docs/index.md +1 -0
  15. protein_quest-0.10.0/docs/notebooks/.gitignore +4 -0
  16. protein_quest-0.10.0/docs/notebooks/alphafold.ipynb +463 -0
  17. protein_quest-0.10.0/docs/notebooks/index.md +3 -0
  18. protein_quest-0.10.0/docs/notebooks/pdbe.ipynb +282 -0
  19. protein_quest-0.10.0/docs/notebooks/uniprot.ipynb +401 -0
  20. protein_quest-0.10.0/docs/protein-quest-mcp.png +0 -0
  21. protein_quest-0.10.0/mkdocs.yml +84 -0
  22. protein_quest-0.10.0/pyproject.toml +178 -0
  23. protein_quest-0.10.0/src/protein_quest/__init__.py +0 -0
  24. protein_quest-0.10.0/src/protein_quest/__version__.py +2 -0
  25. protein_quest-0.10.0/src/protein_quest/alphafold/__init__.py +1 -0
  26. protein_quest-0.10.0/src/protein_quest/alphafold/confidence.py +221 -0
  27. protein_quest-0.10.0/src/protein_quest/alphafold/entry_summary.py +64 -0
  28. protein_quest-0.10.0/src/protein_quest/alphafold/fetch.py +534 -0
  29. protein_quest-0.10.0/src/protein_quest/cli.py +1428 -0
  30. protein_quest-0.10.0/src/protein_quest/converter.py +46 -0
  31. protein_quest-0.10.0/src/protein_quest/emdb.py +37 -0
  32. protein_quest-0.10.0/src/protein_quest/filters.py +164 -0
  33. protein_quest-0.10.0/src/protein_quest/go.py +165 -0
  34. protein_quest-0.10.0/src/protein_quest/io.py +350 -0
  35. protein_quest-0.10.0/src/protein_quest/mcp_server.py +256 -0
  36. protein_quest-0.10.0/src/protein_quest/parallel.py +114 -0
  37. protein_quest-0.10.0/src/protein_quest/pdbe/__init__.py +1 -0
  38. protein_quest-0.10.0/src/protein_quest/pdbe/fetch.py +68 -0
  39. protein_quest-0.10.0/src/protein_quest/py.typed +0 -0
  40. protein_quest-0.10.0/src/protein_quest/ss.py +280 -0
  41. protein_quest-0.10.0/src/protein_quest/structure.py +244 -0
  42. protein_quest-0.10.0/src/protein_quest/taxonomy.py +149 -0
  43. protein_quest-0.10.0/src/protein_quest/uniprot.py +975 -0
  44. protein_quest-0.10.0/src/protein_quest/utils.py +547 -0
  45. protein_quest-0.10.0/tests/alphafold/AF-A1YPR0-F1-model_v4.pdb +4952 -0
  46. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_alphafold_db_version.yaml +48 -0
  47. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_many.yaml +55567 -0
  48. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_many_all_isoforms.yaml +51 -0
  49. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_many_gzipped.yaml +42326 -0
  50. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_many_no_summary.yaml +9431 -0
  51. protein_quest-0.10.0/tests/alphafold/cassettes/test_fetch/test_fetch_many_no_summary_with_version.yaml +9385 -0
  52. protein_quest-0.10.0/tests/alphafold/test_confidence.py +156 -0
  53. protein_quest-0.10.0/tests/alphafold/test_entry_summary.py +16 -0
  54. protein_quest-0.10.0/tests/alphafold/test_fetch.py +301 -0
  55. protein_quest-0.10.0/tests/cassettes/test_cli/test_search_pdbe.yaml +1023 -0
  56. protein_quest-0.10.0/tests/cassettes/test_cli/test_search_uniprot.yaml +64 -0
  57. protein_quest-0.10.0/tests/cassettes/test_cli/test_search_uniprot_details.yaml +87 -0
  58. protein_quest-0.10.0/tests/cassettes/test_emdb/test_fetch.yaml +3559 -0
  59. protein_quest-0.10.0/tests/cassettes/test_go/test_search_gene_ontology_term.yaml +39 -0
  60. protein_quest-0.10.0/tests/cassettes/test_taxonomy/test_search_taxon.yaml +1862 -0
  61. protein_quest-0.10.0/tests/cassettes/test_taxonomy/test_search_taxon_by_id.yaml +80 -0
  62. protein_quest-0.10.0/tests/cassettes/test_uniprot/TestSearch4AfExternalIsoforms.test_do_not_match_external_isoform.yaml +62 -0
  63. protein_quest-0.10.0/tests/cassettes/test_uniprot/TestSearch4AfExternalIsoforms.test_match_canonical_isoform.yaml +66 -0
  64. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_map_uniprot_accessions2uniprot_details.yaml +145 -0
  65. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4af.yaml +66 -0
  66. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4af_ok_sequence_length.yaml +66 -0
  67. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4af_too_big_sequence_length.yaml +62 -0
  68. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4af_too_small_sequence_length.yaml +62 -0
  69. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4emdb.yaml +65 -0
  70. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4interaction_partners.yaml +382 -0
  71. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4macromolecular_complexes.yaml +382 -0
  72. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4pdb.yaml +71 -0
  73. protein_quest-0.10.0/tests/cassettes/test_uniprot/test_search4uniprot.yaml +64 -0
  74. protein_quest-0.10.0/tests/conftest.py +18 -0
  75. protein_quest-0.10.0/tests/fixtures/2Y29.cif.gz +0 -0
  76. protein_quest-0.10.0/tests/fixtures/3JRS_B2A.cif.gz +0 -0
  77. protein_quest-0.10.0/tests/pdbe/cassettes/test_fetch/test_fetch.yaml +179 -0
  78. protein_quest-0.10.0/tests/pdbe/test_fetch.py +29 -0
  79. protein_quest-0.10.0/tests/test_cli.py +101 -0
  80. protein_quest-0.10.0/tests/test_converter.py +23 -0
  81. protein_quest-0.10.0/tests/test_emdb.py +17 -0
  82. protein_quest-0.10.0/tests/test_go.py +40 -0
  83. protein_quest-0.10.0/tests/test_io.py +230 -0
  84. protein_quest-0.10.0/tests/test_mcp.py +13 -0
  85. protein_quest-0.10.0/tests/test_ss.py +225 -0
  86. protein_quest-0.10.0/tests/test_structure.py +188 -0
  87. protein_quest-0.10.0/tests/test_taxonomy.py +52 -0
  88. protein_quest-0.10.0/tests/test_uniprot.py +579 -0
  89. protein_quest-0.10.0/tests/test_utils.py +518 -0
  90. protein_quest-0.10.0/uv.lock +2940 -0
@@ -0,0 +1,84 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ name: test
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ id-token: write
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v6
23
+ - name: Install the project
24
+ run: uv sync --locked --dev --extra mcp
25
+ - name: Install pocl
26
+ run: uv pip install pocl-binary-distribution==3.0
27
+ - name: Cache downloaded test data
28
+ uses: actions/cache@v4
29
+ with:
30
+ path: ~/.cache/protein-quest-tests
31
+ key: cached-protein-quest-tests
32
+ - name: Run tests
33
+ run: |
34
+ uv run pytest --cov --cov-report=xml
35
+ - name: Run codacy-coverage-reporter
36
+ uses: codacy/codacy-coverage-reporter-action@v1.3.0
37
+ with:
38
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
39
+ coverage-reports: coverage.xml
40
+
41
+ build:
42
+ name: build
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@v6
48
+ - name: Build the project
49
+ run: uv build
50
+ lint:
51
+ name: lint
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - name: Install uv
56
+ uses: astral-sh/setup-uv@v6
57
+ - name: Run linters
58
+ run: uvx ruff check
59
+ typing:
60
+ name: typing
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ - name: Install uv
65
+ uses: astral-sh/setup-uv@v6
66
+ - name: Install the project
67
+ run: uv sync --locked --dev --extra mcp
68
+ - name: Run type checkers
69
+ run: uv run pyrefly check src tests
70
+ typing-docs:
71
+ name: typing-docs
72
+ runs-on: ubuntu-latest
73
+ steps:
74
+ - uses: actions/checkout@v4
75
+ - name: Install uv
76
+ uses: astral-sh/setup-uv@v6
77
+ - name: Install the project
78
+ run: uv sync --group docs-type
79
+ - name: Convert notebooks to Python scripts
80
+ run: |
81
+ find docs/ -name "*.ipynb" -exec uv run --group docs-type marimo convert {} -o {}.py \;
82
+ - name: Run type checkers on docs
83
+ run: uv run --group docs-type pyrefly check docs/notebooks/*.ipynb.py
84
+
@@ -0,0 +1,68 @@
1
+ name: Deploy MkDocs to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+ pages: write
13
+ id-token: write
14
+
15
+ # Only have one deployment in progress at a time
16
+ concurrency:
17
+ group: pages
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v6
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --locked --group docs
32
+
33
+ - name: Build MkDocs site
34
+ run: |
35
+ uv run mkdocs build
36
+ env:
37
+ # Force colored output from rich library
38
+ TTY_COMPATIBLE: '1'
39
+ TTY_INTERACTIVE: '0'
40
+
41
+ - name: Upload artifact
42
+ uses: actions/upload-pages-artifact@v3
43
+ with:
44
+ path: site
45
+
46
+ deploy:
47
+ # Add a dependency to the build job
48
+ needs: build
49
+
50
+ # Only deploy on pushes to main or manual trigger of main branch
51
+ if: github.ref == 'refs/heads/main'
52
+
53
+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
54
+ permissions:
55
+ pages: write # to deploy to Pages
56
+ id-token: write # to verify the deployment originates from an appropriate source
57
+
58
+ # Deploy to the github-pages environment
59
+ environment:
60
+ name: github-pages
61
+ url: ${{ steps.deployment.outputs.page_url }}
62
+
63
+ # Specify runner + deployment step
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - name: Deploy to GitHub Pages
67
+ id: deployment
68
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,26 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ name: Build and Publish to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/protein-quest
14
+ permissions:
15
+ id-token: write # IMPORTANT: mandatory for trusted publishing
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v6
21
+
22
+ - name: Build package
23
+ run: uv build
24
+
25
+ - name: Publish to PyPI
26
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,89 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ *.py[cod]
3
+ *$py.class
4
+ __pycache__
5
+
6
+ # Distribution / packaging
7
+ .Python
8
+ build/
9
+ develop-eggs/
10
+ dist/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+
25
+ # jupyter notebook
26
+ .ipynb_checkpoints
27
+
28
+ # Unit test / coverage reports
29
+ htmlcov/
30
+ .coverage
31
+ .coverage.*
32
+ coverage.xml
33
+ .cache
34
+ .pytest_cache
35
+ .tox/
36
+
37
+ # Sphinx documentation
38
+ docs/_build
39
+
40
+ # ide
41
+ # PyCharm
42
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
43
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
44
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
45
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
46
+ #.idea/
47
+ .spyderproject
48
+ .spyproject
49
+
50
+ # Mac
51
+ .DS_Store
52
+
53
+ # virtual environments
54
+ env
55
+ .env
56
+ env3
57
+ .env3
58
+ venv
59
+ .venv
60
+ venv3
61
+ .venv3
62
+ ENV/
63
+ env.bak/
64
+ venv.bak/
65
+
66
+ # vim
67
+ *.swp
68
+ *.swo
69
+ *.orig
70
+
71
+ /docs/session1/
72
+ /docs/alphafold_files/
73
+ /docs/pdb_files/
74
+ /docs/density_filtered/
75
+ /site
76
+ /mysession/
77
+ # Paths generated in README.md examples
78
+ uniprot_accs.txt
79
+ pdbe.csv
80
+ alphafold.csv
81
+ emdbs.csv
82
+ interaction-partners-of-Q05471.txt
83
+ complexes.csv
84
+ downloads-af/
85
+ downloads-emdb/
86
+ downloads-pdbe/
87
+ filtered/
88
+ filtered-chains/
89
+ filtered-ss/
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-toolsai.jupyter",
4
+ "ms-python.vscode-pylance",
5
+ "ms-python.python",
6
+ "charliermarsh.ruff"
7
+ ]
8
+ }
@@ -0,0 +1,26 @@
1
+ # YAML 1.2
2
+ ---
3
+ cff-version: 1.2.0
4
+ title: protein quest
5
+ message: >-
6
+ If you use this software, please cite it using the
7
+ metadata from this file.
8
+ type: software
9
+ authors:
10
+ - affiliation: "Netherlands eScience Center"
11
+ family-names: Verhoeven
12
+ given-names: Stefan
13
+ orcid: "https://orcid.org/0000-0002-5821-2060"
14
+ - given-names: Anna
15
+ family-names: Engel
16
+ affiliation: '@UtrechtUniversity'
17
+ orcid: "https://orcid.org/0009-0002-1806-7951"
18
+ - given-names: Alexandre
19
+ family-names: Bonvin
20
+ affiliation: '@UtrechtUniversity'
21
+ orcid: "https://orcid.org/0000-0001-7369-1322"
22
+ repository-code: https://github.com/haddocking/protein-quest
23
+ identifiers:
24
+ - description: Latest version of software
25
+ type: doi
26
+ value: 10.5281/zenodo.16941288
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ s.verhoeven@esciencecenter.nl.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,108 @@
1
+ # Contributing guidelines
2
+
3
+ We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
4
+
5
+ A contribution can be one of the following cases:
6
+
7
+ 1. you have a question;
8
+ 1. you think you may have found a bug (including unexpected behavior);
9
+ 1. you want to make some kind of change to the code base (e.g. to fix a bug, to add a new feature, to update documentation);
10
+ 1. you want to make a new release of the code base.
11
+
12
+ The sections below outline the steps in each case.
13
+
14
+ ## You have a question
15
+
16
+ 1. use the search functionality [here](https://github.com/haddocking/protein-quest/issues) to see if someone already filed the same issue;
17
+ 2. if your issue search did not yield any relevant results, make a new issue;
18
+ 3. apply the "Question" label; apply other labels when relevant.
19
+
20
+ ## You think you may have found a bug
21
+
22
+ 1. use the search functionality [here](https://github.com/haddocking/protein-quest/issues) to see if someone already filed the same issue;
23
+ 1. if your issue search did not yield any relevant results, make a new issue, making sure to provide enough information to the rest of the community to understand the cause and context of the problem. Depending on the issue, you may want to include:
24
+ - the [SHA hashcode](https://help.github.com/articles/autolinked-references-and-urls/#commit-shas) of the commit that is causing your problem;
25
+ - some identifying information (name and version number) for dependencies you're using;
26
+ - information about the operating system;
27
+ 1. apply relevant labels to the newly created issue.
28
+
29
+ ## You want to make some kind of change to the code base
30
+
31
+ 1. (**important**) announce your plan to the rest of the community *before you start working*. This announcement should be in the form of a (new) issue;
32
+ 1. (**important**) wait until some kind of consensus is reached about your idea being a good idea;
33
+ 1. if needed, fork the repository to your own Github profile and create your own feature branch off of the latest main commit. While working on your feature branch, make sure to stay up to date with the main branch by pulling in changes, possibly from the 'upstream' repository (follow the instructions [here](https://help.github.com/articles/configuring-a-remote-for-a-fork/) and [here](https://help.github.com/articles/syncing-a-fork/));
34
+ 1. install [uv](https://docs.astral.sh/uv) to manage this packages development environment);
35
+ 1. Make sure `uv sync --all-extras --all-groups && . .venv/bin/activate && protein-quest --help` works;
36
+ 1. make sure the existing tests still work by running `uv run pytest`;
37
+ 1. add your own tests (if necessary);
38
+ 1. format your code with `uvx ruff format` and sort imports with `uvx ruff check --select I --fix`;
39
+ 1. lint your code with `uvx ruff check` (use `uvx ruff check --fix` to fix issues automatically);
40
+ 1. type check your code with `uv run pyrefly check src tests`;
41
+ 1. update or expand the documentation (see [Contributing with documentation](#contributing-with-documentation) section below);
42
+ 1. [push](http://rogerdudler.github.io/git-guide/) your feature branch to (your fork of) the protein-quest repository on GitHub;
43
+ 1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/).
44
+
45
+ In case you feel like you've made a valuable contribution, but you don't know how to write or run tests for it, or how to generate the documentation: don't let this discourage you from making the pull request; we can help you! Just go ahead and submit the pull request, but keep in mind that you might be asked to append additional commits to your pull request.
46
+
47
+ ## You want to make a new release of the code base
48
+
49
+ To create a release you need write permission on the repository.
50
+
51
+ 1. Bump the version in [src/protein_quest/__version__.py](src/protein_quest/__version__.py).
52
+ 2. Check the author list in [`CITATION.cff`](CITATION.cff)
53
+ 3. Go to the [GitHub release page](https://github.com/haddocking/protein-quest/releases)
54
+ 4. Press draft a new release button
55
+ 5. Fill tag, title and description field. For tag use version from `src/protein_quest/__version__.py` and prepend with "v" character. For description use "Python package to search/retrieve/filter proteins and protein structures." line plus press "Generate release notes" button.
56
+ 6. Press the Publish Release button
57
+ 7. Wait until [Build and upload to PyPI](https://github.com/haddocking/protein-quest/actions/workflows/pypi-publish.yml) has completed
58
+ 8. Verify new release is on [PyPi](https://pypi.org/project/protein-quest/#history)
59
+ 9. Verify new Zenodo record has been created.
60
+
61
+ ## Contributing to documentation
62
+
63
+ To work on notebooks in the docs/ directory:
64
+
65
+ ```shell
66
+ uv sync --group docs
67
+ # Open a notebook with VS code and select .venv/bin/python as kernel
68
+ ```
69
+
70
+ Start the live-reloading docs server with:
71
+
72
+ ```shell
73
+ uv run mkdocs serve
74
+ ```
75
+
76
+ Build the documentation site with:
77
+
78
+ ```shell
79
+ uv run mkdocs build
80
+ # The site will be built in the `site/` directory.
81
+ # You can preview it with
82
+ python3 -m http.server -d site
83
+ ```
84
+
85
+ <details>
86
+ <summary>Type checking notebooks</summary>
87
+
88
+ [Pyrefly](https://pyrefly.org/) does not support notebooks yet, so we need to convert them to python scripts and then run pyrefly on them.
89
+
90
+ ```shell
91
+ find docs/ -name "*.ipynb" -exec uv run --group docs-type marimo convert {} -o {}.py \;
92
+ uv run --group docs-type pyrefly check docs/notebooks/*.ipynb.py
93
+ rm docs/notebooks/*.ipynb.py
94
+ ```
95
+
96
+ </details>
97
+
98
+
99
+ ## Contributing to tests
100
+
101
+ The code coverage is stored at [https://app.codacy.com/gh/haddocking/protein-quest/coverage](https://app.codacy.com/gh/haddocking/protein-quest/coverage) .
102
+
103
+ The search functions of the protein-quest package talk to web services on the Internet.
104
+ To have fast tests we use [pytest-recording](https://github.com/kiwicom/pytest-recording) to record and replay HTTP interactions.
105
+ See [pytest-recording documentation](https://github.com/kiwicom/pytest-recording) for more details on how to use it.
106
+ Like overwrite previous recordings in test/cassettes/**.yaml files with `--record-mode=rewrite`.
107
+
108
+ The files downloaded for tests are cached in `~/.cache/protein-quest-tests`.