jcbird / ppv

Tools for dealing with SDSS-V plate files and plate runs.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Can't get five_plates platerun on 2020.09.y.bhm-mwm #12

Closed deleenm closed 3 years ago

deleenm commented 3 years ago

Hi @jcbird,

I tried loading the 2020.09.y.bhm-mwm platerun using the five_plates method in ppv, and I am getting astropy table errors:

#Define a platerun 
platerun_09y = ppv.fiveplates.Platerun('2020.09.y.bhm-mwm')

I don't know if this should be an issue in five_plates, but I figured I would start here. I know that 2020.10.x.mwm-bhm works just fine.

Nathan

Here are the errors:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in _guess(table, read_kwargs, format, fast_reader)
    463             reader = get_reader(**read_kwargs)
--> 464             dat = reader.read(table)
    465             _read_trace.append({'kwargs': copy.deepcopy(read_kwargs),

~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/basic.py in read(self, table)
    153         """
--> 154         out = super().read(table)
    155 

~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/core.py in read(self, table)
   1173         # Get the table column definitions
-> 1174         self.header.get_cols(self.lines)
   1175 

~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/core.py in get_cols(self, lines)
    587             else:  # No header line matching
--> 588                 raise ValueError('No header line found in table')
    589 

ValueError: No header line found in table

During handling of the above exception, another exception occurred:

InconsistentTableError                    Traceback (most recent call last)
<ipython-input-7-e0f7972ae5eb> in <module>
      1 #Define a platerun
----> 2 platerun_09y = ppv.fiveplates.Platerun('2020.09.y.bhm-mwm')

~/anaconda3/envs/ppv/lib/python3.8/site-packages/ppv-0.36-py3.8.egg/ppv/fiveplates.py in __init__(self, run_name)
    183             pass  # all is well, platerun available
    184         self.name = run_name
--> 185         self.platesummary = io.load_fiveplates_summary(run_name)
    186         self.fieldnames = self._get_fields()
    187 

~/anaconda3/envs/ppv/lib/python3.8/site-packages/ppv-0.36-py3.8.egg/ppv/data/io.py in load_fiveplates_summary(platerun)
     73     else:
     74         raise FileNotFoundError(os.fspath(summary_file))
---> 75     return ascii.read(os.fspath(summary_file), header_start=1,
     76                       format='commented_header')
     77 

~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in read(table, guess, **kwargs)
    285         # through below to the non-guess way so that any problems result in a
    286         # more useful traceback.
--> 287         dat = _guess(table, new_kwargs, format, fast_reader)
    288         if dat is None:
    289             guess = False

~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in _guess(table, read_kwargs, format, fast_reader)
    494                    '************************************************************************']
    495             lines.extend(msg)
--> 496             raise core.InconsistentTableError('\n'.join(lines))
    497 
    498 

InconsistentTableError: 
ERROR: Unable to guess table format with the guesses listed below:
Reader:FastCommentedHeader fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1
Reader:CommentedHeader delimiter: '|' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'
Reader:CommentedHeader delimiter: '|' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"
Reader:CommentedHeader delimiter: ',' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'
Reader:CommentedHeader delimiter: ',' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"
Reader:CommentedHeader delimiter: ' ' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'
Reader:CommentedHeader delimiter: ' ' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"
Reader:CommentedHeader delimiter: '\\s' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'
Reader:CommentedHeader delimiter: '\\s' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"
Reader:CommentedHeader fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1

************************************************************************
** ERROR: Unable to guess table format with the guesses listed above. **
**                                                                    **
** To figure out why the table did not read, use guess=False and      **
** fast_reader=False, along with any appropriate arguments to read(). **
** In particular specify the format and any known attributes like the **
** delimiter.                                                         **
************************************************************************
jcbird commented 3 years ago

Argh. I should be able to fix this today in the afternoon when I have a second.

Thanks for sending the error messages.

On Fri, Nov 6, 2020 at 8:18 PM Nathan De Lee notifications@github.com wrote:

Hi @jcbird https://github.com/jcbird,

I tried loading the 2020.09.y.bhm-mwm platerun using the five_plates method in ppv, and I am getting astropy table errors:

Define a platerun platerun_09y = ppv.fiveplates.Platerun('2020.09.y.bhm-mwm')

I don't know if this should be an issue in five_plates, but I figured I would start here. I know that 2020.10.x.mwm-bhm works just fine.

Nathan

Here are the errors:

---------------------------------------------------------------------------ValueError Traceback (most recent call last)~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in _guess(table, read_kwargs, format, fast_reader) 463 reader = get_reader(read_kwargs)--> 464 dat = reader.read(table) 465 _read_trace.append({'kwargs': copy.deepcopy(read_kwargs), ~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/basic.py in read(self, table) 153 """--> 154 out = super().read(table) 155 ~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/core.py in read(self, table) 1173 # Get the table column definitions-> 1174 self.header.get_cols(self.lines) 1175 ~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/core.py in get_cols(self, lines) 587 else: # No header line matching--> 588 raise ValueError('No header line found in table') 589 ValueError: No header line found in tableDuring handling of the above exception, another exception occurred:InconsistentTableError Traceback (most recent call last) in 1 #Define a platerun----> 2 platerun_09y = ppv.fiveplates.Platerun('2020.09.y.bhm-mwm')~/anaconda3/envs/ppv/lib/python3.8/site-packages/ppv-0.36-py3.8.egg/ppv/fiveplates.py in init(self, run_name) 183 pass # all is well, platerun available 184 self.name = run_name--> 185 self.platesummary = io.load_fiveplates_summary(run_name) 186 self.fieldnames = self._get_fields() 187 ~/anaconda3/envs/ppv/lib/python3.8/site-packages/ppv-0.36-py3.8.egg/ppv/data/io.py in load_fiveplates_summary(platerun) 73 else: 74 raise FileNotFoundError(os.fspath(summary_file))---> 75 return ascii.read(os.fspath(summary_file), header_start=1, 76 format='commented_header') 77 ~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in read(table, guess, kwargs) 285 # through below to the non-guess way so that any problems result in a 286 # more useful traceback.--> 287 dat = _guess(table, new_kwargs, format, fast_reader) 288 if dat is None: 289 guess = False~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/io/ascii/ui.py in _guess(table, read_kwargs, format, fast_reader) 494 '****'] 495 lines.extend(msg)--> 496 raise core.InconsistentTableError('\n'.join(lines)) 497 498 InconsistentTableError: ERROR: Unable to guess table format with the guesses listed below:Reader:FastCommentedHeader fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1Reader:CommentedHeader delimiter: '|' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'Reader:CommentedHeader delimiter: '|' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"Reader:CommentedHeader delimiter: ',' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'Reader:CommentedHeader delimiter: ',' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"Reader:CommentedHeader delimiter: ' ' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'Reader:CommentedHeader delimiter: ' ' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"Reader:CommentedHeader delimiter: '\s' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: '"'Reader:CommentedHeader delimiter: '\s' fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 quotechar: "'"Reader:CommentedHeader fast_reader: {'enable': True} fill_values: [('', '0')] header_start: 1 ** ERROR: Unable to guess table format with the guesses listed above. To figure out why the table did not read, use guess=False and fast_reader=False, along with any appropriate arguments to read(). In particular specify the format and any known attributes like the delimiter. **

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jcbird/ppv/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRADEZMYK4HNDTE4DDT633SOSVANANCNFSM4TNLEWIA .

--

Jonathan Bird Stevenson Postdoctoral Fellow Department of Physics and Astronomy, Vanderbilt University

jcbird commented 3 years ago

Hi Nathan. I am not getting these errors.

Can you

pull down the latest commit from ppv, then run

python setup.py install

in the ppv root directory, and retry! Sorry to take so long to get back to you on this.

deleenm commented 3 years ago

Hi jon,

Weird, I am still getting the error. Is your five_plates up to date?

Nathan

deleenm commented 3 years ago

Hi Jon,

Is it possible that you are processing the .summary file instead of the plate_data file? The summary file has notes in it, which I know have caused issues in the past (the notes have spaces in them).

Nathan

jcbird commented 3 years ago

@deleenm , it seems that you are using an old commit of ppv. The constructor for fiveplates.Platerun reads:

https://github.com/jcbird/ppv/blob/04671ac9ac676d0c104d8970534d0a2bb4100746/src/ppv/fiveplates.py#L390-L402

There is no longer any call to io.load_fiveplates_summary(run_name) as in your error messages. Check your local version of ppv and specifically the fiveplates.Platerun code and make sure it matchs the repo (or do a git pull). Then reinstall ppv!

deleenm commented 3 years ago

Okay, it is working now. I didn't have to do a new git pull. I just tried running setup.py install again, and that seems to have done the trick. Thanks!