From 501b8904c6f344325540cdc1b505319e181033f8 Mon Sep 17 00:00:00 2001 From: mahaalbashir Date: Wed, 18 Oct 2023 11:31:02 +0100 Subject: [PATCH] fixing pulint issues --- acro/acro_tables.py | 7 ++++--- acro/record.py | 2 +- test/test_initial.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/acro/acro_tables.py b/acro/acro_tables.py index 2e44c0a..6ccdadf 100644 --- a/acro/acro_tables.py +++ b/acro/acro_tables.py @@ -527,7 +527,7 @@ def survival_plot( # pylint: disable=too-many-arguments,too-many-locals ) return plot - def hist( + def hist( # pylint: disable=too-many-arguments,too-many-locals self, data, column, @@ -623,7 +623,8 @@ def hist( status = "fail" if self.suppress: logger.warning( - f"Histogram will not be shown as the {column} column is disclosive." + "Histogram will not be shown as the %s column is disclosive.", + column, ) else: # pragma: no cover data.hist( @@ -664,7 +665,7 @@ def hist( legend=legend, **kwargs, ) - logger.info(f"status: {status}") + logger.info("status: %s", status) # create the summary min_value = data[column].min() diff --git a/acro/record.py b/acro/record.py index 9103d2d..c39a54b 100644 --- a/acro/record.py +++ b/acro/record.py @@ -175,7 +175,7 @@ def serialize_output(self, path: str = "outputs") -> list[str]: if os.path.exists(filename): shutil.copy(filename, path) output.append(Path(filename).name) - if self.output_type == "survival plot" or self.output_type == "histogram": + if self.output_type in ["survival plot", "histogram"]: for filename in self.output: if os.path.exists(filename): output.append(Path(filename).name) diff --git a/test/test_initial.py b/test/test_initial.py index 8104e7f..12d2854 100644 --- a/test/test_initial.py +++ b/test/test_initial.py @@ -872,7 +872,7 @@ def test_crosstab_with_manual_totals_with_suppression_with_two_aggfunc( def test_histogram_discolsive(data, acro, caplog): """Test a discolsive histogram.""" - filename = r"acro_artifacts\histogram_0.png" + filename = os.path.normpath("acro_artifacts/histogram_0.png") _ = acro.hist(data, "inc_grants") assert os.path.exists(filename) acro.add_exception("output_0", "Let me have it") @@ -888,7 +888,7 @@ def test_histogram_discolsive(data, acro, caplog): def test_histogram_non_disclosive(data, acro): """Test a non discolsive histogram.""" - filename = r"acro_artifacts\histogram_0.png" + filename = os.path.normpath("acro_artifacts/histogram_0.png") _ = acro.hist(data, "inc_grants", bins=1) assert os.path.exists(filename) acro.add_exception("output_0", "Let me have it")