Skip to content

Commit 99a836f

Browse files
authored
Merge branch 'main' into pre-commit-ci-update-config
2 parents 626a4a7 + d25e7e7 commit 99a836f

26 files changed

+133
-205
lines changed

.github/workflows/coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
- name: Set up Python ${{ matrix.python-version }}
1212
uses: actions/setup-python@v5
1313
with:
14-
python-version: 3.11
15-
- name: Install dependencies
16-
run: pip install nox
14+
python-version: 3.13
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
1717
- name: Test with nox
18-
run: nox -e coverage
18+
run: uv run --group nox nox -e coverage
1919
- name: Upload coverage to Codecov
2020
uses: codecov/codecov-action@v4

.github/workflows/matchers/pytest.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/nox.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
platform: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: ["3.9", "3.10", "3.11", "3.12"]
15+
python-version: ["3.11", "3.12", "3.13"]
1616

1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: Set up Python ${{ matrix.python-version }}
2020
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
- name: Register Python problem matcher
24-
run: echo "::add-matcher::.github/workflows/matchers/pytest.json"
25-
- name: Install dependencies
26-
run: pip install nox pytest-github-actions-annotate-failures
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
2725
- name: Test with nox using minimal dependencies
28-
run: nox -e "pytest-${{ matrix.python-version }}(all_deps=False)"
26+
run: uv run --group nox nox -e "pytest_min_deps-${{ matrix.python-version }}"
2927
- name: Test with nox with all dependencies
30-
run: nox -e "pytest-${{ matrix.python-version }}(all_deps=True)"
28+
run: uv run --group nox nox -e "pytest_all_deps-${{ matrix.python-version }}"

.github/workflows/typeguard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- name: Set up Python ${{ matrix.python-version }}
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.11"
16-
- name: Install dependencies
17-
run: pip install nox
15+
python-version: "3.13"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
1818
- name: Test with nox
19-
run: nox -e pytest_typeguard
19+
run: uv run --group nox nox -e pytest_typeguard

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ jupyter labextension install @pyviz/jupyterlab_pyviz
160160

161161
## :wrench: Development
162162

163-
Clone the repository and run `pip install -e ".[notebook,testing,other]"` to add a link to the cloned repo into your Python path:
163+
Clone the repository and run `pip install -e ".[notebook,test,other]"` to add a link to the cloned repo into your Python path:
164164

165165
```bash
166166
git clone git@github.com:python-adaptive/adaptive.git
167167
cd adaptive
168-
pip install -e ".[notebook,testing,other]"
168+
pip install -e ".[notebook,test,other]"
169169
```
170170

171171
We recommend using a Conda environment or a virtualenv for package management during Adaptive development.

adaptive/learner/average_learner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Callable
34
from math import sqrt
4-
from typing import Callable
55

66
import cloudpickle
77
import numpy as np

adaptive/learner/average_learner1D.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
import math
44
import sys
55
from collections import defaultdict
6-
from collections.abc import Iterable, Sequence
6+
from collections.abc import Callable, Iterable, Sequence
77
from copy import deepcopy
88
from math import hypot
9-
from typing import Callable
109

1110
import numpy as np
1211
import scipy.stats

adaptive/learner/balancing_learner.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from __future__ import annotations
22

33
import itertools
4-
import sys
54
from collections import defaultdict
6-
from collections.abc import Iterable, Sequence
5+
from collections.abc import Callable, Iterable, Sequence
76
from contextlib import suppress
87
from functools import partial
98
from operator import itemgetter
10-
from typing import Any, Callable, Union, cast
9+
from typing import Any, Literal, TypeAlias, cast
1110

1211
import numpy as np
1312

@@ -16,13 +15,6 @@
1615
from adaptive.types import Int, Real
1716
from adaptive.utils import cache_latest, named_product, restore
1817

19-
if sys.version_info >= (3, 10):
20-
from typing import TypeAlias
21-
else:
22-
from typing_extensions import TypeAlias
23-
24-
from typing import Literal
25-
2618
try:
2719
import pandas
2820

@@ -38,11 +30,9 @@ def dispatch(child_functions: list[Callable], arg: Any) -> Any:
3830

3931
STRATEGY_TYPE: TypeAlias = Literal["loss_improvements", "loss", "npoints", "cycle"]
4032

41-
CDIMS_TYPE: TypeAlias = Union[
42-
Sequence[dict[str, Any]],
43-
tuple[Sequence[str], Sequence[tuple[Any, ...]]],
44-
None,
45-
]
33+
CDIMS_TYPE: TypeAlias = (
34+
Sequence[dict[str, Any]] | tuple[Sequence[str], Sequence[tuple[Any, ...]]] | None
35+
)
4636

4737

4838
class BalancingLearner(BaseLearner):

adaptive/learner/base_learner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from __future__ import annotations
22

33
import abc
4+
from collections.abc import Callable
45
from contextlib import suppress
5-
from typing import TYPE_CHECKING, Any, Callable, TypeVar
6+
from typing import TYPE_CHECKING, Any, TypeVar
67

78
import cloudpickle
89

adaptive/learner/data_saver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import functools
44
from collections import OrderedDict
5-
from typing import Any, Callable
5+
from collections.abc import Callable
6+
from typing import Any
67

78
from adaptive.learner.base_learner import BaseLearner, LearnerType
89
from adaptive.utils import copy_docstring_from

0 commit comments

Comments
 (0)