From 3223cdd2dce9f432f5e428753a15889786c48723 Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Mon, 6 Jan 2025 09:47:25 -0500 Subject: [PATCH] Fix a few pylint warnings --- taxcalc/calculator.py | 14 ++++++++------ taxcalc/tests/test_decorators.py | 9 +++++++-- taxcalc/utils.py | 6 +++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/taxcalc/calculator.py b/taxcalc/calculator.py index 7a1bc5eae..03a5b694d 100644 --- a/taxcalc/calculator.py +++ b/taxcalc/calculator.py @@ -1044,12 +1044,14 @@ def pch_graph(self, calc, pop_quantiles=False): data = pch_graph_data(vdf, year=self.current_year, pop_quantiles=pop_quantiles) # construct figure from data - fig = pch_graph_plot(data, - width=850, - height=500, - xlabel='', - ylabel='', - title='') + # (see comment at end of pch_graph_plot function in utils.py) + fig = pch_graph_plot( # pylint: disable=assignment-from-no-return + data, + width=850, + height=500, + xlabel='', + ylabel='', + title='') return fig REQUIRED_REFORM_KEYS = set(['policy']) diff --git a/taxcalc/tests/test_decorators.py b/taxcalc/tests/test_decorators.py index ecd64ae20..0ee3afe5c 100644 --- a/taxcalc/tests/test_decorators.py +++ b/taxcalc/tests/test_decorators.py @@ -133,9 +133,14 @@ def magic_calc2(x, y, z): return (a, b) -class Foo: +class Foo: # pylint: disable=too-many-instance-attributes """Foo class""" - # pylint: disable=too-few-public-methods,too-many-instance-attributes + + def faux_method1(self): + """ Foo method""" + + def faux_method2(self): + """ Foo method""" @iterate_jit(nopython=True) diff --git a/taxcalc/utils.py b/taxcalc/utils.py index 0c72cc62d..94ec8b81f 100644 --- a/taxcalc/utils.py +++ b/taxcalc/utils.py @@ -1314,10 +1314,10 @@ def pch_graph_plot(data, # bokeh cannot save this fig saying: # bokeh.core.serialization.SerializationError: # can't serialize - # so the "return fig" statement is replaced by "return None" until - # the above logic can be made compatible with modern bokeh packages + # so the "return fig" statement is replaced by Python's implicit + # "return None" until the above logic can be made compatible with + # modern bokeh packages # return fig - return None def write_graph_file(figure, filename, title):