Skip to content

Commit

Permalink
Prepare next release: some minor/cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavoiu committed Aug 1, 2018
1 parent 9c8fb0d commit 0791965
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
15 changes: 8 additions & 7 deletions kafe/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def do_fit(self, quiet=False, verbose=False):

self.out_stream.flush() # write to output files


def print_raw_results(self):
'''
unformatted print-out of all fit results
Expand Down Expand Up @@ -1428,14 +1428,15 @@ def plot_correlations(self):
return cor_fig

def close(self):
# close output file(s)
'''close output file(s)'''
self.out_stream.close()
print('closing files')


def __del__(self):
# close output file(s)
self.out_stream.close()
print('destructor class Fit: closing files')
'''destructor: close output file(s)'''
# check needed in case the constructor throws
if hasattr(self, 'out_stream'):
self.out_stream.close()


class GaussianConstraint(object):
'''
Expand Down
16 changes: 9 additions & 7 deletions kafe/multifit.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def do_fit(self, quiet=False, verbose=False):

self.out_stream.flush() # write to output files


# Private Methods
##################

Expand Down Expand Up @@ -1402,15 +1402,17 @@ def plot_correlations(self, function=None):
i, j, dchi2=[1., 2.3], axes=axarr[jp, ip])
return cor_fig


def close(self):
# close output file(s)
'''close output file(s)'''
self.out_stream.close()
print('closing files')


def __del__(self):
# close output file(s)
self.out_stream.close()
print('destructor class Fit: closing files')
'''destructor: close output file(s)'''
# check needed in case the constructor throws
if hasattr(self, 'out_stream'):
self.out_stream.close()



class _ParameterSpace(object):
Expand Down
6 changes: 3 additions & 3 deletions kafe/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def __init__(self, out_file, suppress_stdout=False):
try:
file_like.write("")
except AttributeError:
# self.out_file.append(open(file_like, 'a'))
#one-line buffe enforces output
self.out_file.append(open(file_like, 'a'))
# one-line buffer enforces output
#self.out_file.append(open(file_like, 'a'))
self.out_file.append(open(file_like, 'a', 1))
else:
self.out_file.append(file_like)
self.closed = False
Expand Down

0 comments on commit 0791965

Please sign in to comment.