Skip to content

Commit

Permalink
Fix pylint E1111 and E1120 warnings; update bokeh required version
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 5, 2025
1 parent 1400752 commit f8694d5
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requirements:
- "python>=3.10, <3.13"
- "numpy>=1.26"
- "pandas>=2.2"
- "bokeh>=2.4"
- "bokeh>=3.6"
- "paramtools>=0.19.0"
- numba
- curl
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- "python>=3.10, <3.13"
- "numpy>=1.26"
- "pandas>=2.2"
- "bokeh>=2.4"
- "bokeh>=3.6"
- numba
- curl
- setuptools
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

from setuptools import setup

with open("README.md") as f:
with open("README.md", "r", encoding="utf-8") as f:
longdesc = f.read()

VERSION = "4.4.0"

config = {
"description": "Tax Calculator",
"description": "Tax-Calculator",
"url": "https://github.com/PSLmodels/Tax-Calculator",
"download_url": "https://github.com/PSLmodels/Tax-Calculator",
"description": "taxcalc",
"long_description_content_type": "text/markdown",
"long_description": longdesc,
"version": VERSION,
Expand All @@ -24,7 +23,7 @@
"install_requires": [
"numpy>=1.26",
"pandas>=2.2",
"bokeh>=2.4",
"bokeh>=3.6",
"numba",
"paramtools>=0.19.0",
],
Expand Down
2 changes: 1 addition & 1 deletion taxcalc.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.2
Requires-Dist: bokeh>=2.4
Requires-Dist: bokeh>=3.6
Requires-Dist: numba
Requires-Dist: paramtools>=0.19.0

Expand Down
2 changes: 1 addition & 1 deletion taxcalc.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy>=1.26
pandas>=2.2
bokeh>=2.4
bokeh>=3.6
numba
paramtools>=0.19.0
4 changes: 0 additions & 4 deletions taxcalc/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,17 +1043,13 @@ def pch_graph(self, calc, pop_quantiles=False):
# construct data for graph
data = pch_graph_data(vdf, year=self.current_year,
pop_quantiles=pop_quantiles)
del vdf
del vdf1
del vdf2
# construct figure from data
fig = pch_graph_plot(data,
width=850,
height=500,
xlabel='',
ylabel='',
title='')
del data
return fig

REQUIRED_REFORM_KEYS = set(['policy'])
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, data, start_year, gfactors, weights):
def _extrapolate(self, year):
val = getattr(self, 'e00300')
setattr(
self, 'e00300', val* self.gfactors.factor_value('AINTS', year)
self, 'e00300', val * self.gfactors.factor_value('AINTS', year)
)

# test Recs class for incorrect instantiation
Expand Down
8 changes: 8 additions & 0 deletions taxcalc/tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def magic_calc(x, y, z):
def magic(pm, pf):
"""Function docstring"""
# Adjustments
# pylint: disable=no-value-for-parameter
outputs = pf.a, pf.b = magic_calc(pm, pf)
# pylint: enable=no-value-for-parameter
header = ['a', 'b']
return DataFrame(data=np.column_stack(outputs), columns=header)

Expand Down Expand Up @@ -182,6 +184,9 @@ def test_magic_apply_jit_swap():
assert_frame_equal(xx, exp)


# pylint: disable=no-value-for-parameter


def test_magic_iterate_jit():
"""Test docstring"""
pm = Foo()
Expand Down Expand Up @@ -293,6 +298,9 @@ def test_function_parameters_optional():
assert_frame_equal(ans, exp)


# pylint: enable=no-value-for-parameter


def unjittable_function1(w, x, y, z):
"""Function docstring"""
a = x + y
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ def pch_graph_plot(data,
fig.yaxis.axis_label_text_font_size = '12pt'
fig.yaxis.axis_label_text_font_style = 'normal'
fig.yaxis[0].formatter = PrintfTickFormatter(format='%.1f')
# return fig # bokeh 3.4.1 cannot save this figure for some unknown reason
return fig


def write_graph_file(figure, filename, title):
Expand Down

0 comments on commit f8694d5

Please sign in to comment.