Skip to content

Commit

Permalink
Merge pull request #597 from DeepRank/595_release_302_gcroci2
Browse files Browse the repository at this point in the history
release: 3.0.2 patch
  • Loading branch information
gcroci2 authored Mar 20, 2024
2 parents 02f669e + d58305d commit ef4dd33
Show file tree
Hide file tree
Showing 40 changed files with 1,176 additions and 1,041 deletions.
6 changes: 5 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.0.1
current_version = 3.0.2

[comment]
comment = The contents of this file cannot be merged with that of setup.cfg until https://github.com/c4urself/bump2version/issues/185 is resolved
Expand All @@ -15,3 +15,7 @@ replace = version = "{new_version}"
[bumpversion:file:CITATION.cff]
search = version: "{current_version}"
replace = version: "{new_version}"

[bumpversion:file:requirements-docker.txt]
search = deeprank2==current_version
replace = deeprank2==new_version
73 changes: 23 additions & 50 deletions .github/actions/install-python-and-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,43 @@ runs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
update-conda: true
auto-update-conda: true
miniforge-variant: Mambaforge
channels: conda-forge
python-version: ${{ inputs.python-version }}
conda-channels: pytorch, pyg, bioconda, defaults, sbl, conda-forge
activate-environment: deeprank2
environment-file: env/deeprank2.yml
use-mamba: true

- run: |
conda --version
conda env list
shell: bash {0}
shell: bash -l {0}
- name: Python info
shell: bash -e {0}
shell: bash -l {0}
run: |
which python3
python3 --version
- name: Install dependencies on Linux
shell: bash {0}
env:
CMAKE_INSTALL_PREFIX: .local
if: runner.os == 'Linux'
run: |
# Install deeprank2 conda dependencies
## DSSP
conda install -c sbl dssp>=4.2.2.1
## MSMS
conda install -c bioconda msms>=2.6.1
## PyTorch, PyG, PyG adds
### Installing for CPU only on the CI
conda install pytorch=2.1.1 torchvision=0.16.1 torchaudio=2.1.1 cpuonly=2.0.* -c pytorch
conda install pyg=2.4.0 -c pyg
pip install torch_scatter==2.1.2 torch_sparse==0.6.18 torch_cluster==1.6.3 torch_spline_conv==1.2.2 -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
- name: Install dependencies on MacOS
shell: bash {0}
env:
CMAKE_INSTALL_PREFIX: .local
if: runner.os == 'macOS'
run: |
# Install dependencies not handled by setuptools
## DSSP
conda install -c sbl dssp>=4.2.2.1
## MSMS
cd /tmp/
wget http://mgltools.scripps.edu/downloads/tars/releases/MSMSRELEASE/REL2.6.1/msms_i86Linux2_2.6.1.tar.gz
sudo mkdir /usr/local/lib/msms
cd /usr/local/lib/msms
sudo tar zxvf /tmp/msms_i86Linux2_2.6.1.tar.gz
sudo ln -s /usr/local/lib/msms/msms.i86Linux2.2.6.1 /usr/local/bin/msms
sudo ln -s /usr/local/lib/msms/pdb_to_xyzr* /usr/local/bin
## PyTorch, PyG, PyG adds
### Installing for CPU only on the CI
conda install pytorch torchvision torchaudio cpuonly -c pytorch
pip install torch_geometric
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-$(python3 -c "import torch; print(torch.__version__)")+cpu.html
# PyTables via conda only for MacOS
conda install pytables
- name: Install the GitHub repository version of the package
shell: bash {0}
shell: bash -l {0}
if: ${{ inputs.pkg-installation-type == 'repository' }}
run: pip install .'[${{ inputs.extras-require }}]'
- name: Install the latest released version of the package
shell: bash {0}
run: |
conda activate deeprank2
pip install .'[${{ inputs.extras-require }}]'
- name: Install the latest released PyPI version of the package
shell: bash -l {0}
if: ${{ inputs.pkg-installation-type == 'latest' }}
run: |
conda activate deeprank2
pip install pytest
rm -r deeprank2
pip install deeprank2
8 changes: 8 additions & 0 deletions .github/workflows/build-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,22 @@ jobs:
os: ["ubuntu-latest"]
python-version: ["3.10"] # ["3.10", "3.11"]

# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/install-python-and-package
with:
python-version: ${{ matrix.python-version }}
extras-require: test, publishing
pkg-installation-type: "repository"

- name: Run unit tests
run: pytest -v

- name: Verify that we can build the package
run: python3 -m build
5 changes: 5 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
os: ["ubuntu-latest"]
python-version: ["3.10"]

# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-python-and-package
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ jobs:
os: ["ubuntu-latest"]
python-version: ["3.10"]

# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-python-and-package
with:
python-version: ${{ matrix.python-version }}
extras-require: test
- name: Check style against standards using ruff
run: ruff .
run: |
ruff check
ruff format --check
62 changes: 62 additions & 0 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: notebooks

on:
push:
paths-ignore:
# specific folder locations
- ".vscode/**"
- "docs/**"
# filetypes
- "**.md"
- "**.rst"
- "**.cff"
- "**.png"
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
# specific folder locations
- ".vscode/**"
- "docs/**"
# filetypes
- "**.md"
- "**.rst"
- "**.cff"
- "**.png"

jobs:
build:
if: github.event.pull_request.draft == false
name: Build for (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"] # ["3.10", "3.11"]

# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/install-python-and-package
with:
python-version: ${{ matrix.python-version }}
extras-require: test, notebooks
pkg-installation-type: "repository"

- name: Download the data for the tutorials
shell: bash -l {0}
run: |
wget https://zenodo.org/records/8349335/files/data_raw.zip
unzip data_raw.zip -d data_raw
mv data_raw tutorials
- name: Run tutorial notebooks
run: pytest --nbmake tutorials
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
},
"notebook.diff.ignoreMetadata": true,

// Pytest
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,

// Format all files on save
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
81 changes: 41 additions & 40 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
cff-version: "1.2.0"
authors:
- family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
- family-names: Bodor
given-names: Dani L.
orcid: "https://orcid.org/0000-0003-2109-2349"
- family-names: Baakman
given-names: Coos
orcid: "https://orcid.org/0000-0003-4317-1566"
- family-names: Parizi
given-names: Farzaneh M.
orcid: "https://orcid.org/0000-0003-4230-7492"
- family-names: Rademaker
given-names: Daniel-T.
orcid: "https://orcid.org/0000-0003-1959-1317"
- family-names: Ramakrishnan
given-names: Gayatri
orcid: "https://orcid.org/0000-0001-8203-2783"
- family-names: Burg
given-names: Sven A.
name-particle: van der
orcid: "https://orcid.org/0000-0003-1250-6968"
- family-names: Marzella
given-names: Dario F.
orcid: "https://orcid.org/0000-0002-0043-3055"
- family-names: Teixeira
given-names: João M. C.
orcid: "https://orcid.org/0000-0002-9113-0622"
- family-names: Xue
given-names: Li C.
orcid: "https://orcid.org/0000-0002-2613-538X"
contact:
- family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
doi: 10.5281/zenodo.10566809
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
Expand Down Expand Up @@ -71,6 +31,46 @@ preferred-citation:
- family-names: Xue
given-names: Li C.
orcid: "https://orcid.org/0000-0002-2613-538X"
contact:
- family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
doi: 10.5281/zenodo.10566809
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
- family-names: Bodor
given-names: Dani L.
orcid: "https://orcid.org/0000-0003-2109-2349"
- family-names: Baakman
given-names: Coos
orcid: "https://orcid.org/0000-0003-4317-1566"
- family-names: Parizi
given-names: Farzaneh M.
orcid: "https://orcid.org/0000-0003-4230-7492"
- family-names: Rademaker
given-names: Daniel-T.
orcid: "https://orcid.org/0000-0003-1959-1317"
- family-names: Ramakrishnan
given-names: Gayatri
orcid: "https://orcid.org/0000-0001-8203-2783"
- family-names: Burg
given-names: Sven A.
name-particle: van der
orcid: "https://orcid.org/0000-0003-1250-6968"
- family-names: Marzella
given-names: Dario F.
orcid: "https://orcid.org/0000-0002-0043-3055"
- family-names: Teixeira
given-names: João M. C.
orcid: "https://orcid.org/0000-0002-9113-0622"
- family-names: Xue
given-names: Li C.
orcid: "https://orcid.org/0000-0002-2613-538X"
date-published: 2024-02-27
doi: 10.21105/joss.05983
issn: 2475-9066
Expand All @@ -86,3 +86,4 @@ preferred-citation:
volume: 9
title: "DeepRank2: Mining 3D Protein Structures with Geometric Deep
Learning"
version: "3.0.2"
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You want to make some kind of change to the code base
#. 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/>`__);
#. make sure the existing tests still work by running ``python setup.py test``;
#. add your own tests (if necessary);
#. ensure the code is correctly linted (``ruff .``) and formatted (``ruff format .``);
#. ensure the code is correctly linted (``ruff check.``) and formatted (``ruff format .``);
#. see our `developer's readme <README.dev.md>`_ for detailed information on our style conventions, etc.;
#. update or expand the documentation;
#. `push <http://rogerdudler.github.io/git-guide/>`_ your feature branch to (your fork of) the DeepRank2 repository on GitHub;
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ FROM --platform=linux/x86_64 condaforge/miniforge3:23.3.1-1

# Add files
ADD ./tutorials /home/deeprank2/tutorials
ADD ./env/environment.yml /home/deeprank2
ADD ./env/requirements.txt /home/deeprank2
ADD ./env/deeprank2-docker.yml /home/deeprank2
ADD ./env/requirements-docker.txt /home/deeprank2

# Install
RUN \
apt update -y &&
apt install unzip -y &&
# Install dependencies and package
apt update -y && \
apt install unzip -y && \
## GCC
apt install -y gcc &&
## Conda and pip deps
mamba env create -f /home/deeprank2/environment.yml &&
## Get the data for running the tutorials
if [ -d "/home/deeprank2/tutorials/data_raw" ]; then rm -Rf /home/deeprank2/tutorials/data_raw; fi &&
if [ -d "/home/deeprank2/tutorials/data_processed" ]; then rm -Rf /home/deeprank2/tutorials/data_processed; fi &&
wget https://zenodo.org/records/8349335/files/data_raw.zip &&
unzip data_raw.zip -d data_raw &&
apt install -y gcc && \
## Create the environment and install the dependencies
mamba env create -f /home/deeprank2/deeprank2-docker.yml && \
## Activate the environment automatically when entering the container
echo "source activate deeprank2" >~/.bashrc && \
# Get the data for running the tutorials
if [ -d "/home/deeprank2/tutorials/data_raw" ]; then rm -Rf /home/deeprank2/tutorials/data_raw; fi && \
if [ -d "/home/deeprank2/tutorials/data_processed" ]; then rm -Rf /home/deeprank2/tutorials/data_processed; fi && \
wget https://zenodo.org/records/8349335/files/data_raw.zip && \
unzip data_raw.zip -d data_raw && \
mv data_raw /home/deeprank2/tutorials

# Activate the environment
RUN echo "source activate deeprank2" >~/.bashrc
ENV PATH /opt/conda/envs/deeprank2/bin:$PATH

# Define working directory
Expand Down
2 changes: 1 addition & 1 deletion README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ We use [ruff](https://docs.astral.sh/ruff/) for linting, sorting imports and for

If you are using VS code, please install and activate the [Ruff extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) to automatically format and check linting.

Otherwise, please ensure check both linting (`ruff fix .`) and formatting (`ruff format .`) before requesting a review.
Otherwise, please ensure check both linting (`ruff check .`) and formatting (`ruff format .`) before requesting a review.

We use [prettier](https://prettier.io/) for formatting most other files. If you are editing or adding non-python files and using VS code, the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) can be installed to auto-format these files as well.

Expand Down
Loading

0 comments on commit ef4dd33

Please sign in to comment.