From a3a338a963f5e0ed4f18f91f74a55b166cfd24e0 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Mon, 28 Oct 2024 09:18:18 -0400 Subject: [PATCH] make the lint rule consistent between the repos --- pyproject.toml | 3 +-- sdmetrics/reports/base_report.py | 3 ++- sdmetrics/visualization.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fe8195b9..ee0805ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -207,7 +207,6 @@ select = [ "PD" ] ignore = [ - "E501", # pydocstyle "D107", # Missing docstring in __init__ "D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449 @@ -229,7 +228,7 @@ lines-between-types = 0 [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"] "errors.py" = ["D105"] -"tests/**.py" = ["D", "W505"] +"tests/**.py" = ["D"] [tool.ruff.lint.pydocstyle] convention = "google" diff --git a/sdmetrics/reports/base_report.py b/sdmetrics/reports/base_report.py index 2295b59c..614b8083 100644 --- a/sdmetrics/reports/base_report.py +++ b/sdmetrics/reports/base_report.py @@ -145,7 +145,8 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True): if not isinstance(metadata, dict): raise TypeError( f"Expected a dictionary but received a '{type(metadata).__name__}' instead." - " For SDV metadata objects, please use the 'to_dict' function to convert it to a dictionary." + " For SDV metadata objects, please use the 'to_dict' function to convert it" + ' to a dictionary.' ) self._validate(real_data, synthetic_data, metadata) diff --git a/sdmetrics/visualization.py b/sdmetrics/visualization.py index 6b7a9d0c..24427b5a 100644 --- a/sdmetrics/visualization.py +++ b/sdmetrics/visualization.py @@ -554,8 +554,9 @@ def get_column_plot(real_data, synthetic_data, column_name, plot_type=None): plot_type = 'bar' elif plot_type == 'distplot' and column_is_constant: raise ValueError( - f"Plot type 'distplot' cannot be created because column '{column_name}' has a constant value inside" - " the real or synthetic data. To render a visualization, please update the plot_type to 'bar'." + f"Plot type 'distplot' cannot be created because column '{column_name}'" + ' has a constant value inside the real or synthetic data. To render a' + " visualization, please update the plot_type to 'bar'." ) fig = _generate_column_plot(real_column, synthetic_column, plot_type)