Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions .github/workflows/code-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,25 @@ jobs:
build_cpu:
name: Build CPU
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10"]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -el {0}
python-version: ["3.11"]
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v4
- name: Setup Python
uses: actions/setup-python@v7
with:
auto-update-conda: true
miniforge-version: latest
channels: "conda-forge, pytorch, pyg"
python-version: ${{ matrix.python-version }}
use-mamba: true
- id: cache-dependencies
name: Cache dependencies
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.venv
key: ${{ matrix.platform }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ matrix.platform }}-py${{ matrix.python-version }}-
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-py${{ matrix.python-version }}-
- name: Install Workshop
if: steps.cache-dependencies.cache-hit != 'true'
run: |
Expand All @@ -53,7 +46,6 @@ jobs:
poetry config virtualenvs.in-project true
poetry install --no-interaction --without docs
poetry run install_pyg_workshop
poe install-torchdrug

- name: Run tests
run: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
* Update ICLR paper link and citation [#82](https://github.com/a-r-j/ProteinWorkshop/pull/82)
* Add an optional group for installing plotting and analysis specific libraries to lighten the install of the core framework [#90](https://github.com/a-r-j/ProteinWorkshop/pull/90)
* Update CI workflow actions to latest versions and replace retired Mambaforge installer with Miniforge; fix CI `pull_request` trigger, run test matrix across all platforms and fix cache key
* Fix CI: install with `setup-python` instead of conda, test on Linux only (macOS/Windows unsupported), and switch the dummy test dataset from the retired RCSB MMTF service to PDB format
* Require Pillow >=13.0.0; this raises the minimum supported Python version to 3.11 (drops 3.9 and 3.10)
* Remove the `torchdrug` dependency (no release supports Python 3.11): GearNet now uses `torch.sparse_coo_tensor` directly and drops an unused torchdrug-only helper

### 0.2.5 (28/12/2023)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export DATA_PATH="where/you/want/data/" # e.g., `export DATA_PATH="proteinworksh
However, for full exploration we recommend cloning the repository and building from source.

### Building from source
With a local virtual environment activated (e.g., one created with `conda create -n proteinworkshop python=3.10`):
With a local virtual environment activated (e.g., one created with `conda create -n proteinworkshop python=3.11`):
1. Clone and install the project

```bash
Expand Down
264 changes: 103 additions & 161 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proteinworkshop/config/dataset/dummy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datamodule:
pin_memory: True # Pin memory for dataloader
num_workers: 8 # Number of workers for dataloader
obsolete_strategy: "drop"
format: "mmtf.gz" # Format of the raw PDB/MMTF files
format: "pdb" # Format of the raw PDB/MMTF files (RCSB no longer serves MMTF)
transforms: ${transforms}
overwrite: True

Expand Down
10 changes: 2 additions & 8 deletions proteinworkshop/models/graph_encoders/layers/gear_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import torch.nn.functional as F
from torch_geometric.data import Batch
from torch_scatter import scatter_add
from torchdrug import data, utils


class MessagePassingBase(nn.Module):
Expand Down Expand Up @@ -53,11 +52,6 @@ def message_and_aggregate(self, graph, input):
message = self.message(graph, input)
return self.aggregate(graph, message)

def _message_and_aggregate(self, *tensors):
graph = data.Graph.from_tensors(tensors[:-1])
input = tensors[-1]
return self.message_and_aggregate(graph, input)

def combine(self, input, update):
"""
Combine node input and node update.
Expand Down Expand Up @@ -161,7 +155,7 @@ def message_and_aggregate(self, graph, input):
dim_size=graph.num_nodes * graph.num_relation,
)
edge_weight = graph.edge_weight / degree_out[node_out]
adjacency = utils.sparse_coo_tensor(
adjacency = torch.sparse_coo_tensor(
torch.stack([node_in, node_out]),
edge_weight,
(graph.num_nodes, graph.num_nodes * graph.num_relation),
Expand Down Expand Up @@ -251,7 +245,7 @@ def message_and_aggregate(self, graph, input):
node_in, node_out, relation = graph.edge_index
node_out = node_out * self.num_relation + relation

adjacency = utils.sparse_coo_tensor(
adjacency = torch.sparse_coo_tensor(
torch.stack([node_in, node_out]),
graph.edge_weight,
(graph.num_nodes, graph.num_nodes * graph.num_relation),
Expand Down
12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering"
]
Expand All @@ -28,7 +26,7 @@ packages = [
"Documentation" = "https://proteins.sh"

[tool.poetry.dependencies]
python = ">= 3.9, < 3.11"
python = ">= 3.11, < 3.12"
graphein = "^1.7.5"
loguru = "^0.7.0"
fair-esm = "^2.0.0"
Expand Down Expand Up @@ -56,6 +54,7 @@ pyrootutils = "^1.0.4"
torch-geometric = "^2.4.0"
hydra-colorlog = "^1.2.0"
foldcomp = "^0.0.5"
pillow = ">=13.0.0"
captum = {version="^0.6.0", optional=true}
umap-learn = {version="^0.5.4", optional=true}
matplotlib = {version="^3.7.2", optional=true}
Expand Down Expand Up @@ -107,7 +106,6 @@ install-torch-sparse = "pip install torch_sparse -f https://data.pyg.org/whl/tor
install-torch-scatter = "pip install torch_scatter -f https://data.pyg.org/whl/torch-2.0.0+cpu.html"
install-torch-spline-conv = "pip install torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html"
install-openfold = "pip install git+https://github.com/NVIDIA/dllogger.git@0540a43971f4a8a16693a9de9de73c1072020769 && pip install git+https://github.com/aqlaboratory/openfold.git@4b41059694619831a7db195b7e0988fc4ff3a307"
install-torchdrug = "pip install torchdrug"
install-flash = "pip install lightning-flash --no-dependencies"

[tool.poetry.scripts]
Expand All @@ -126,8 +124,8 @@ build-backend = "poetry.core.masonry.api"
select = ["E", "F", "I"] # <-- Note: I suggest including the "I" for additional checks!
ignore = ["F722"] # Ignore Jaxtyping forward references: https://github.com/google/jaxtyping/blob/v0.2.12/FAQ.md

# Assuming you're developing for Python 3.10
target-version = "py310"
# Assuming you're developing for Python 3.11
target-version = "py311"

[tool.black]
exclude = '''
Expand All @@ -148,7 +146,7 @@ exclude = '''
)/
'''
line-length = 79
target-version = ['py310']
target-version = ['py311']

[tool.isort]
skip = [".env", "env", ".venv", "venv", "data"]
Expand Down
Loading