Skip to content

Commit

Permalink
add ploomber-extension (#342)
Browse files Browse the repository at this point in the history
* adds ploomber-extension as a dependency

* linting

* fix tests

* update baseline images
  • Loading branch information
edublancas authored Feb 8, 2024
1 parent 615c393 commit 10f80cf
Show file tree
Hide file tree
Showing 42 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test configuration file, ignore
"""

import matplotlib.pyplot as plt

# mock plt.show() so plots do not appear when running the tests
Expand Down
1 change: 1 addition & 0 deletions examples/data_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
%load_ext autoreload
%autoreload 2
"""

import matplotlib.pyplot as plt
from sklearn_evaluation.plot.matplotlib.bar import bar_groups
from sklearn_evaluation.plot.matplotlib.data_grid import DataGrid
Expand Down
1 change: 1 addition & 0 deletions examples/grouped_bar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
"""

import matplotlib.pyplot as plt
from sklearn_evaluation.plot.matplotlib.bar import bar_groups

Expand Down
1 change: 1 addition & 0 deletions examples/heatmap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
"""

import matplotlib.pyplot as plt
from sklearn_evaluation.plot.matplotlib import heatmap

Expand Down
1 change: 1 addition & 0 deletions override_failed_result_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
this happens sometimes when we make changes, we have to check manually
if differences are acceptable, then run this script
"""

from pathlib import Path
from glob import glob
import shutil
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"altair",
# for pandas.read_html (optional dependency for NotebookCollection)
"lxml",
# tmp fix, 3.8 breaks the tests:
# ERROR tests/test_grid_search.py - ImportError: cannot import name 'cleanup'
# from 'matplotlib.testing.decorators'
"matplotlib<3.8",
]


Expand All @@ -54,6 +58,7 @@
include_package_data=True,
install_requires=[
"ploomber-core>=0.2.6",
"ploomber-extension",
# compute metrics
"scikit-learn",
# plotting
Expand Down
1 change: 1 addition & 0 deletions src/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test configuration for doctests
"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/plot/_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.. plot:: documentation https://matplotlib.org/3.1.3/devel/plot_directive.html
"""

from collections import Counter


Expand Down
2 changes: 1 addition & 1 deletion src/sklearn_evaluation/plot/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import numpy as np
import matplotlib.pyplot as plt
from sklearn.calibration import calibration_curve as sk_calibration_curve
Expand Down Expand Up @@ -111,7 +112,6 @@ def _generate_colors(cmap, n_color):


class CalibrationCurve(AbstractPlot):

"""
Parameters
----------
Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/plot/classification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Plotting functions for classifier models
"""

import json
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/plot/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import time

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Plotting functions for classifier models
"""

import json
import random
import warnings
Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/plot/grid_search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions for visualizing grid search results
"""

import collections

import matplotlib.pyplot as plt
Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/plot/matplotlib/heatmap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Plotting 2 discrete parameters in a heatmap
"""

import numpy as np
from sklearn_evaluation.plot.util import set_default_ax
from sklearn_evaluation.plot.matplotlib.data_grid import DataGrid
Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/preprocessing/binarize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tools for binarizing scores
"""

import numpy as np

from sklearn_evaluation import validate
Expand Down
1 change: 1 addition & 0 deletions src/sklearn_evaluation/training/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities for model training
"""

from sklearn_evaluation.training.selector import DataSelector

__all__ = ["DataSelector"]
1 change: 1 addition & 0 deletions src/sklearn_evaluation/training/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
a series of transformations on your data so you can succinctly define a
subsetting pipeline as a series of dictionaries.
"""

from copy import copy, deepcopy
import abc
import inspect
Expand Down
Binary file modified tests/baseline_images/test_bar/mybar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_calibration_curve/from_raw_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_grid_search/single_numeric_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_roc/roc_multi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_roc/roc_multi_add_multi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_roc/roc_multi_set2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_roc/roc_multi_with_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/test_abstract_plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for AbstractPlot class
"""

import pytest

from sklearn_evaluation.plot.plot import AbstractPlot
Expand Down
1 change: 1 addition & 0 deletions tests/test_calibration_curve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for calibration curve
"""

import pytest
import numpy as np
from matplotlib.testing.decorators import image_comparison
Expand Down
1 change: 1 addition & 0 deletions tests/test_precision_recall.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for precision recall plot.
"""

import pytest
import numpy as np

Expand Down

0 comments on commit 10f80cf

Please sign in to comment.