Skip to content

Commit 1cbeade

Browse files
authored
Merge pull request #144 from scikit-learn-contrib/fix_typing
Fix typing
2 parents 2c2d6b9 + ccffe6c commit 1cbeade

31 files changed

+632
-563
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If applicable, add screenshots to help explain your problem.
2626
**Desktop (please complete the following information):**
2727
- OS: [e.g. iOS]
2828
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
29+
- MAPIE Version [e.g. 0.3.2]
3030

3131
**Additional context**
3232
Add any other context about the problem here.

.github/workflows/publish.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v2
14-
with:
15-
python-version: '3.9'
16-
- name: Install build dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
20-
- name: Build package
21-
run: python setup.py sdist bdist_wheel
22-
- name: Publish package
23-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
24-
with:
25-
user: __token__
26-
password: ${{ secrets.PYPI_API_TOKEN_VBL }}
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.10"
16+
- name: Install build dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build package
21+
run: python setup.py sdist bdist_wheel
22+
- name: Publish package
23+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_API_TOKEN_VBL }}

.github/workflows/test.yml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,40 @@ jobs:
99
matrix:
1010
include:
1111
- os: ubuntu-latest
12-
python-version: 3.7
13-
numpy-version: 1.18.5
12+
python-version: "3.7"
13+
numpy-version: 1.21.4
1414
- os: ubuntu-latest
15-
python-version: 3.8
16-
numpy-version: 1.19.5
15+
python-version: "3.8"
16+
numpy-version: 1.21.4
1717
- os: ubuntu-latest
18-
python-version: 3.9
19-
numpy-version: 1.20.3
20-
- os: windows-latest
21-
python-version: 3.7
22-
numpy-version: 1.18.5
23-
- os: windows-latest
24-
python-version: 3.8
25-
numpy-version: 1.19.5
18+
python-version: "3.9"
19+
numpy-version: 1.21.4
20+
- os: ubuntu-latest
21+
python-version: "3.10"
22+
numpy-version: 1.22.3
2623
- os: windows-latest
27-
python-version: 3.9
28-
numpy-version: 1.20.3
24+
python-version: "3.10"
25+
numpy-version: 1.22.3
2926
defaults:
3027
run:
3128
shell: bash -l {0}
3229

3330
steps:
34-
- name: Git clone
35-
uses: actions/checkout@v2
36-
- name: Set up virtual environment
37-
uses: conda-incubator/setup-miniconda@v2
38-
with:
39-
python-version: ${{ matrix.python-version }}
40-
environment-file: environment.ci.yml
41-
channels: defaults, conda-forge
42-
- name: Install numpy
43-
run: conda install numpy=${{ matrix.numpy-version }}
44-
- name: Check linting
45-
run: make lint
46-
- name: Check static typing
47-
run: make type-check
48-
- name: Test with pytest
49-
run: make coverage
50-
- name: Code coverage
51-
run: codecov
31+
- name: Git clone
32+
uses: actions/checkout@v2
33+
- name: Set up virtual environment
34+
uses: conda-incubator/setup-miniconda@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
environment-file: environment.ci.yml
38+
channels: defaults, conda-forge
39+
- name: Install numpy
40+
run: conda install numpy=${{ matrix.numpy-version }}
41+
- name: Check linting
42+
run: make lint
43+
- name: Check static typing
44+
run: make type-check
45+
- name: Test with pytest
46+
run: make coverage
47+
- name: Code coverage
48+
run: codecov

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
History
33
=======
44

5+
0.3.3 (2022-XX-XX)
6+
------------------
7+
* Relax and fix typing
8+
59
0.3.2 (2022-03-11)
610
------------------
711
* Refactorize unit tests

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.PHONY: tests doc build
2+
23
lint:
34
flake8 . --exclude=doc
45

56
type-check:
6-
mypy mapie examples --strict --allow-untyped-calls
7+
mypy mapie examples
78

89
tests:
910
pytest -vs --doctest-modules mapie

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Python 3.7+
5454

5555
**MAPIE** stands on the shoulders of giants.
5656

57-
Its only internal dependency is `scikit-learn <https://scikit-learn.org/stable/>`_.
57+
Its only internal dependencies are `scikit-learn <https://scikit-learn.org/stable/>`_ and `numpy=>1.21 <https://numpy.org/>`_.
5858

5959

6060
🛠 Installation

environment.ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ dependencies:
88
- mypy
99
- pandas
1010
- pytest-cov
11-
- python
1211
- scikit-learn
1312
- typed-ast

environment.dev.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ channels:
55
dependencies:
66
- bump2version=1.0.1
77
- flake8=4.0.1
8-
- mypy=0.910
8+
- ipykernel=6.9.0
9+
- jupyter=1.0.0
10+
- mypy=0.941
911
- numpydoc=1.1.0
12+
- numpy=1.22.3
1013
- pandas=1.3.5
1114
- pytest=6.2.5
1215
- pytest-cov=3.0.0
13-
- python=3.10.1
16+
- python=3.10
1417
- scikit-learn=1.0.1
1518
- sphinx=4.3.2
1619
- sphinx-gallery=0.10.1

environment.notebooks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- pip=22.0.3
1414
- pip:
1515
- scikeras==0.4.1
16-
- python=3.10.1
16+
- python=3.10
1717
- scikit-learn=1.0.1
1818
- tensorflow=2.7.0
1919
- xgboost=1.5.1

examples/classification/1-quickstart/plot_comp_methods_on_2d_dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
classification_coverage_score,
5858
classification_mean_width_score
5959
)
60-
from mapie._typing import ArrayLike
60+
from mapie._typing import NDArray
6161

6262

6363
centers = [(0, 3.5), (-2, 0), (2, 0)]
@@ -144,8 +144,8 @@
144144

145145
def plot_scores(
146146
alphas: List[float],
147-
scores: ArrayLike,
148-
quantiles: ArrayLike,
147+
scores: NDArray,
148+
quantiles: NDArray,
149149
method: str,
150150
ax: plt.Axes,
151151
) -> None:
@@ -183,7 +183,7 @@ def plot_scores(
183183

184184

185185
def plot_results(
186-
alphas: List[float], y_pred_mapie: ArrayLike, y_ps_mapie: ArrayLike
186+
alphas: List[float], y_pred_mapie: NDArray, y_ps_mapie: NDArray
187187
) -> None:
188188
tab10 = plt.cm.get_cmap("Purples", 4)
189189
colors = {

0 commit comments

Comments
 (0)