Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ptonner committed Aug 1, 2022
2 parents 7da8dd7 + 8e0b842 commit b42075f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python package

on:
push:
branches:
- main
tags: '*'
pull_request:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest torch
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --exclude=manuscript --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --exclude=manuscript --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
"numpy",
"matplotlib",
"torch",
"scipy",
"attrs>=21.1.0",
"sklearn",
],
tests_requires=["pytest", "pytest-cov"],
extras_require={},
Expand Down
6 changes: 3 additions & 3 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_quickstart():
# build a LANTERN model based on the dataset, using an upper-bound
# of K latent dimensions
model = Model(
VariationalBasis.fromDataset(ds, 3),
Phenotype.fromDataset(ds, 3, Ni=50),
VariationalBasis.fromDataset(ds, 1),
Phenotype.fromDataset(ds, 1, Ni=50),
GaussianLikelihood(),
)

Expand All @@ -38,7 +38,7 @@ def test_quickstart():
lss = loss(yhat, y)
baseline = sum(lss.values())

for i in range(20):
for i in range(100):
optimizer.zero_grad()
yhat = model(X)
lss = loss(yhat, y)
Expand Down

0 comments on commit b42075f

Please sign in to comment.