Skip to content
Snippets Groups Projects
Commit c3d2d2f7 authored by dh00601's avatar dh00601
Browse files

fixed error

parent 4daee010
No related branches found
No related tags found
No related merge requests found
...@@ -42,21 +42,21 @@ import py_rinterpolate ...@@ -42,21 +42,21 @@ import py_rinterpolate
# Unsorted # 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 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 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. 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) tpr = dt / max(1,dn)
etasecs = tpr * (n - count) etasecs = tpr * (n - count)
(eta,units) = conv_time_units(etasecs) (eta, units) = conv_time_units(etasecs)
return (eta,units,tpr,etasecs) return (eta, units, tpr, etasecs)
def conv_time_units(t): def conv_time_units(t):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment