Skip to content

Commit 8504db1

Browse files
author
Peter Hamfelt
committed
Update test
1 parent 768f00b commit 8504db1

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

pylint_ml/checkers/matplotlib/matplotlib_parameter.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,32 @@ class MatplotlibParameterChecker(LibraryHandler):
2424
# Define required parameters for specific matplotlib classes and methods
2525
REQUIRED_PARAMS = {
2626
# Plotting Functions
27-
'plot': ['x', 'y'], # x and y data points are required for basic line plots
28-
'scatter': ['x', 'y'], # x and y data points are required for scatter plots
29-
'bar': ['x', 'height'], # x positions and heights are required for bar plots
30-
'hist': ['x'], # Data points (x) are required for histogram plots
31-
'pie': ['x'], # x data is required for pie chart slices
32-
'imshow': ['X'], # Input array (X) is required for displaying images
33-
'contour': ['X', 'Y', 'Z'], # X, Y, and Z data points are required for contour plots
34-
'contourf': ['X', 'Y', 'Z'], # X, Y, and Z data points for filled contour plots
35-
'pcolormesh': ['X', 'Y', 'C'], # X, Y grid and C color values are required for pseudo color plot
36-
27+
"plot": ["x", "y"], # x and y data points are required for basic line plots
28+
"scatter": ["x", "y"], # x and y data points are required for scatter plots
29+
"bar": ["x", "height"], # x positions and heights are required for bar plots
30+
"hist": ["x"], # Data points (x) are required for histogram plots
31+
"pie": ["x"], # x data is required for pie chart slices
32+
"imshow": ["X"], # Input array (X) is required for displaying images
33+
"contour": ["X", "Y", "Z"], # X, Y, and Z data points are required for contour plots
34+
"contourf": ["X", "Y", "Z"], # X, Y, and Z data points for filled contour plots
35+
"pcolormesh": ["X", "Y", "C"], # X, Y grid and C color values are required for pseudo color plot
3736
# Axes Functions
38-
'set_xlabel': ['xlabel'], # xlabel is required for setting the x-axis label
39-
'set_ylabel': ['ylabel'], # ylabel is required for setting the y-axis label
40-
'set_xlim': ['left', 'right'], # Left and right bounds for x-axis limit
41-
'set_ylim': ['bottom', 'top'], # Bottom and top bounds for y-axis limit
42-
37+
"set_xlabel": ["xlabel"], # xlabel is required for setting the x-axis label
38+
"set_ylabel": ["ylabel"], # ylabel is required for setting the y-axis label
39+
"set_xlim": ["left", "right"], # Left and right bounds for x-axis limit
40+
"set_ylim": ["bottom", "top"], # Bottom and top bounds for y-axis limit
4341
# Figures and Subplots
44-
'subplots': ['nrows', 'ncols'], # Number of rows and columns are required for creating a subplot grid
45-
'subplot': ['nrows', 'ncols', 'index'], # Number of rows, columns, and index for specific subplot
46-
42+
"subplots": ["nrows", "ncols"], # Number of rows and columns are required for creating a subplot grid
43+
"subplot": ["nrows", "ncols", "index"], # Number of rows, columns, and index for specific subplot
4744
# Miscellaneous Functions
48-
'savefig': ['fname'], # Filename or file object is required to save a figure
45+
"savefig": ["fname"], # Filename or file object is required to save a figure
4946
}
5047

5148
@only_required_for_messages("matplotlib-parameter")
5249
def visit_call(self, node: nodes.Call) -> None:
53-
if not self.is_library_imported('matplotlib') and self.is_library_version_valid(lib_version=):
54-
return
50+
# TODO Update
51+
# if not self.is_library_imported('matplotlib') and self.is_library_version_valid(lib_version=):
52+
# return
5553

5654
method_name = self._get_full_method_name(node)
5755
if method_name in self.REQUIRED_PARAMS:

pylint_ml/util/library_handler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def visit_importfrom(
2727
def is_library_imported(self, library_name):
2828
return any(mod.startswith(library_name) for mod in self.imports.values())
2929

30-
def is_library_version_valid(self, lib_version):
31-
# TODO update solution
32-
return
30+
# def is_library_version_valid(self, lib_version):
31+
# # TODO update solution
32+
# if lib_version is None:
33+
# pass
34+
# return

0 commit comments

Comments
 (0)