snakemake/benchmark.py
def to_tsv(self):
        """Return ``str`` with the TSV representation of this record"""

        def to_tsv_str(x):
            """Conversion of value to str for TSV (None becomes "-")"""
            if x is None:
                return "-"
            elif isinstance(x, float):
                return "{:.2f}".format(x)
            else:
                return str(x)

        def timedelta_to_str(x):
            """Conversion of timedelta to str without fractions of seconds"""
            mm, ss = divmod(x.seconds, 60)
            hh, mm = divmod(mm, 60)
            s = "%d:%02d:%02d" % (hh, mm, ss)
            if x.days:

                def plural(n):
                    return n, abs(n) != 1 and "s" or ""

                s = ("%d day%s, " % plural(x.days)) + s
            return s

        return "\t".join(
            map(
                to_tsv_str,
                (
                    "{:.4f}".format(self.running_time),
                    timedelta_to_str(datetime.timedelta(seconds=self.running_time)),
                    self.max_rss,
                    self.max_vms,
                    self.max_uss,
                    self.max_pss,
                    self.io_in,
                    self.io_out,
                    self.cpu_usages / self.running_time,
                    self.cpu_time,
                ),
            )
        )
Return ``str`` with the TSV representation of this record
Return ``str`` with the TSV representation of this record
Return ` ` str ` ` with the TSV representation of this record
def to_tsv(self):
        def to_tsv_str(x):
            if x is None:
                return "-"
            elif isinstance(x, float):
                return "{:.2f}".format(x)
            else:
                return str(x)
        def timedelta_to_str(x):
            mm, ss = divmod(x.seconds, 60)
            hh, mm = divmod(mm, 60)
            s = "%d:%02d:%02d" % (hh, mm, ss)
            if x.days:
                def plural(n):
                    return n, abs(n) != 1 and "s" or ""
                s = ("%d day%s, " % plural(x.days)) + s
            return s
        return "\t".join(
            map(
                to_tsv_str,
                (
                    "{:.4f}".format(self.running_time),
                    timedelta_to_str(datetime.timedelta(seconds=self.running_time)),
                    self.max_rss,
                    self.max_vms,
                    self.max_uss,
                    self.max_pss,
                    self.io_in,
                    self.io_out,
                    self.cpu_usages / self.running_time,
                    self.cpu_time,
                ),
            )
        )
def to_tsv ( self ) : def to_tsv_str ( x ) : """Conversion of value to str for TSV (None becomes "-")""" if x is None : return "-" elif isinstance ( x , float ) : return "{:.2f}" . format ( x ) else : return str ( x ) def timedelta_to_str ( x ) : """Conversion of timedelta to str without fractions of seconds""" mm , ss = divmod ( x . seconds , 60 ) hh , mm = divmod ( mm , 60 ) s = "%d:%02d:%02d" % ( hh , mm , ss ) if x . days : def plural ( n ) : return n , abs ( n ) != 1 and "s" or "" s = ( "%d day%s, " % plural ( x . days ) ) + s return s return "\t" . join ( map ( to_tsv_str , ( "{:.4f}" . format ( self . running_time ) , timedelta_to_str ( datetime . timedelta ( seconds = self . running_time ) ) , self . max_rss , self . max_vms , self . max_uss , self . max_pss , self . io_in , self . io_out , self . cpu_usages / self . running_time , self . cpu_time , ) , ) )
Return ``str`` with the TSV representation of this record
Return ` ` str ` ` with the TSV representation of this record
"""Return ``str`` with the TSV representation of this record""" """Conversion of value to str for TSV (None becomes "-")""" """Conversion of timedelta to str without fractions of seconds"""
self