Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: add a doctest step to CI to allow writing testable code blocs, fix existing docstring code examples errors #592

Merged
merged 7 commits into from
Jan 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test
Valentin-Laurent committed Jan 9, 2025
commit a246982b897b4ac3164986556df22175c376bd4f
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@ conda:
environment: environment.doc.yml

sphinx:
builder: html
builder:
- html
- doctest
configuration: doc/conf.py
fail_on_warning: false
2 changes: 2 additions & 0 deletions mapie/metrics.py
Original file line number Diff line number Diff line change
@@ -1283,6 +1283,7 @@ def kolmogorov_smirnov_p_value(y_true: NDArray, y_score: NDArray) -> float:
Examples
--------
>>> import pandas as pd
>>> import numpy as np
>>> from mapie.metrics import kolmogorov_smirnov_p_value
>>> y_true = np.array([1, 0, 1, 0, 1, 0])
>>> y_score = np.array([0.8, 0.3, 0.5, 0.5, 0.7, 0.1])
@@ -1450,6 +1451,7 @@ def kuiper_p_value(y_true: NDArray, y_score: NDArray) -> float:
Examples
--------
>>> import pandas as pd
>>> import numpy as np
>>> from mapie.metrics import kuiper_p_value
>>> y_true = np.array([1, 0, 1, 0, 1, 0])
>>> y_score = np.array([0.8, 0.3, 0.5, 0.5, 0.7, 0.1])
1 change: 1 addition & 0 deletions mapie/mondrian.py
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ class MondrianCP(BaseEstimator):
>>> import numpy as np
>>> from sklearn.linear_model import LogisticRegression
>>> from mapie.classification import MapieClassifier
>>> from mapie.mondrian import MondrianCP
>>> X_toy = np.arange(9).reshape(-1, 1)
>>> y_toy = np.stack([0, 0, 1, 0, 1, 2, 1, 2, 2])
>>> partition_toy = [0, 0, 0, 0, 1, 1, 1, 1, 1]