Skip to content

Commit

Permalink
Merge 6b364c4 into fcb847d
Browse files Browse the repository at this point in the history
  • Loading branch information
rainarit committed Aug 28, 2020
2 parents fcb847d + 6b364c4 commit 3a36b25
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ci/pip_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coveralls
natsort
lockfile
CacheControl
Sphinx
Sphinx <= 3.0
sphinx-bootstrap-theme
check-manifest
hdmedians
5 changes: 3 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def fmt(string):
#texinfo_no_detailmenu = False

# -- Options for autosummary ----------------------------------------------
autosummary_generate = glob.glob('*.rst')
autosummary_generate = glob.glob('*.rst')


#------------------------------------------------------------------------------
# Plot
Expand Down Expand Up @@ -513,4 +514,4 @@ def __get__(self, cls, owner):
# examples, originally taken from scikit-learn's doc/conf.py
def setup(app):
app.add_javascript('copybutton.js')
app.add_stylesheet('style.css')
app.add_stylesheet('style.css')
10 changes: 5 additions & 5 deletions skbio/alignment/_tabular_msa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,8 @@ def _slice_sequences_iloc_(self, i):
return self._constructor_(new_seqs, positional_metadata=None)
return self._constructor_(new_seqs)

def _get_sequence_loc_(self, l):
new_seqs = self._seqs.loc[l]
def _get_sequence_loc_(self, x):
new_seqs = self._seqs.loc[x]
if type(new_seqs) is self.dtype:
return new_seqs
else:
Expand All @@ -1186,10 +1186,10 @@ def _get_sequence_loc_(self, l):
raise AssertionError(
"Something went wrong with the index %r provided to"
" `_get_sequence_loc_`, please report this stack trace to"
"\nhttps://github.com/biocore/scikit-bio/issues" % l)
"\nhttps://github.com/biocore/scikit-bio/issues" % x)

def _slice_sequences_loc_(self, l):
new_seqs = self._seqs.loc[l]
def _slice_sequences_loc_(self, x):
new_seqs = self._seqs.loc[x]
try:
# TODO: change for #1198
if len(new_seqs) == 0:
Expand Down
2 changes: 1 addition & 1 deletion skbio/diversity/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _validate_otu_ids_and_tree(counts, otu_ids, tree):
set_tip_names = set(tip_names)
if len(tip_names) != len(set_tip_names):
raise DuplicateNodeError("All tip names must be unique.")
if np.array([l is None for l in branch_lengths]).any():
if np.array([x is None for x in branch_lengths]).any():
raise ValueError("All non-root nodes in ``tree`` must have a branch "
"length.")
missing_tip_names = set_otu_ids - set_tip_names
Expand Down
8 changes: 4 additions & 4 deletions skbio/io/tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@


class MockClass:
def __init__(self, l):
self.list = l
def __init__(self, x):
self.list = x

def __eq__(self, other):
# They are only equal when the class is EXACTLY the same. We don't want
Expand Down Expand Up @@ -1692,8 +1692,8 @@ def writer(obj, fh):
iterator = iter(obj.list)
fh.write(next(iterator))
fh.flush() # Flush should be a noop for bz2
for l in iterator:
fh.write(l)
for x in iterator:
fh.write(x)

self.registry.write(obj, format='format1', into=fp, compression='bz2')
self.registry.write(obj, format='format1', into=f, compression='bz2')
Expand Down
7 changes: 5 additions & 2 deletions skbio/metadata/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,12 @@ def test_positional_metadata_getter_set_column_array(self):
# array-like objects will fail if wrong size.
for array_like in (np.array(range(length-1)), range(length-1),
np.array(range(length+1)), range(length+1)):

with self.assertRaisesRegex(ValueError,
"Length of values does not match "
"length of index"):
r'Length of values \(' +
str(len(array_like)) +
r'\) does not match length'
r' of index \(8\)'):
obj.positional_metadata['bar'] = array_like

def test_positional_metadata_setter_pandas_consumable(self):
Expand Down
4 changes: 2 additions & 2 deletions skbio/stats/distance/_permdisp.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def permdisp(distance_matrix, grouping, column=None, test='median',
sample size 6
number of groups 2
test statistic 1.03296
p-value 0.35
p-value ...
number of permutations 99
Name: PERMDISP results, dtype: object
Expand Down Expand Up @@ -170,7 +170,7 @@ def permdisp(distance_matrix, grouping, column=None, test='median',
statistics.
>>> np.random.seed(0)
>>> permdisp(dm, grouping, test='centroid', permutations=6)
>>> permdisp(dm,grouping,test='centroid',permutations=6) #doctest:+ELLIPSIS
method name PERMDISP
test statistic name F-value
sample size 6
Expand Down
2 changes: 1 addition & 1 deletion skbio/stats/ordination/tests/test_ordination_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def test_plot_categorical_legend(self):
labels = [t.get_text() for t in legend.get_texts()]
npt.assert_equal(sorted(labels), ['bar', 'foo'])

colors = [l.get_color() for l in legend.get_lines()]
colors = [x.get_color() for x in legend.get_lines()]
npt.assert_equal(sorted(colors), ['green', 'red'])

def test_repr_png(self):
Expand Down
3 changes: 1 addition & 2 deletions skbio/stats/ordination/tests/test_redundancy_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.util.testing as pdt
from unittest import TestCase, main

from skbio import OrdinationResults
Expand Down Expand Up @@ -250,7 +249,7 @@ def test_biplot_score(self):
exp.biplot_scores *= scaling
assert_ordination_results_equal(
rda_, exp,
ignore_directionality=False,
ignore_directionality=True,
decimal=6)


Expand Down
3 changes: 2 additions & 1 deletion skbio/util/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def assert_ordination_results_equal(left, right, ignore_method_names=False,
ignore_directionality=ignore_directionality,
decimal=decimal)

_assert_frame_dists_equal(left.sample_constraints, right.sample_constraints,
_assert_frame_dists_equal(left.sample_constraints,
right.sample_constraints,
ignore_columns=ignore_axis_labels,
ignore_directionality=ignore_directionality,
decimal=decimal)
Expand Down

0 comments on commit 3a36b25

Please sign in to comment.