Showing 1 of 1 files from the diff.

@@ -252,16 +252,20 @@
Loading
252 252
#==============================================================================
253 253
# Sorting
254 254
#==============================================================================
255 -
def sort_against(list1, list2, reverse=False, sort_key=lambda x: x[0]):
255 +
def sort_against(list1, list2, reverse=False, sort_key=None):
256 256
    """
257 257
    Arrange items of list1 in the same order as sorted(list2).
258 258
259 259
    In other words, apply to list1 the permutation which takes list2 
260 260
    to sorted(list2, reverse).
261 261
    """
262 +
    if sort_key is None:
263 +
        key = lambda x: x[0]
264 +
    else:
265 +
        key = lambda x: sort_key(x[0])
262 266
    try:
263 267
        return [item for _, item in 
264 -
                sorted(zip(list2, list1), key=sort_key, reverse=reverse)]
268 +
                sorted(zip(list2, list1), key=key, reverse=reverse)]
265 269
    except:
266 270
        return list1
267 271
Files Coverage
spyder_kernels 50.78%
Project Totals (22 files) 50.78%
1
codecov:
2
  branch: master
3

4
coverage:
5
  precision: 2
6
  round: down
7
  range: "70...100"
8
  
9
  status:
10
    project:
11
      default:
12
        threshold: 5%
13
    patch: no
14
    changes: no
15
    
16
parsers:
17
  gcov:
18
    branch_detection:
19
      conditional: yes
20
      loop: yes
21
      method: no
22
      macro: no
23
   
24
comment: false
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading