Skip to content

Commit

Permalink
Merge pull request #64 from leojklarner/fixing_ci
Browse files Browse the repository at this point in the history
Fixing GitHub CI and tests.
  • Loading branch information
leojklarner authored Dec 4, 2023
2 parents b772d5c + a47f947 commit 90ac4a1
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 98 deletions.
49 changes: 24 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build GAUCHE and run unit tests.

on:
push:
Expand All @@ -15,31 +15,30 @@ on:
- "CONTRIBUTING.md"
- "imgs/"

permissions:
contents: read

jobs:
build_cpu:
runs-on: ubuntu-18.04
build:

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, 3.11]
steps:
- name: Checkout repository
uses: actions/checkout@v2
# See: https://github.com/marketplace/actions/setup-conda
- name: Setup anaconda
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python-version }}
conda-channels: "conda-forge"
python-version: ["3.9", "3.10", "3.11"]

- name: Install GAUCHE
run: pip install -e .
- name: Install rnxfp
run: pip install --no-deps rxnfp
- name: Install drfp
run: pip install --no-deps drfp
- name: Install transformers
run: pip install transformers
- name: Run unit tests and generate coverage report
run: pytest .
- name: Test notebook execution
run: pytest --nbval-lax notebooks/ --current-env
steps:
- uses: actions/checkout@v4
- name: Set up Python.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up GAUCHE and install all dependencies.
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .[all]
- name: Run unit tests with pytest.
run: |
pytest tests/
35 changes: 8 additions & 27 deletions .github/workflows/code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,34 @@ on: [push]
jobs:
black:
name: "Ensure black compliance"
runs-on: "ubuntu-18.04"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.10"

- name: Install code style checking tools
run: python -m pip install black

- name: Run black
run: black --check .

interrogate:
name: "Ensure docstring coverage"
runs-on: "ubuntu-18.04"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install code style checking tools
run: python -m pip install interrogate

- name: Run interrogate
run: interrogate .


isort:
name: "Ensure imports are correctly sorted"
runs-on: "ubuntu-18.04"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.10"

- name: Install code style checking tools
run: python -m pip install isort
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/benchmark_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
GP Model definitions to be used in the benchmarks
"""

from gauche.kernels.fingerprint_kernels.tanimoto_kernel import (
TanimotoKernel,
)
from gpytorch.distributions import MultivariateNormal
from gpytorch.kernels import LinearKernel, ScaleKernel
from gpytorch.means import ConstantMean
from gpytorch.models import ExactGP

from gauche.kernels.fingerprint_kernels.tanimoto_kernel import TanimotoKernel


class TanimotoGP(ExactGP):
def __init__(self, train_x, train_y, likelihood):
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import torch
from benchmark_models import ScalarProductGP, TanimotoGP
from botorch import fit_gpytorch_model
from gauche.dataloader import MolPropLoader
from gauche.dataloader.data_utils import transform_data
from gpytorch.likelihoods import GaussianLikelihood
from gpytorch.mlls import ExactMarginalLogLikelihood
from gpytorch_metrics import (
Expand All @@ -23,6 +21,9 @@
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
from sklearn.model_selection import train_test_split

from gauche.dataloader import MolPropLoader
from gauche.dataloader.data_utils import transform_data

# Remove Graphein warnings
logging.getLogger("graphein").setLevel("ERROR")

Expand Down
Loading

0 comments on commit 90ac4a1

Please sign in to comment.