* Added some useful functions from my pw2g_bench_MnO.py scriptlet collection:
- wpylib.math.roundup() - wpylib.shell_tools.dirname2() * file_exists_nonempty() is moved to wpylib.shell_tools.
This commit is contained in:
@@ -42,3 +42,10 @@ def epsilon(dtype):
|
||||
small2 = small
|
||||
small = dtype(small / 2)
|
||||
return small2
|
||||
|
||||
|
||||
def roundup(value, unit):
|
||||
"""Rounds up a value to the next integer multiple of a unit."""
|
||||
return numpy.ceil(float(value) / float(unit)) * unit
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user