Skip to content

Commit 65bb73b

Browse files
CHORE: Drop support for Python <3.9 and NumPy <1.22 (#631)
- Remove numpy compatibility modules (_typing.py and _compatibility.py) and correct related imports (hence the number of files modified in this PR) - Update dependencies in pyproject.toml - Update dependencies in CI - Update Migration Guide and README.rst
1 parent 85f58d3 commit 65bb73b

File tree

68 files changed

+85
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+85
-150
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@ jobs:
1515
strategy:
1616
matrix:
1717
include:
18-
- os: ubuntu-latest
19-
python-version: "3.7"
20-
numpy-version: 1.21.4
21-
- os: ubuntu-latest
22-
python-version: "3.8"
23-
numpy-version: 1.21.4
2418
- os: ubuntu-latest
2519
python-version: "3.9"
26-
numpy-version: 1.21.4
20+
numpy-version: 1.22.4
2721
- os: ubuntu-latest
2822
python-version: "3.10"
2923
numpy-version: 1.22.4

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Implemented methods in **MAPIE** respect three fundamental pillars:
7979
🔗 Requirements
8080
===============
8181

82-
- **MAPIE** runs on Python 3.7+.
83-
- **MAPIE** stands on the shoulders of giants. Its only internal dependencies are `scikit-learn <https://scikit-learn.org/stable/>`_ and `numpy=>1.21 <https://numpy.org/>`_.
82+
- **MAPIE** runs on Python 3.9+.
83+
- **MAPIE** stands on the shoulders of giants. Its only internal dependencies are `scikit-learn <https://scikit-learn.org/stable/>`_ and `numpy=>1.22 <https://numpy.org/>`_.
8484

8585

8686
🛠 Installation

doc/v1_migration_guide.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ MAPIE v1 introduces several updates, enhancements, and structural changes that s
55

66
This guide outlines the differences between MAPIE v0.x and MAPIE v1 and provides instructions for migrating your code to the new API.
77

8-
1. Overview of class restructuring
8+
1. Python and NumPy versions support
9+
-------------------------------------------------
10+
11+
We now support Python >= 3.9 (formerly >=3.7), and NumPy >= 1.22 (formerly >=1.21).
12+
13+
MAPIE v1 may run with Python < 3.9, but we do not recommend it.
14+
15+
2. Class restructuring
916
-----------------------------------
1017

1118
MAPIE v1 breaks down the ``MapieRegressor`` and ``MapieClassifier`` classes into 5 classes, each dedicated to a particular conformal prediction technique. ``MapieQuantileRegressor`` has also been revamped, and renamed ``ConformalizedQuantileRegressor``.
@@ -48,7 +55,7 @@ The ``cv`` parameter is key to understand what new class to use in the v1 API:
4855

4956
For more details regarding the difference between split and cross conformal types, see :doc:`split_cross_conformal`
5057

51-
2. Method changes
58+
3. Method changes
5259
-----------------
5360

5461
In MAPIE v1, the conformal prediction workflow is more streamlined and modular, with distinct methods for training, conformalization (named calibration in the scientific literature), and prediction. The conformalization process in v1 consists of four steps.
@@ -91,7 +98,7 @@ The ``.predict()`` method now focuses solely on producing point predictions.
9198

9299

93100

94-
3. Parameters change
101+
4. Parameters change
95102
------------------------
96103

97104
``alpha``
@@ -182,7 +189,7 @@ No more parameters with incorrect ``None`` defaults.
182189
- **v1**: All parameters now have explicit defaults.
183190

184191

185-
4. Migration example: MAPIE v0.x to MAPIE v1
192+
5. Migration examples: MAPIE v0.x to MAPIE v1
186193
----------------------------------------------------------------------------------------
187194

188195
Below is a side-by-side example of code in MAPIE v0.x and its equivalent in MAPIE v1

examples/calibration/1-quickstart/plot_calibration_hypothesis_testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from matplotlib import pyplot as plt
3030
from sklearn.utils import check_random_state
3131

32-
from mapie._typing import NDArray
32+
from numpy.typing import NDArray
3333
from mapie.metrics import (cumulative_differences, kolmogorov_smirnov_p_value,
3434
length_scale)
3535

examples/calibration/2-advanced-analysis/plot_asymptotic_convergence_of_p_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from matplotlib import pyplot as plt
4040
from sklearn.utils import check_random_state
4141

42-
from mapie._typing import NDArray
42+
from numpy.typing import NDArray
4343
from mapie.metrics import (kolmogorov_smirnov_p_value, kuiper_p_value,
4444
spiegelhalter_p_value)
4545

examples/classification/1-quickstart/plot_comp_methods_on_2d_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
from sklearn.model_selection import train_test_split
5454
from sklearn.naive_bayes import GaussianNB
5555

56-
from mapie._typing import NDArray
56+
from numpy.typing import NDArray
5757
from mapie.classification import MapieClassifier
5858
from mapie.metrics import (classification_coverage_score,
5959
classification_mean_width_score)

examples/classification/4-tutorials/plot_crossconformal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from sklearn.naive_bayes import GaussianNB
3636
from typing_extensions import TypedDict
3737

38-
from mapie._typing import NDArray
38+
from numpy.typing import NDArray
3939
from mapie.classification import MapieClassifier
4040
from mapie.metrics import (classification_coverage_score,
4141
classification_mean_width_score)

examples/classification/4-tutorials/plot_main-tutorial-binary-classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from sklearn.model_selection import train_test_split
3434
from sklearn.naive_bayes import GaussianNB
3535

36-
from mapie._typing import NDArray
36+
from numpy.typing import NDArray
3737
from mapie.classification import MapieClassifier
3838
from mapie.metrics import (classification_coverage_score,
3939
classification_mean_width_score)

examples/regression/1-quickstart/plot_heteroscedastic_1d_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from sklearn.preprocessing import PolynomialFeatures
2626
from sklearn.model_selection import train_test_split
2727

28-
from mapie._typing import NDArray
28+
from numpy.typing import NDArray
2929
from mapie_v1.regression import (
3030
CrossConformalRegressor,
3131
JackknifeAfterBootstrapRegressor,

examples/regression/1-quickstart/plot_homoscedastic_1d_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sklearn.model_selection import train_test_split
2424

2525

26-
from mapie._typing import NDArray
26+
from numpy.typing import NDArray
2727
from mapie_v1.regression import (
2828
CrossConformalRegressor,
2929
JackknifeAfterBootstrapRegressor,

0 commit comments

Comments
 (0)