Skip to content

Commit

Permalink
Merge pull request #108 from cornellius-gp/version_bump
Browse files Browse the repository at this point in the history
Version bump
  • Loading branch information
saitcakmak authored Jan 28, 2025
2 parents d809345 + ad8e223 commit 3763b6e
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 27 deletions.
9 changes: 5 additions & 4 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ build:

requirements:
host:
- python>=3.8
- python>=3.10

run:
- python>=3.8
- pytorch>=1.11
- python>=3.10
- jaxtyping
- mpmath>=0.19,<=1.3
- pytorch>=2.0
- scipy
- jaxtyping==0.2.19

test:
imports:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -44,7 +44,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
conda install -y anaconda-client conda-build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
pip install flake8==5.0.4 flake8-print==5.0.0 pre-commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
if [[ ${{ matrix.pytorch-version }} = "latest" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_type_checked_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
if [[ ${{ matrix.pytorch-version }} = "latest" ]]; then
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
else
pip install torch==1.11+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install "numpy<2"
fi
pip install -e ".[test]"
Expand Down
7 changes: 4 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.8"
python: "3.10"
jobs:
pre_install: # Lock version of torch at 1.11
- pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pre_install: # Lock version of torch at 2.0
- pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
- pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pre_build:
- python -m setuptools_scm # Get correct version number

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ We use [standard sphinx docstrings](https://sphinx-rtd-tutorial.readthedocs.io/e

### Type Hints

LinearOperator aims to be fully typed using Python 3.8+
LinearOperator aims to be fully typed using Python 3.10+
[type hints](https://www.python.org/dev/peps/pep-0484/).
We expect any contributions to also use proper type annotations.
We are using [jaxtyping](https://github.com/google/jaxtyping) to help us be declarative about the dimension sizes used
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation](https://readthedocs.org/projects/linear-operator/badge/?version=latest)](https://linear-operator.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Conda](https://img.shields.io/conda/v/gpytorch/linear_operator.svg)](https://anaconda.org/gpytorch/linear_operator)
[![PyPI](https://img.shields.io/pypi/v/linear_operator.svg)](https://pypi.org/project/linear_operator)

Expand Down Expand Up @@ -359,7 +359,7 @@ See the documentation for a [full list of supported composition and decoration o

## Installation

LinearOperator requires Python >= 3.8.
LinearOperator requires Python >= 3.10.

### Standard Installation (Most Recent Stable Version)
We recommend installing via `pip` or Anaconda:
Expand All @@ -371,7 +371,7 @@ conda install linear_operator -c gpytorch
```

The installation requires the following packages:
- PyTorch >= 1.11
- PyTorch >= 2.0
- Scipy

You can customize your PyTorch installation (i.e. CUDA version, CPU only option)
Expand Down
22 changes: 15 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import jaxtyping
import sphinx_rtd_theme # noqa
from uncompyle6.semantics.fragments import code_deparse


sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
Expand Down Expand Up @@ -63,6 +62,15 @@
"tasklist", # Check boxes
]

suppress_warnings = [
# We use subsections of README in docs, which start with a lower header level
# than H1, which makes myst_parser complain. This suppresses these warnings.
"myst.header",
# The config includes the _process function below, which is "unpickable".
# This suppresses warnings about caching such values.
"config.cache",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand All @@ -87,7 +95,7 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"torch": ("https://pytorch.org/docs/master/", None),
"torch": ("https://pytorch.org/docs/main/", None),
}

# Disable documentation inheritance so as to avoid inheriting
Expand Down Expand Up @@ -117,15 +125,15 @@ def _convert_internal_and_external_class_to_strings(annotation):

# Convert jaxtyping dimensions into strings
def _dim_to_str(dim):
if isinstance(dim, jaxtyping.array_types._NamedVariadicDim):
if isinstance(dim, jaxtyping._array_types._NamedVariadicDim):
return "..."
elif isinstance(dim, jaxtyping.array_types._FixedDim):
elif isinstance(dim, jaxtyping._array_types._FixedDim):
res = str(dim.size)
if dim.broadcastable:
res = "#" + res
return res
elif isinstance(dim, jaxtyping.array_types._SymbolicDim):
expr = code_deparse(dim.expr).text.strip().split("return ")[1]
elif isinstance(dim, jaxtyping._array_types._SymbolicDim):
expr = dim.elem
return f"({expr})"
elif "jaxtyping" not in str(dim.__class__): # Probably the case that we have an ellipsis
return "..."
Expand Down Expand Up @@ -220,4 +228,4 @@ def _process(annotation, config):
# @jpchen's hack to get rtd builder to install latest pytorch
# See similar line in the install section of .travis.yml
if "READTHEDOCS" in os.environ:
os.system("pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html")
os.system("pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html")
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from setuptools import find_packages, setup

REQUIRED_MAJOR = 3
REQUIRED_MINOR = 8
REQUIRED_MINOR = 10

# Check for python version
if sys.version_info < (REQUIRED_MAJOR, REQUIRED_MINOR):
Expand All @@ -24,7 +24,7 @@

readme = open("README.md").read()

torch_min = "1.11"
torch_min = "2.0"
install_requires = [">=".join(["torch", torch_min])]

# if recent dev version of PyTorch is installed, no need to install stable
Expand Down Expand Up @@ -77,7 +77,7 @@ def find_version(*file_paths):
"Programming Language :: Python :: 3",
],
packages=find_packages(exclude=["test", "test.*"]),
python_requires=">=3.8",
python_requires=f">={REQUIRED_MAJOR}.{REQUIRED_MINOR}",
install_requires=install_requires,
extras_require={
"dev": ["pre-commit", "setuptools_scm", "ufmt", "twine"],
Expand All @@ -88,7 +88,6 @@ def find_version(*file_paths):
"six",
"sphinx_rtd_theme",
"sphinx-autodoc-typehints",
"uncompyle6<=3.9.0",
],
"test": [
"flake8==5.0.4",
Expand Down

0 comments on commit 3763b6e

Please sign in to comment.