Skip to content

Commit

Permalink
minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryokbys committed Nov 8, 2023
1 parent cda0708 commit bf40c9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions nappy/msd2diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
--out4fp-name OUTNAME
File name for --out4fp. [default: data.pmd.D]
"""
from __future__ import print_function

import os,sys
from docopt import docopt
import numpy as np
Expand Down Expand Up @@ -139,14 +137,12 @@ def main():
from datetime import datetime
with open(out4fpname,'w') as f:
f.write(gen_header(sys.argv))
f.write('# datatype: independent\n')
f.write('#\n')
ndat = len(Ds)
f.write(f' {ndat:d} 1.0\n')
for i,D in enumerate(Ds):
f.write(f' {D:12.4e}')
if (i+1) % 6 == 0:
f.write('\n')
f.write('\n')
f.write(f' {D:12.4e} {D:12.4e}\n')

if plot:
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion nappy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from __future__ import print_function

import os,sys
from datetime import datetime
from docopt import docopt
import numpy as np

Expand Down Expand Up @@ -121,6 +120,7 @@ def gen_header(argv):
Generate header that contains command line itself and datetime string.
ARGV is usually 'sys.argv'.
"""
from datetime import datetime
tnow = datetime.now()
dstr = tnow.strftime('%Y-%m-%d %H:%M:%S')
header = '# Generated at {0:s} \n'.format(dstr)
Expand Down

0 comments on commit bf40c9f

Please sign in to comment.