Star class - output directory not present
grd349 opened this issue · 3 comments
grd349 commented
When running
star.run_asy_peakbag(norders=6)
I get the following error:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<timed eval> in <module>()
~/Code/PBjam/pbjam/star.py in run_asy_peakbag(self, norders, make_plots, store_chains, nthreads)
147 outpath = lambda x: os.path.join(*[self.path, x])
148 self.asy_fit.summary.to_csv(outpath(f'asy_fit_summary_{self.ID}.csv'),
--> 149 index=True)
150 self.asy_fit.modeID.to_csv(outpath(f'asy_fit_modeID_{self.ID}.csv'),
151 index=False)
~/.local/lib/python3.6/site-packages/pandas/core/generic.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, date_format, doublequote, escapechar, decimal)
3226 decimal=decimal,
3227 )
-> 3228 formatter.save()
3229
3230 if path_or_buf is None:
~/.local/lib/python3.6/site-packages/pandas/io/formats/csvs.py in save(self)
181 self.mode,
182 encoding=self.encoding,
--> 183 compression=self.compression,
184 )
185 close = True
~/.local/lib/python3.6/site-packages/pandas/io/common.py in _get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text)
397 if encoding:
398 # Encoding
--> 399 f = open(path_or_buf, mode, encoding=encoding, newline="")
400 elif is_text:
401 # No explicit encoding
FileNotFoundError: [Errno 2] No such file or directory: '/home/davies/Projects/pb-tess/Guy/167548586/asy_fit_summary_167548586.csv'
I think we need a directory creation step to prevent this error.
grd349 commented
And also for
star.run_peakbag()
nielsenmb commented
I had a similar issue occur just a few days ago.
It's unclear why this hasn't happened before, but I've fixed it in my fork.
I'll merge it in a few minutes.
…On Wed, 13 Nov 2019 at 16:18, Guy Davies ***@***.***> wrote:
And I also for
star.run_peakbag()
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#185?email_source=notifications&email_token=AEJWO35S7MUNRCH4QO4KXBLQTQSEHA5CNFSM4JM5VNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED6V45A#issuecomment-553475700>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEJWO34KA5G2DNEGG4DW3HTQTQSEHANCNFSM4JM5VNQQ>
.
grd349 commented
Excellent work! :)