mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Fix filename formatter to be actually helpful.
This commit is contained in:
parent
b168a2431e
commit
3714e2b170
11
main.py
11
main.py
@ -29,11 +29,14 @@ from cuburn.code.mwc import MWCTest
|
|||||||
np.set_printoptions(precision=5, edgeitems=20)
|
np.set_printoptions(precision=5, edgeitems=20)
|
||||||
|
|
||||||
def fmt_time(time):
|
def fmt_time(time):
|
||||||
# Stupid precision modifier garbage
|
# Format time in a lexically-ordered way that doesn't interfere with the
|
||||||
frac = np.round((time - np.floor(time)) * 1000)
|
# typical case of ascending natural numbers
|
||||||
|
atime = abs(time)
|
||||||
|
dcml = ('-' if time < 0 else '') + ('%05d' % np.floor(atime))
|
||||||
|
frac = np.round((atime - np.floor(atime)) * 1000)
|
||||||
if frac:
|
if frac:
|
||||||
return '%05d.%03d' % (np.floor(time), frac)
|
return '%s_%03d' % (dcml, frac)
|
||||||
return '%05d' % time
|
return dcml
|
||||||
|
|
||||||
def save(args, time, raw):
|
def save(args, time, raw):
|
||||||
name = os.path.join(args.dir, '%s_%s' % (args.name, fmt_time(time)))
|
name = os.path.join(args.dir, '%s_%s' % (args.name, fmt_time(time)))
|
||||||
|
Loading…
Reference in New Issue
Block a user