• Home
  • Raw
  • Download

Lines Matching +full:sort +full:- +full:object

6 # ./scripts/code.py lfs.o lfs_util.o -q -o lfs.code.csv
7 # ./scripts/data.py lfs.o lfs_util.o -q -o lfs.data.csv
8 # ./scripts/summary.py lfs.code.csv lfs.data.csv -q -o lfs.csv
9 # ./scripts/summary.py -Y lfs.csv -f code=code_size,data=data_size
12 # SPDX-License-Identifier: BSD-3-Clause
36 m.sqrt(sum((float(x) - mean)**2 for x in xs) / len(xs)))
57 # also accept +-∞ and +-inf
60 elif re.match('^\s*-\s*(?:∞|inf)\s*$', x):
61 x = -m.inf
70 elif self.x == -m.inf:
71 return '-∞'
82 none = '%7s' % '-'
86 diff_none = '%7s' % '-'
92 diff = new - old
95 elif diff == -m.inf:
96 return '%7s' % '-∞'
108 return -m.inf
114 return (new-old) / old
120 return self.__class__(self.x - other.x)
135 # also accept +-∞ and +-inf
138 elif re.match('^\s*-\s*(?:∞|inf)\s*$', x):
139 x = -m.inf
148 elif self.x == -m.inf:
149 return '-∞'
184 none = '%11s %7s' % ('-', '-')
190 else '-∞%' if t == -m.inf
193 diff_none = '%11s' % '-'
209 return new - old
215 return self.__class__(self.a - other.a, self.b - other.b)
302 sys.exit(-1)
323 **{k: object.__getattribute__(self, k)
324 + object.__getattribute__(other, k)
329 if object.__getattribute__(self, k):
330 return ops.get(k, OPS['sum'])(object.__getattribute__(self, k))
333 return object.__getattribute__(self, k)
357 sys.exit(-1)
385 sort=None, argument
412 # sort again, now with diff info, note that python's sort is stable
413 names.sort()
415 names.sort(key=lambda n: tuple(
421 if sort:
422 for k, reverse in reversed(sort):
423 names.sort(
491 else '-∞%' if t == -m.inf
497 else '-∞%' if t == -m.inf
536 # find the best widths, note that column 0 contains the names and column -1
539 ((max(it.chain([w], (len(l[i]) for l in lines)))+1+4-1)//4)*4-1
542 range(len(lines[0])-1))]
546 print('%-*s %s%s' % (
549 for w, x in zip(widths[1:], line[1:-1])),
550 line[-1]))
553 def openio(path, mode='r', buffering=-1):
554 # allow '-' for stdin/stdout
555 if path == '-':
567 sort=None, argument
584 sys.exit(-1)
600 sys.exit(-1)
653 # sort, note that python's sort is stable
654 results.sort()
655 if sort:
656 for k, reverse in reversed(sort):
657 results.sort(
710 sort=sort,
725 '-q', '--quiet',
727 help="Don't show anything, useful with -o.")
729 '-o', '--output',
732 '-d', '--diff',
735 '-a', '--all',
739 '-p', '--percent',
743 '-b', '--by',
750 '-f', '--field',
758 '-D', '--define',
763 "comma-separated options.")
766 if namespace.sort is None:
767 namespace.sort = []
768 namespace.sort.append((value, True if option == '-S' else False))
770 '-s', '--sort',
773 help="Sort by this field.")
775 '-S', '--reverse-sort',
778 help="Sort by this field, but backwards.")
780 '-Y', '--summary',
784 '--int',
788 '--float',
792 '--frac',
796 '--sum',
800 '--prod',
804 '--min',
808 '--max',
812 '--mean',
816 '--stddev',
820 '--gmean',
824 '--gstddev',