Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
mortonjt committed Jul 8, 2021
1 parent 2ddd451 commit 3667e14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions gneiss/plot/tests/test_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,17 @@ def test_proportion_plot(self):
num_features, denom_features,
self.feature_metadata,
label_col='phylum')
res = np.vstack([l.get_xydata() for l in ax1.get_lines()])
res = np.vstack([L.get_xydata() for L in ax1.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, verbose=True)

res = np.vstack([l.get_xydata() for l in ax2.get_lines()])
res = np.vstack([L.get_xydata() for L in ax2.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, verbose=True)

res = [l._text for l in ax2.get_yticklabels()]
res = [L._text for L in ax2.get_yticklabels()]
exp = ['p__bar', 'p__bar', 'p__tar', 'p__far']
self.assertListEqual(res, exp)

Expand All @@ -162,17 +162,17 @@ def test_proportion_plot_order(self):
num_features, denom_features,
self.feature_metadata,
label_col='phylum')
res = np.vstack([l.get_xydata() for l in ax1.get_lines()])
res = np.vstack([L.get_xydata() for L in ax1.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, atol=1e-2, rtol=1e-2, verbose=True)

res = np.vstack([l.get_xydata() for l in ax2.get_lines()])
res = np.vstack([L.get_xydata() for L in ax2.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, atol=1e-2, rtol=1e-2, verbose=True)

res = [l._text for l in ax2.get_yticklabels()]
res = [L._text for L in ax2.get_yticklabels()]
exp = ['p__bar', 'p__bar', 'p__far', 'p__tar']
self.assertListEqual(res, exp)

Expand All @@ -189,17 +189,17 @@ def test_proportion_plot_order_figure(self):
num_features, denom_features,
self.feature_metadata,
label_col='phylum', axes=axes)
res = np.vstack([l.get_xydata() for l in ax1.get_lines()])
res = np.vstack([L.get_xydata() for L in ax1.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, atol=1e-2, rtol=1e-2, verbose=True)

res = np.vstack([l.get_xydata() for l in ax2.get_lines()])
res = np.vstack([L.get_xydata() for L in ax2.get_lines()])
exp = np.array([0., 0., 1., 1., 2., 2., 3., 3.])

npt.assert_allclose(res[:, 1], exp, atol=1e-2, rtol=1e-2, verbose=True)

res = [l._text for l in ax2.get_yticklabels()]
res = [L._text for L in ax2.get_yticklabels()]
exp = ['p__bar', 'p__bar', 'p__far', 'p__tar']
self.assertListEqual(res, exp)

Expand All @@ -214,7 +214,7 @@ def test_proportion_plot_original_labels(self):
num_features, denom_features,
axes=axes)

res = [l._text for l in ax2.get_yticklabels()]
res = [L._text for L in ax2.get_yticklabels()]
exp = ['A', 'B', 'D', 'C']
self.assertListEqual(res, exp)

Expand Down
2 changes: 1 addition & 1 deletion gneiss/plot/tests/test_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_basic_line_width(self):

# Test to see if the lineages of the tree are ok
lines = list(fig.get_axes()[1].get_lines())
widths = [l.get_lw() for l in lines]
widths = [L.get_lw() for L in lines]
np.allclose(widths, [1.0] * len(widths))

def test_highlights(self):
Expand Down
8 changes: 4 additions & 4 deletions gneiss/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,19 +412,19 @@ def block_diagonal(ncols, nrows, nblocks):
return mat


def _shift(l, n):
def _shift(L, n):
""" Creates the band table by iteratively shifting a single vector.
Parameters
----------
l : array
L : array
Vector to be shifted
n : int
Max number of shifts
"""
sl = l
sl = L

table = [l]
table = [L]

if n == 0:
return table
Expand Down

0 comments on commit 3667e14

Please sign in to comment.