Skip to content

Commit 34bf1d5

Browse files
gregcaporasoebolyen
authored andcommitted
MAINT: update sorting order of positional metadata
this seems to be a difference in how pd.concat is sorting the columns, and likely coming up because of the `odd_key` used here (an empty `frozendict`). this may be related to this pandas bug fix that went into pandas 1.5.0: pandas-dev/pandas#47331
1 parent ad28d63 commit 34bf1d5

File tree

10 files changed

+22
-28
lines changed

10 files changed

+22
-28
lines changed

checklist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def _parse_file(self, fp, root):
457457
if node.level > 0:
458458
prefix = root
459459
extra = node.level - 1
460-
while(extra > 0):
460+
while (extra > 0):
461461
# Keep dropping...
462462
prefix = os.path.split(prefix)[0]
463463
extra -= 1

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
'matplotlib >= 1.4.3',
152152
'natsort >= 4.0.3',
153153
'numpy >= 1.9.2',
154-
'pandas >= 1.0.0',
154+
'pandas >= 1.5.0',
155155
'scipy >= 1.9.0',
156156
'h5py >= 2.9.0',
157157
'hdmedians >= 0.14.1',

skbio/diversity/alpha/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ def pielou_e(counts):
795795

796796
@experimental(as_of="0.4.0")
797797
def robbins(counts):
798-
r"""Calculate Robbins' estimator for the probability of unobserved outcomes.
798+
r"""Calculate Robbins' estimator for probability of unobserved outcomes.
799799
800800
Robbins' estimator is defined as:
801801

skbio/io/format/embl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ def _serialize_reference(header, obj, cross_references, indent=5):
11651165

11661166
# delete PUBMED key (already present in CROSS_REFERENCE)
11671167
if "PUBMED" in data:
1168-
del(data["PUBMED"])
1168+
del (data["PUBMED"])
11691169

11701170
else:
11711171
# no cross reference, do I have PUBMED in data?

skbio/io/format/tests/test_clustal.py

+13-18
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,22 @@ def CGAUCAGUCAGUCGAU---------- 34
163163
xyz UGCUGCAUCA---------------- 33
164164
* ***""")
165165
]
166-
self.invalid_clustal_out = [StringIO('\n'.join(['dshfjsdfhdfsj',
167-
'hfsdjksdfhjsdf'])),
168-
StringIO('\n'.join(['hfsdjksdfhjsdf'])),
169-
StringIO('\n'.join(['dshfjsdfhdfsj',
170-
'dshfjsdfhdfsj',
171-
'hfsdjksdfhjsdf'])),
172-
StringIO('\n'.join(['dshfjsdfhdfsj',
173-
'\t',
174-
'hfsdjksdfhjsdf'])),
175-
StringIO('\n'.join(['dshfj\tdfhdfsj',
176-
'hfsdjksdfhjsdf'])),
177-
StringIO('\n'.join(['dshfjsdfhdfsj',
178-
'hfsdjk\tdfhjsdf'])),
179-
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
166+
self.invalid_clustal_out = [
167+
StringIO('\n'.join(['dshfjsdfhdfsj', 'hfsdjksdfhjsdf'])),
168+
StringIO('\n'.join(['hfsdjksdfhjsdf'])),
169+
StringIO('\n'.join(['dshfjsdfhdfsj', 'dshfjsdfhdfsj',
170+
'hfsdjksdfhjsdf'])),
171+
StringIO('\n'.join(['dshfjsdfhdfsj', '\t', 'hfsdjksdfhjsdf'])),
172+
StringIO('\n'.join(['dshfj\tdfhdfsj', 'hfsdjksdfhjsdf'])),
173+
StringIO('\n'.join(['dshfjsdfhdfsj', 'hfsdjk\tdfhjsdf'])),
174+
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
180175
181176
182177
adj GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA
183178
------------------------------------------------------------
184179
adk -----GGGGGGG------------------------------------------------
185180
"""),
186-
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
181+
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
187182
188183
189184
adj GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA
@@ -193,7 +188,7 @@ def CGAUCAGUCAGUCGAU---------- 34
193188
adj GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA
194189
adk -----GGGGGGG---------------------------------------------
195190
"""),
196-
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
191+
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
197192
198193
199194
adj GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA
@@ -204,15 +199,15 @@ def CGAUCAGUCAGUCGAU---------- 34
204199
adk -----GGGGGGG---------------------------------------------
205200
"""),
206201

207-
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
202+
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
208203
209204
210205
adj GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA
211206
------------------------------------------------------------
212207
adk -----GGGGGGG------------------------------------------------
213208
"""),
214209

215-
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
210+
StringIO("""CLUSTAL W (1.74) multiple sequence alignment
216211
217212
218213
GCAUGCAUGCAUGAUCGUACGUCAGCAUGCUAGACUGCAUACGUACGUACGCAUGCAUCA

skbio/metadata/_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def __repr__(self):
175175

176176
@experimental(as_of='0.5.1')
177177
def drop(self):
178-
'''Drop this ``Interval`` object from the interval metadata it links to.
178+
'''Drop this ``Interval`` object from interval metadata it links to.
179179
180180
If the ``Interval`` object is dropped, you can still get values of
181181
``bounds``, ``fuzzy``, and ``metadata`` attributes, but you

skbio/sequence/_sequence.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ def _constructor(self, **kwargs):
20982098
return self.__class__(**kwargs)
20992099

21002100
def _munge_to_index_array(self, sliceable):
2101-
r"""Return an index array from something isomorphic to a boolean vector.
2101+
r"""Return index array from something isomorphic to a boolean vector.
21022102
21032103
"""
21042104
if isinstance(sliceable, str):

skbio/sequence/tests/test_sequence.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def test_concat_strict_simple(self):
169169
def test_concat_strict_many(self):
170170
odd_key = frozenset()
171171
expected = Sequence("13579",
172-
positional_metadata={'a': list('skbio'),
173-
odd_key: [1, 2, 3, 4, 5]})
172+
positional_metadata={odd_key: [1, 2, 3, 4, 5],
173+
'a': list('skbio')})
174174
result = Sequence.concat([
175175
Sequence("1", positional_metadata={'a': ['s'], odd_key: [1]}),
176176
Sequence("3", positional_metadata={'a': ['k'], odd_key: [2]}),

skbio/stats/distance/_mantel.py

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from scipy.stats import kendalltau
1616
from scipy.stats import ConstantInputWarning
1717
from scipy.stats import NearConstantInputWarning
18-
from scipy.stats import ConstantInputWarning
1918

2019
from skbio.stats.distance import DistanceMatrix
2120
from skbio.util._decorator import experimental

skbio/tree/_nj.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def result_constructor(x):
118118

119119
# while there are still more than three distances in the distance matrix,
120120
# join neighboring nodes.
121-
while(dm.shape[0] > 3):
121+
while (dm.shape[0] > 3):
122122
# compute the Q matrix
123123
q = _compute_q(dm)
124124

0 commit comments

Comments
 (0)