diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py index b3ee7773d405c2203d3d10d6d772365f9bfc43ab..c4abbc8b0435b429e42bac72ba1d3c7948dfe8dc 100644 --- a/binarycpython/utils/functions.py +++ b/binarycpython/utils/functions.py @@ -42,21 +42,21 @@ import py_rinterpolate # Unsorted ######################################################## -def mem_use(self): +def mem_use(): """ Return current process memory use in MB. (Takes no arguments) Note: this is per-thread only. """ return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024.0 -def trem(dt,count,dn,n): +def trem(dt, count, dn, n): """ Estimate time remaining (seconds) given a differential time and count (i.e. progress = $count/$n). $dt is the time since the last call, $count is the current progress count, $dn is the number run since the last call, and $n is the total number required. """ tpr = dt / max(1,dn) etasecs = tpr * (n - count) - (eta,units) = conv_time_units(etasecs) - return (eta,units,tpr,etasecs) + (eta, units) = conv_time_units(etasecs) + return (eta, units, tpr, etasecs) def conv_time_units(t): """