Skip to content

Commit

Permalink
Merge 187f536 into e615c4c
Browse files Browse the repository at this point in the history
  • Loading branch information
mortonjt committed Jun 28, 2019
2 parents e615c4c + 187f536 commit 2a6150d
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 37 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
sudo: false
language: python
env:
- PYVERSION=3.5 USE_CYTHON=TRUE MAKE_DOC=TRUE
- PYVERSION=3.6 USE_CYTHON=TRUE MAKE_DOC=TRUE
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- export MPLBACKEND='Agg'
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
Expand Down
9 changes: 1 addition & 8 deletions ci/conda_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
pip
nose
pycodestyle
flake8
IPython>4.0.0
notebook
scikit-bio=0.5.1
pyqt=4.11.4
bokeh
biom-format
bokeh=1.1.0
4 changes: 2 additions & 2 deletions ci/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coveralls
ete3
statsmodels
sphinx
pycodestyle
flake8
2 changes: 1 addition & 1 deletion gneiss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

__version__ = "0.4.4"
__version__ = "0.4.5"
2 changes: 1 addition & 1 deletion gneiss/composition/_variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def variation_matrix(X):
""" Calculate Aitchison variation matrix.
r""" Calculate Aitchison variation matrix.
This calculates the Aitchison variation matrix. Given a compositional
matrix :math:`X`, and columns :math:`i` and :math:`j`, the :math:`ij` entry
Expand Down
2 changes: 2 additions & 0 deletions gneiss/plot/tests/test_dendrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_coords(self):
index=['x', 'y', 'child0', 'child1', 'is_tip']).T

res = t.coords(500, 500)
exp = exp.loc[res.index]
pdt.assert_frame_equal(exp, res)

def test_rescale(self):
Expand Down Expand Up @@ -148,6 +149,7 @@ def test_coords(self):
index=['x', 'y', 'child0', 'child1', 'is_tip']).T

res = t.coords(width=20, height=self.table.shape[0])
exp = exp.loc[res.index]
pdt.assert_frame_equal(exp, res)

def test_rescale(self):
Expand Down
15 changes: 8 additions & 7 deletions gneiss/plot/tests/test_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def test_basic(self):

# Make sure that the metadata labels are set properly
res = str(fig.get_axes()[1].get_xticklabels(minor=True)[0])
self.assertEqual(res, "Text(0,0,'a')")
self.assertEqual(res, "Text(0, 0, 'a')")

res = str(fig.get_axes()[1].get_xticklabels(minor=True)[1])
self.assertEqual(res, "Text(0,0,'b')")
self.assertEqual(res, "Text(0, 0, 'b')")

res = str(fig.get_axes()[1].get_xlabel())
self.assertEqual(res, "None")
self.assertEqual(res, "")

def test_basic_line_width(self):
fig = heatmap(self.table, self.t, self.md,
Expand Down Expand Up @@ -182,17 +182,18 @@ def test_highlights(self):

# Make sure that the metadata labels are set properly
res = str(fig.get_axes()[2].get_xticklabels(minor=True)[0])
self.assertEqual(res, "Text(0,0,'a')")
self.assertEqual(res, "Text(0, 0, 'a')")

res = str(fig.get_axes()[2].get_xticklabels(minor=True)[1])
self.assertEqual(res, "Text(0,0,'b')")
self.assertEqual(res, "Text(0, 0, 'b')")

print([str(i) for i in fig.get_axes()[1].get_xticklabels()])
# Make sure that the highlight labels are set properly
res = str(fig.get_axes()[1].get_xticklabels()[0])
self.assertEqual(res, "Text(0,0,'y7')")
self.assertEqual(res, "Text(0, 0, 'y8')")

res = str(fig.get_axes()[1].get_xticklabels()[1])
self.assertEqual(res, "Text(0,0,'y8')")
self.assertEqual(res, "Text(0, 0, 'y7')")

# Test to see if the highlights are ok
res = fig.get_axes()[2].get_position()._points
Expand Down
21 changes: 14 additions & 7 deletions gneiss/plot/tests/test_radial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from skbio import TreeNode, DistanceMatrix
from gneiss.plot._radial import radialplot
from gneiss.plot._dendrogram import UnrootedDendrogram
import numpy.testing as npt


class TestRadial(unittest.TestCase):
Expand Down Expand Up @@ -49,13 +50,13 @@ def test_basic_plot(self):
'hover_var': [None, None, None, None, None],
'is_tip': [True, True, True, False, False],
'node_size': [10, 10, 10, 10, 10],
'x': [487.5,
12.499999999999972,
'x': [12.499999999999972,
487.5,
324.89684138234867,
338.26125938385832,
193.16888625577729],
'y': [347.7691620070637,
483.28006102610289,
'y': [483.28006102610289,
347.7691620070637,
16.719938973897143,
271.72822561264161,
365.95231443706376]}
Expand Down Expand Up @@ -83,9 +84,15 @@ def test_basic_plot(self):
node_size='node_size', edge_width='edge_width')

for e in exp_edges.keys():
self.assertListEqual(
list(p.renderers[0].data_source.data[e]),
exp_edges[e])
if isinstance(exp_edges[e], float):
npt.assert_allclose(
p.renderers[0].data_source.data[e],
np.array(exp_edges[e])
)
else:
self.assertListEqual(
list(p.renderers[0].data_source.data[e]),
exp_edges[e])

for e in exp_nodes.keys():
self.assertListEqual(
Expand Down
10 changes: 5 additions & 5 deletions gneiss/regression/tests/test_ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from skbio.util import get_data_path
from gneiss.regression import ols
from gneiss.balances import balance_basis
import statsmodels.formula.api as smf
from statsmodels.regression.linear_model import OLS


class TestOLS(unittest.TestCase):
Expand Down Expand Up @@ -45,8 +45,8 @@ def setUp(self):
self.Y = Y
self.B = B
self.X = X
self.r1_ = smf.OLS(endog=y1, exog=X).fit()
self.r2_ = smf.OLS(endog=y2, exog=X).fit()
self.r1_ = OLS(endog=y1, exog=X).fit()
self.r2_ = OLS(endog=y2, exog=X).fit()
self.tree = TreeNode.read(['(c, (b,a)y2)y1;'])

self.results = "results"
Expand Down Expand Up @@ -257,8 +257,8 @@ def setUp(self):
self.Y = Y
self.B = B
self.X = X
self.r1_ = smf.OLS(endog=y1, exog=X).fit()
self.r2_ = smf.OLS(endog=y2, exog=X).fit()
self.r1_ = OLS(endog=y1, exog=X).fit()
self.r2_ = OLS(endog=y2, exog=X).fit()
self.tree = TreeNode.read(['(c, (b,a)y2)y1;'])

def test_loo(self):
Expand Down
4 changes: 2 additions & 2 deletions gneiss/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _cache_ntips(tree):


def ladderize(tree, ascending=True):
"""
r"""
Sorts tree according to the size of the subtrees.
Parameters
Expand Down Expand Up @@ -200,7 +200,7 @@ def ladderize(tree, ascending=True):


def gradient_sort(tree, gradient, ascending=True):
"""
r"""
Sorts tree according to ordering in gradient.
Parameters
Expand Down
3 changes: 2 additions & 1 deletion gneiss/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ def _type_cast_to_float(df):


def block_diagonal(ncols, nrows, nblocks):
""" Generate block diagonal with uniformly distributed values within blocks.
""" Generate block diagonal with uniformly distributed values within
blocks.
Parameters
----------
Expand Down

0 comments on commit 2a6150d

Please sign in to comment.