proteingym-base 0.1.0rc3__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.
- proteingym_base-0.1.0rc3/.adr-dir +1 -0
- proteingym_base-0.1.0rc3/.github/ISSUE_TEMPLATE/bug.yml +32 -0
- proteingym_base-0.1.0rc3/.github/ISSUE_TEMPLATE/feature.yml +26 -0
- proteingym_base-0.1.0rc3/.github/pull_request_template.md +15 -0
- proteingym_base-0.1.0rc3/.github/workflows/ci.yaml +145 -0
- proteingym_base-0.1.0rc3/.github/workflows/pages.yaml +35 -0
- proteingym_base-0.1.0rc3/.gitignore +26 -0
- proteingym_base-0.1.0rc3/.pre-commit-config.yaml +47 -0
- proteingym_base-0.1.0rc3/.python-version +1 -0
- proteingym_base-0.1.0rc3/AGENTS.md +38 -0
- proteingym_base-0.1.0rc3/CLAUDE.md +1 -0
- proteingym_base-0.1.0rc3/CONTRIBUTING.md +116 -0
- proteingym_base-0.1.0rc3/LICENSE +21 -0
- proteingym_base-0.1.0rc3/PKG-INFO +270 -0
- proteingym_base-0.1.0rc3/README.md +249 -0
- proteingym_base-0.1.0rc3/codecov.yml +9 -0
- proteingym_base-0.1.0rc3/docs/dataset_archive.md +35 -0
- proteingym_base-0.1.0rc3/docs/decisions/0001-record-architecture-decisions.md +48 -0
- proteingym_base-0.1.0rc3/docs/decisions/0002-user-facing-and-programmaticlly-used-manifest.md +142 -0
- proteingym_base-0.1.0rc3/docs/decisions/0003-pydantic-usage.md +65 -0
- proteingym_base-0.1.0rc3/docs/decisions/0004-dataset-archive.md +88 -0
- proteingym_base-0.1.0rc3/docs/decisions/0005-dataset-list.md +88 -0
- proteingym_base-0.1.0rc3/docs/decisions/0006-model-validation.md +75 -0
- proteingym_base-0.1.0rc3/docs/decisions/0007-dataset-splits.md +318 -0
- proteingym_base-0.1.0rc3/docs/decisions/0008-single-top-level-reference-sequence.md +35 -0
- proteingym_base-0.1.0rc3/docs/decisions/templates/template.md +37 -0
- proteingym_base-0.1.0rc3/docs/images/proteingymlogo.png +0 -0
- proteingym_base-0.1.0rc3/docs/index.md +7 -0
- proteingym_base-0.1.0rc3/docs/manifest.md +316 -0
- proteingym_base-0.1.0rc3/docs/metrics.md +210 -0
- proteingym_base-0.1.0rc3/docs/notebooks/01_Introduction_to_PG2_Dataset.ipynb +173 -0
- proteingym_base-0.1.0rc3/docs/notebooks/02_Creating_Manifests_and_Archives.ipynb +1205 -0
- proteingym_base-0.1.0rc3/docs/notebooks/03_Loading_and_Accessing_Data.ipynb +743 -0
- proteingym_base-0.1.0rc3/docs/notebooks/04_Data_Access_for_ML.ipynb +266 -0
- proteingym_base-0.1.0rc3/docs/notebooks/05_Creating_Dataset_Splits.ipynb +946 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/A0A1I9GEU1.fasta +4 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/AssayMeta.json +18 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Assays/Assay1.csv +923 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/DataSetMeta.json +10 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/MSA/msa.a2m +22212 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/MSA/msa.a3m +5664 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/MSA/msa.psi +2832 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/MSA/msa_weights.npy +0 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Structures/computational.cif +2145 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Structures/computational.pdb +1259 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Structures/experimental.bcif +0 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Structures/experimental.cif +38369 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/Structures/experimental.pdb +32300 -0
- proteingym_base-0.1.0rc3/example_data/NEIME_2019/sequences/A0A1I9GEU1.fasta +4 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/1UA7.cif +7378 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/amye-1.csv +10398 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/invitro-activity.csv +1990 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/invitro-hplc.csv +2192 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/invitro-stability.csv +1745 -0
- proteingym_base-0.1.0rc3/example_data/PETPILOT_AMYE_2024/rcsb_pdb_1UA7.fasta +2 -0
- proteingym_base-0.1.0rc3/example_data/neime_2019.toml +74 -0
- proteingym_base-0.1.0rc3/example_data/petpilot_amye_2024.toml +96 -0
- proteingym_base-0.1.0rc3/mkdocs.yml +33 -0
- proteingym_base-0.1.0rc3/pyproject.toml +103 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/__about__.py +9 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/__init__.py +61 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/__main__.py +486 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/assay.py +1041 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/data_generators.py +168 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/dataset.py +1275 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/evaluate.py +232 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/lookup_field.py +52 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/manifest.py +225 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/metrics.py +478 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/model.py +139 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/msa.py +361 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/publication.py +95 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/py.typed +0 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/sequence.py +331 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/splits.py +919 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/structure.py +231 -0
- proteingym_base-0.1.0rc3/src/proteingym/base/transformers.py +392 -0
- proteingym_base-0.1.0rc3/tests/conftest.py +840 -0
- proteingym_base-0.1.0rc3/tests/test_assay.py +1743 -0
- proteingym_base-0.1.0rc3/tests/test_assay_operators.py +896 -0
- proteingym_base-0.1.0rc3/tests/test_cli.py +244 -0
- proteingym_base-0.1.0rc3/tests/test_data/io/files/seq.fasta +4 -0
- proteingym_base-0.1.0rc3/tests/test_data/structures/5kua_bcif.bcif +0 -0
- proteingym_base-0.1.0rc3/tests/test_data/structures/5kua_cif.cif +38369 -0
- proteingym_base-0.1.0rc3/tests/test_data/structures/5kua_pdb.pdb +32300 -0
- proteingym_base-0.1.0rc3/tests/test_data_generators.py +219 -0
- proteingym_base-0.1.0rc3/tests/test_dataframe_aggregation.py +76 -0
- proteingym_base-0.1.0rc3/tests/test_dataset.py +442 -0
- proteingym_base-0.1.0rc3/tests/test_dataset_operators.py +172 -0
- proteingym_base-0.1.0rc3/tests/test_dataset_subsets.py +226 -0
- proteingym_base-0.1.0rc3/tests/test_evaluate.py +149 -0
- proteingym_base-0.1.0rc3/tests/test_lookup_field.py +71 -0
- proteingym_base-0.1.0rc3/tests/test_manifest.py +346 -0
- proteingym_base-0.1.0rc3/tests/test_metrics.py +771 -0
- proteingym_base-0.1.0rc3/tests/test_model.py +412 -0
- proteingym_base-0.1.0rc3/tests/test_msa.py +501 -0
- proteingym_base-0.1.0rc3/tests/test_msa_operations.py +53 -0
- proteingym_base-0.1.0rc3/tests/test_publication.py +52 -0
- proteingym_base-0.1.0rc3/tests/test_sequence.py +430 -0
- proteingym_base-0.1.0rc3/tests/test_sequence_operators.py +95 -0
- proteingym_base-0.1.0rc3/tests/test_splits.py +1070 -0
- proteingym_base-0.1.0rc3/tests/test_structure.py +510 -0
- proteingym_base-0.1.0rc3/tests/test_transformers.py +442 -0
- proteingym_base-0.1.0rc3/uv.lock +2739 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
docs/decisions
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# See https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
|
|
2
|
+
# and https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
|
3
|
+
name: Bug report
|
|
4
|
+
description: Unexpected behaviour
|
|
5
|
+
labels: ["refine"]
|
|
6
|
+
projects: ["ProteinGym2/1"]
|
|
7
|
+
type: Bug
|
|
8
|
+
body:
|
|
9
|
+
- type: textarea
|
|
10
|
+
attributes:
|
|
11
|
+
label: Current behaviour
|
|
12
|
+
description: Describe the current behaviour
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
- type: textarea
|
|
16
|
+
attributes:
|
|
17
|
+
label: Desired behaviour
|
|
18
|
+
description: Describe the desired behaviour
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: textarea
|
|
22
|
+
attributes:
|
|
23
|
+
label: Steps to reproduce
|
|
24
|
+
description: Explain how to reproduce the bug
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
- type: textarea
|
|
28
|
+
attributes:
|
|
29
|
+
label: Proposed solution
|
|
30
|
+
description: A proposed solution, preferably with example code, to showcase requested feature.
|
|
31
|
+
validations:
|
|
32
|
+
required: false
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# See https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
|
|
2
|
+
# and https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
|
3
|
+
name: Feature Request
|
|
4
|
+
description: Change in functionality
|
|
5
|
+
labels: ["refine"]
|
|
6
|
+
projects: ["ProteinGym2/1"]
|
|
7
|
+
type: Feature
|
|
8
|
+
body:
|
|
9
|
+
- type: textarea
|
|
10
|
+
attributes:
|
|
11
|
+
label: Summary
|
|
12
|
+
description: A concise summary of what functionality needs to change.
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
- type: textarea
|
|
16
|
+
attributes:
|
|
17
|
+
label: Motivation
|
|
18
|
+
description: Explain why this functionality needs changing.
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: textarea
|
|
22
|
+
attributes:
|
|
23
|
+
label: Proposed solution
|
|
24
|
+
description: A proposed solution, preferably with example code, to show case requested feature.
|
|
25
|
+
validations:
|
|
26
|
+
required: false
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changes
|
|
2
|
+
|
|
3
|
+
Resolves # (issue)
|
|
4
|
+
|
|
5
|
+
Please include a summary of the changes and the related issue. Please also
|
|
6
|
+
include relevant motivation and context. List any dependencies that are required
|
|
7
|
+
for this change.
|
|
8
|
+
|
|
9
|
+
# Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] I broke the PR down so that it contains a reasonable amount of changes for an effective review
|
|
12
|
+
- [ ] I performed a self-review of my code. Amongst other things, I have commented my code in hard-to-understand areas.
|
|
13
|
+
- [ ] I made corresponding changes to the documentation
|
|
14
|
+
- [ ] I added tests that prove my fix is effective or that my feature works
|
|
15
|
+
- [ ] I accounted for dependent changes to be merged and published in downstream modules
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
name: CI pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
pull_request:
|
|
6
|
+
merge_group:
|
|
7
|
+
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
tags:
|
|
12
|
+
- v*
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
lint:
|
|
16
|
+
name: lint
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version-file: ".python-version"
|
|
29
|
+
|
|
30
|
+
- name: Install the project
|
|
31
|
+
run: uv sync --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: Ruff check
|
|
34
|
+
run: uv run ruff check src tests
|
|
35
|
+
|
|
36
|
+
- name: Ruff format
|
|
37
|
+
run: uv run ruff format --check src tests
|
|
38
|
+
|
|
39
|
+
- name: Type check
|
|
40
|
+
run: uv run pyrefly check
|
|
41
|
+
|
|
42
|
+
test:
|
|
43
|
+
name: test
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Install uv
|
|
50
|
+
uses: astral-sh/setup-uv@v5
|
|
51
|
+
|
|
52
|
+
- name: Set up Python
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version-file: ".python-version"
|
|
56
|
+
|
|
57
|
+
- name: Install the project
|
|
58
|
+
run: uv sync --all-extras --dev
|
|
59
|
+
|
|
60
|
+
- name: Run tests
|
|
61
|
+
run: uv run pytest
|
|
62
|
+
|
|
63
|
+
- name: Execute notebooks
|
|
64
|
+
# Sanity check if the notebooks can be executed
|
|
65
|
+
run: find docs/notebooks/*.ipynb -maxdepth 1 -type f | xargs -L1 uv run jupyter nbconvert --to notebook --execute
|
|
66
|
+
|
|
67
|
+
- name: Upload coverage reports to Codecov
|
|
68
|
+
uses: codecov/codecov-action@v5
|
|
69
|
+
with:
|
|
70
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
71
|
+
|
|
72
|
+
test-release:
|
|
73
|
+
if: contains(github.ref, 'refs/tags/')
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
needs:
|
|
76
|
+
- lint
|
|
77
|
+
- test
|
|
78
|
+
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/checkout@v4
|
|
81
|
+
|
|
82
|
+
- name: Install uv
|
|
83
|
+
uses: astral-sh/setup-uv@v5
|
|
84
|
+
|
|
85
|
+
- name: Set up Python
|
|
86
|
+
uses: actions/setup-python@v5
|
|
87
|
+
with:
|
|
88
|
+
python-version-file: ".python-version"
|
|
89
|
+
|
|
90
|
+
- name: Build
|
|
91
|
+
run: uv build --no-sources
|
|
92
|
+
|
|
93
|
+
- name: Test release can be installed and imported
|
|
94
|
+
run: |
|
|
95
|
+
uv venv
|
|
96
|
+
uv pip install dist/proteingym_base-*.whl
|
|
97
|
+
uv run --with proteingym_base --no-project --no-cache -- python -c "import proteingym.base"
|
|
98
|
+
|
|
99
|
+
- name: Store the distribution packages
|
|
100
|
+
uses: actions/upload-artifact@v4
|
|
101
|
+
with:
|
|
102
|
+
name: python-package-distributions
|
|
103
|
+
path: dist/
|
|
104
|
+
|
|
105
|
+
pypi-publish:
|
|
106
|
+
name: Publish to PyPI
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
needs: test-release
|
|
109
|
+
environment:
|
|
110
|
+
name: pypi
|
|
111
|
+
url: https://pypi.org/p/proteingym-base
|
|
112
|
+
permissions:
|
|
113
|
+
id-token: write # mandatory for PyPI trusted publishing
|
|
114
|
+
|
|
115
|
+
steps:
|
|
116
|
+
- name: Download the distribution packages
|
|
117
|
+
uses: actions/download-artifact@v4
|
|
118
|
+
with:
|
|
119
|
+
name: python-package-distributions
|
|
120
|
+
path: dist/
|
|
121
|
+
|
|
122
|
+
- name: Publish to PyPI
|
|
123
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
124
|
+
|
|
125
|
+
github-release:
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
needs: test-release
|
|
128
|
+
steps:
|
|
129
|
+
- uses: actions/checkout@v4
|
|
130
|
+
|
|
131
|
+
- name: Install Hatch
|
|
132
|
+
uses: pypa/hatch@install
|
|
133
|
+
|
|
134
|
+
- name: Get version
|
|
135
|
+
id: get_version
|
|
136
|
+
run: echo ::set-output name=VERSION::$(hatch version)
|
|
137
|
+
|
|
138
|
+
- name: Create GitHub release
|
|
139
|
+
uses: softprops/action-gh-release@v2
|
|
140
|
+
with:
|
|
141
|
+
name: v${{ steps.get_version.outputs.VERSION }}
|
|
142
|
+
body: ${{ github.event.head_commit.message }}
|
|
143
|
+
prerelease: ${{ contains(steps.get_version.outputs.VERSION, 'rc') || contains(steps.get_version.outputs.VERSION, 'b') }}
|
|
144
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
145
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Deploy to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
# CI from https://squidfunk.github.io/mkdocs-material/publishing-your-site/
|
|
12
|
+
jobs:
|
|
13
|
+
deploy-pages:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Configure Git Credentials
|
|
18
|
+
run: |
|
|
19
|
+
git config user.name github-actions[bot]
|
|
20
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v5
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: 3.x
|
|
27
|
+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
28
|
+
- uses: actions/cache@v4
|
|
29
|
+
with:
|
|
30
|
+
key: mkdocs-material-${{ env.cache_id }}
|
|
31
|
+
path: ~/.cache
|
|
32
|
+
restore-keys: |
|
|
33
|
+
mkdocs-material-
|
|
34
|
+
- run: cp README.md docs/index.md
|
|
35
|
+
- run: uv run mkdocs gh-deploy --force
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
.ipynb_checkpoints/
|
|
4
|
+
*.py[oc]
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
wheels/
|
|
8
|
+
*.egg-info
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv
|
|
12
|
+
|
|
13
|
+
# MacOS
|
|
14
|
+
.DS_Store
|
|
15
|
+
|
|
16
|
+
# Testing and coverage
|
|
17
|
+
.coverage
|
|
18
|
+
.coverage.*
|
|
19
|
+
coverage
|
|
20
|
+
coverage.*
|
|
21
|
+
/.tox/
|
|
22
|
+
/example_data/neime_2019_python_example.toml
|
|
23
|
+
/example_data/NEIME_2019.pgdata
|
|
24
|
+
/example_data/neime_2019_complete.toml
|
|
25
|
+
/example_data/NEIME_2019.splits.pgdata
|
|
26
|
+
/docs/notebooks/*.pgdata
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
fail_fast: false
|
|
2
|
+
|
|
3
|
+
default_install_hook_types:
|
|
4
|
+
- pre-commit
|
|
5
|
+
- post-checkout
|
|
6
|
+
- post-merge
|
|
7
|
+
- post-rewrite
|
|
8
|
+
|
|
9
|
+
repos:
|
|
10
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
11
|
+
rev: v5.0.0
|
|
12
|
+
hooks:
|
|
13
|
+
- id: check-merge-conflict
|
|
14
|
+
|
|
15
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
|
16
|
+
rev: v0.24.1
|
|
17
|
+
hooks:
|
|
18
|
+
- id: validate-pyproject
|
|
19
|
+
|
|
20
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
21
|
+
rev: v0.11.7
|
|
22
|
+
hooks:
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
- id: ruff
|
|
25
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
26
|
+
types_or: [python, pyi]
|
|
27
|
+
require_serial: true
|
|
28
|
+
|
|
29
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
30
|
+
# uv version.
|
|
31
|
+
rev: 0.6.1
|
|
32
|
+
hooks:
|
|
33
|
+
# Update the uv lockfile.
|
|
34
|
+
- id: uv-lock
|
|
35
|
+
# Synchronize the dependencies upon branch checkout, pull or rebase.
|
|
36
|
+
- id: uv-sync
|
|
37
|
+
|
|
38
|
+
- repo: local
|
|
39
|
+
hooks:
|
|
40
|
+
- id: pyrefly
|
|
41
|
+
name: pyrefly type checker
|
|
42
|
+
entry: uv run pyrefly check
|
|
43
|
+
language: system
|
|
44
|
+
types: [python]
|
|
45
|
+
files: ^src/
|
|
46
|
+
pass_filenames: true
|
|
47
|
+
require_serial: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
ProteinGym Base: the Python package (`proteingym.base`) that defines the ProteinGym2
|
|
4
|
+
dataset format (manifests, `.pgdata` archives, splits), model cards, metrics, and the
|
|
5
|
+
`proteingym-base` CLI. Read these before changing things:
|
|
6
|
+
|
|
7
|
+
- [README.md](README.md) – overview, quickstart, CLI, example data.
|
|
8
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) – setup, tests, CI checks, docs site, releases.
|
|
9
|
+
- [docs/manifest.md](docs/manifest.md) – manifest (TOML) schema.
|
|
10
|
+
- [docs/dataset_archive.md](docs/dataset_archive.md) – archive and splits archive layout.
|
|
11
|
+
- [docs/metrics.md](docs/metrics.md) – metrics API and how to add a metric.
|
|
12
|
+
- [docs/decisions/](docs/decisions/) – architecture decision records (historical context).
|
|
13
|
+
- [docs/notebooks/](docs/notebooks/) – tutorials, executed in CI.
|
|
14
|
+
|
|
15
|
+
## Key facts
|
|
16
|
+
|
|
17
|
+
- Source lives in `src/proteingym/base/`; public API is re-exported from `__init__.py`.
|
|
18
|
+
- Downstream users: [proteingym-benchmark](https://github.com/ProteinGym/proteingym-benchmark)
|
|
19
|
+
(installs this package from `main` and calls the `evaluate-*` CLI commands) and
|
|
20
|
+
[evedesign](https://github.com/evedesignbio/evedesign) (`evedesign.proteingym` converts
|
|
21
|
+
`Subsets` into evedesign datatypes). Changes to the dataset format, `ModelCard`, metrics
|
|
22
|
+
or CLI options can break them.
|
|
23
|
+
- Metrics are discovered automatically: any `metric_<name>(context)` function in
|
|
24
|
+
`metrics.py` becomes metric `<name>`.
|
|
25
|
+
- Manifest sections are Pydantic models with `extra="forbid"`; when adding or renaming a
|
|
26
|
+
field, update `docs/manifest.md`.
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
uv sync --all-extras --dev # install
|
|
32
|
+
uv run pytest # tests + README/docstring doctests (80% coverage gate)
|
|
33
|
+
uv run ruff check src tests && uv run ruff format --check src tests
|
|
34
|
+
uv run pyrefly check # type check
|
|
35
|
+
uv run mkdocs serve # docs site
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Code examples in `docs/*.md` are not doctested; keep them in sync with the API by hand.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
This file contains documentation about contributing to this project.
|
|
4
|
+
|
|
5
|
+
## Develop locally
|
|
6
|
+
|
|
7
|
+
After cloning the repository, install the project and its development
|
|
8
|
+
dependencies with [`uv`](https://docs.astral.sh/uv/), which creates `.venv/`:
|
|
9
|
+
|
|
10
|
+
```shell
|
|
11
|
+
$ uv sync --all-extras --dev
|
|
12
|
+
$ source .venv/bin/activate # optional; otherwise prefix commands with `uv run`
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Pre-commit hooks
|
|
16
|
+
|
|
17
|
+
Install pre-commit hooks to ensure code quality and consistency:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
$ pre-commit install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Test
|
|
24
|
+
|
|
25
|
+
To run the unit tests, use the following command:
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
$ uv run pytest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This also runs the `>>>` examples in `README.md` and in docstrings under `src/`
|
|
32
|
+
as doctests, and enforces 80% coverage.
|
|
33
|
+
|
|
34
|
+
CI ([ci.yaml](.github/workflows/ci.yaml)) additionally runs:
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
$ uv run ruff check src tests
|
|
38
|
+
$ uv run ruff format --check src tests
|
|
39
|
+
$ uv run pyrefly check
|
|
40
|
+
$ find docs/notebooks/*.ipynb -maxdepth 1 -type f | xargs -L1 uv run jupyter nbconvert --to notebook --execute
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
To run the pre-commit hooks on all files, run:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
$ pre-commit run --all-files
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Documentation
|
|
50
|
+
|
|
51
|
+
The documentation site is built with [mkdocs](https://www.mkdocs.org/) from
|
|
52
|
+
`docs/` (see [mkdocs.yml](mkdocs.yml)) and deployed to GitHub Pages on every push
|
|
53
|
+
to `main` ([pages.yaml](.github/workflows/pages.yaml)); `README.md` is copied to
|
|
54
|
+
the site's home page (locally, `docs/index.md` is a placeholder). Preview it
|
|
55
|
+
locally with:
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
$ uv run mkdocs serve
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Code examples in `docs/*.md` are not tested, so check them by hand when you
|
|
62
|
+
change the API they use.
|
|
63
|
+
|
|
64
|
+
## How to release
|
|
65
|
+
|
|
66
|
+
This section describes how to release the package in this project.
|
|
67
|
+
|
|
68
|
+
### Prerequisites
|
|
69
|
+
|
|
70
|
+
* Push and merge rights for this repo,
|
|
71
|
+
[proteingym-base](https://github.com/ProteinGym/proteingym-base),
|
|
72
|
+
also referred to as the *upstream*.
|
|
73
|
+
* A UNIX system that has:
|
|
74
|
+
- `git` able to push to upstream
|
|
75
|
+
* A one-time setup on PyPI: a
|
|
76
|
+
[trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
|
|
77
|
+
for the `proteingym-base` project pointing at owner `ProteinGym`, repository
|
|
78
|
+
`proteingym-base`, workflow `ci.yaml`, environment `pypi`, plus a GitHub
|
|
79
|
+
environment named `pypi` in this repo's settings.
|
|
80
|
+
|
|
81
|
+
### Release
|
|
82
|
+
|
|
83
|
+
We use hatch to [version](https://hatch.pypa.io/latest/version/) the project.
|
|
84
|
+
Before releasing, you decide which semantic version segment you want to
|
|
85
|
+
release, like:
|
|
86
|
+
|
|
87
|
+
| Segment | New version |
|
|
88
|
+
| -------- | ----------- |
|
|
89
|
+
| release | 1.0.0 |
|
|
90
|
+
| major | 2.0.0 |
|
|
91
|
+
| minor | 1.1.0 |
|
|
92
|
+
| patch | 1.0.1 |
|
|
93
|
+
| rc | 1.0.0rc0 |
|
|
94
|
+
|
|
95
|
+
> See [docs](https://hatch.pypa.io/latest/version/) for full details.
|
|
96
|
+
|
|
97
|
+
Then, you run the following
|
|
98
|
+
|
|
99
|
+
``` bash
|
|
100
|
+
$ hatch version release|major|minor|patch|rc
|
|
101
|
+
$ VERSION=$(hatch version)
|
|
102
|
+
$ git checkout -b release/v$VERSION
|
|
103
|
+
$ git add src/proteingym/base/__about__.py
|
|
104
|
+
$ git commit -m "Release v$VERSION"
|
|
105
|
+
$ git tag v$VERSION
|
|
106
|
+
$ git push --set-upstream origin release/v$VERSION
|
|
107
|
+
$ git push --tags
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The tag push triggers the release CI, which builds the distributions, publishes
|
|
111
|
+
them to [PyPI](https://pypi.org/p/proteingym-base), and creates a release for the
|
|
112
|
+
tag with autogenerated release notes. After the new release appears in
|
|
113
|
+
[Github](https://github.com/ProteinGym/proteingym-base/releases), copy the release
|
|
114
|
+
notes to create a PR for the release branch with the release commit as the title
|
|
115
|
+
and the release notes as the body. Assign a colleague to review the PR and merge
|
|
116
|
+
it after approval.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ProteinGym Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|