Skip to content

Commit

Permalink
1.7 release (#2037)
Browse files Browse the repository at this point in the history
* Bump dependencies: Python 3.7, Torch 1.10
* Update publishing script
* Consolidate unit test scripts

Co-authored-by: Max Balandat <[email protected]>
  • Loading branch information
gpleiss and Balandat authored Jun 27, 2022
1 parent 2533800 commit 7f94326
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 116 deletions.
7 changes: 4 additions & 3 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ build:

requirements:
host:
- python>=3.6
- python>=3.7

run:
- pytorch>=1.9
- scikit-learn
- pytorch>=1.10
- numpy
- scikit-learn<=1.0.2 # newer versions require py3.8
- scipy

test:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package to PyPI
name: Upload Python Package to PyPI and Anaconda

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
run_test_suite:
uses: ./.github/workflows/run_test_suite.yml

deploy_pypi:
runs-on: ubuntu-latest
needs: run_test_suite
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -28,3 +31,15 @@ jobs:
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
deploy_conda:
runs-on: ubuntu-latest
needs: run_test_suite
steps:
- uses: actions/checkout@master
- name: publish-to-conda
uses: cornellius-gp/conda-package-publish-action@master
with:
subDir: '.'
AnacondaUsername: ${{ secrets.ANACONDA_PASSWORD }}
AnacondaPassword: ${{ secrets.ANACONDA_USERNAME }}
29 changes: 0 additions & 29 deletions .github/workflows/examples.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/linting.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/run_test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run Test Suite

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

jobs:
run_linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
run: |
pip install flake8==4.0.1 flake8-print==4.0.0 pre-commit
pre-commit install
pre-commit run seed-isort-config || true
- name: Run linting
run: |
flake8
- name: Run pre-commit checks
# skipping flake8 here (run separatey above b/c pre-commit does not include flake8-print)
run: |
SKIP=flake8 pre-commit run --files test/**/*.py gpytorch/**/*.py
run_unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
pytorch-version: ["master", "stable"]
pyro: ["with-pyro", "no-pyro"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
run: |
if [[ ${{ matrix.pytorch-version }} = "master" ]]; then
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html;
else
pip install torch==1.10+cpu -f https://download.pytorch.org/whl/torch_stable.html;
fi
if [[ ${{ matrix.pyro }} == "with-pyro" ]]; then
pip install "pyro-ppl<=1.8";
fi
pip install -r requirements.txt
- name: Run unit tests
run: |
python -m unittest discover
run_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
run: |
pip install pytest nbval jupyter tqdm matplotlib torchvision scipy
python setup.py build develop
pip install "pyro-ppl<=1.8";
- name: Run example notebooks
run: |
grep -l smoke_test examples/**/*.ipynb | xargs grep -L 'smoke_test = False' | CI=true xargs pytest --nbval-lax --current-env
39 changes: 0 additions & 39 deletions .github/workflows/unittests.yml

This file was deleted.

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ See our numerous [**examples and tutorials**](https://gpytorch.readthedocs.io/en
## Installation

**Requirements**:
- Python >= 3.6
- PyTorch >= 1.9
- Python >= 3.7
- PyTorch >= 1.10

Install GPyTorch using pip or conda:

Expand Down Expand Up @@ -96,4 +96,9 @@ GPyTorch is primarily maintained by:
We would like to thank our other contributors including (but not limited to) David Arbour, Eytan Bakshy, David Eriksson, Jared Frank, Sam Stanton, Bram Wallace, Ke Alexander Wang, Ruihan Wu.

## Acknowledgements
Development of GPyTorch is supported by funding from the [Bill and Melinda Gates Foundation](https://www.gatesfoundation.org/), the [National Science Foundation](https://www.nsf.gov/), and [SAP](https://www.sap.com/index.html).
Development of GPyTorch is supported by funding from
the [Bill and Melinda Gates Foundation](https://www.gatesfoundation.org/),
the [National Science Foundation](https://www.nsf.gov/),
[SAP](https://www.sap.com/index.html),
the [Simons Foundation](https://www.simonsfoundation.org),
and the [Gatsby Charitable Trust](https://www.gatsby.org.uk).
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GPyTorch's documentation
kernels
means
marginal_log_likelihoods
metrics
constraints
distributions
priors
Expand Down
19 changes: 19 additions & 0 deletions docs/source/metrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. role:: hidden
:class: hidden-section

gpytorch.metrics
===================================

.. automodule:: gpytorch.metrics
.. currentmodule:: gpytorch.metrics

See `the metrics tutorial`_ for usage instructions.

.. automethod:: gpytorch.metrics.mean_absolute_error
.. automethod:: gpytorch.metrics.mean_squared_error
.. automethod:: gpytorch.metrics.mean_standardized_log_loss
.. automethod:: gpytorch.metrics.negative_log_predictive_density
.. automethod:: gpytorch.metrics.quantile_coverage_error

.. _the metrics tutorial:
examples/00_Basic_Usage/Metrics.html
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ channels:
- pytorch
dependencies:
- pytorch
- scikit-learn
- numpy
- scikit-learn<=1.0.2 # newer versions require py3.8
- scipy
2 changes: 1 addition & 1 deletion gpytorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .mlls import ExactMarginalLogLikelihood
from .module import Module

__version__ = "1.6.0"
__version__ = "1.7.0"

__all__ = [
# Submodules
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
torch>=1.9
scikit-learn
torch>=1.10
numpy
scikit-learn<=1.0.2 # newer versions require py3.8
scipy
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def find_version(*file_paths):
version = find_version("gpytorch", "__init__.py")


torch_min = "1.9"
install_requires = [">=".join(["torch", torch_min]), "scikit-learn", "scipy"]
torch_min = "1.10"
install_requires = [">=".join(["torch", torch_min])]
# if recent dev version of PyTorch is installed, no need to install stable
try:
import torch
Expand All @@ -35,6 +35,7 @@ def find_version(*file_paths):
install_requires = []
except ImportError:
pass
install_requires += ["numpy", "scikit-learn<=1.0.2", "scipy"]


# Run the setup
Expand Down

0 comments on commit 7f94326

Please sign in to comment.