Closed eleonorazari closed 3 years ago
What version for Astropy?
On Wed, Jan 20, 2021 at 8:47 AM Eleonora notifications@github.com wrote:
Hi Jon,
Copying. I am using python v. 3.7.4.
Cheers, Eleonora
ValueError Traceback (most recent call last) in ----> 1 import ppv.fiveplates
~/ppv/src/ppv/fiveplates.py in 15 from . import config 16 from .process import simulate_platedesign ---> 17 from .parse_platedata import main_platedata 18 import numpy as np 19 from astropy import units as u
~/ppv/src/ppv/parse_platedata.py in 13 pruns_to_parse = list(pruns_to_parse_path.keys()) 14 ---> 15 platedata_tables = [io.load_fp_platedata(prun) for prun 16 in pruns_to_parse] 17
~/ppv/src/ppv/parse_platedata.py in (.0) 13 pruns_to_parse = list(pruns_to_parse_path.keys()) 14 ---> 15 platedata_tables = [io.load_fp_platedata(prun) for prun 16 in pruns_to_parse] 17
~/ppv/src/ppv/data/io.py in load_fp_platedata(platerun, **table_kwds) 127 pd_colnames_lower = [col.lower() for col in pd_table.colnames] 128 if 'platerun' in pd_colnames_lower: --> 129 pd_table.rename_columns(pd_table.colnames, _pd_standard_colnames + ['platerun']) 130 else: # need to add platerun 131 pd_table.rename_columns(pd_table.colnames, _pd_standard_colnames + ['notes'])
~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/table/table.py in rename_columns(self, names, new_names) 2626 2627 if len(names) != len(new_names): -> 2628 raise ValueError("input 'names' and 'new_names' list arguments must be the same length") 2629 2630 for name, new_name in zip(names, new_names):
ValueError: input 'names' and 'new_names' list arguments must be the same length
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jcbird/ppv/issues/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRADE72LKZAZU5PZ5XXKBLS23UHTANCNFSM4WKZEBFQ .
--
Jonathan Bird Stevenson Postdoctoral Fellow Department of Physics and Astronomy, Vanderbilt University
Sorry, the python version for ppv is 3.8.6, and astropy version 4.1.
Thanks. Have you pulled the latest commit of BOTH ppv AND five_plates? There was a change in the format of a critical five_plates file that I think is causing this error.
Try a git pull in both directories. Restart your python environment. That should work. If it doesn't work for any reason, type git log
in both the PPV and five_plates directories and copy the top line that says commit .....
and paste them here.
Yes, I did! I will try another time - will let you know!
git log in ppv:
commit 433f5e0cf4ff601e6dfef8db022c616b2b676bd3 (HEAD -> master, origin/master, origin/HEAD) Author: jcbird jonathan.bird.io@gmail.com Date: Fri Jan 15 10:02:19 2021 -0600
parse new format of description file
And this is git log in five plates:
commit 0b367c1423305612a020b974a8d844cb65ab1482 (HEAD -> master, origin/master, origin/HEAD) Author: Felipe Santana Rojas 67760942+fsantanar@users.noreply.github.com Date: Tue Jan 19 18:50:49 2021 -0300
Add files via upload
Thanks! I am going to email you a short script that will output some debugging info. Can you just run it with 'python test_ppv_parse.py' from the command line and paste the output here?
Yes, of course! Do I need to run it in a specific directory? (and I guess within the ppv environment, right?)
Doesn't matter what directory and yes, definitely within your ppv environment. Thanks!
This is the output:
WARNING: VerifyWarning: Keyword name '@insert_new_runs_here' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card] SDSS-V platePlans table written to /home/zari/Documents/SDSS_Data/Plates/platePlans_sdss5.fits Number of Columns [17, 17] ['MWM_02', '2020.10.y.mwm-bhm', 'BHM_01', 'BHM_03', '2020.10.x.mwm-bhm', '2020.09.x.bhm-mwm', '2020.09.y.bhm-mwm', '2020.08.x.bhm-mwm', 'BHM_07', 'BHM_05', 'MWM_04']
Output 2:
WARNING: VerifyWarning: Keyword name '@insert_new_runs_here' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card] SDSS-V platePlans table written to /home/zari/Documents/SDSS_Data/Plates/platePlans_sdss5.fits
{'MWM_02': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/MWM_02/plate_data_MWM_02_initial.txt'), '2020.09.x.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.09.x.bhm-mwm/plate_data_2020.09.x.bhm-mwm.txt'), 'BHM_03': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_03/plate_data_BHM_03_final.txt'), '2020.10.x.mwm-bhm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.10.x.mwm-bhm/plate_data_2020.10.x.mwm-bhm.txt'), '2020.09.y.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.09.y.bhm-mwm/plate_data_2020.09.y.bhm-mwm.txt'), 'MWM_04': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/MWM_04/plate_data_MWM_04_initial.txt'), '2020.10.y.mwm-bhm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.10.y.mwm-bhm/plate_data_2020.10.y.mwm-bhm.txt'), 'BHM_01': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_01/plate_data_BHM_01.txt'), 'BHM_05': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_05/plate_data_BHM_05_initial.txt'), 'BHM_07': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_07/plate_data_BHM_07_initial.txt'), '2020.08.x.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.08.x.bhm-mwm/plate_data_2020.08.x.bhm-mwm.txt')}
Thanks again. I'll send an email, but pull the latest commit; that should fix things!
Output 2:
WARNING: VerifyWarning: Keyword name '@insert_new_runs_here' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card] SDSS-V platePlans table written to /home/zari/Documents/SDSS_Data/Plates/platePlans_sdss5.fits
{'MWM_02': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/MWM_02/plate_data_MWM_02_initial.txt'), '2020.09.x.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.09.x.bhm-mwm/plate_data_2020.09.x.bhm-mwm.txt'), 'BHM_03': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_03/plate_data_BHM_03_final.txt'), '2020.10.x.mwm-bhm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.10.x.mwm-bhm/plate_data_2020.10.x.mwm-bhm.txt'), '2020.09.y.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.09.y.bhm-mwm/plate_data_2020.09.y.bhm-mwm.txt'), 'MWM_04': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/MWM_04/plate_data_MWM_04_initial.txt'), '2020.10.y.mwm-bhm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.10.y.mwm-bhm/plate_data_2020.10.y.mwm-bhm.txt'), 'BHM_01': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_01/plate_data_BHM_01.txt'), 'BHM_05': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_05/plate_data_BHM_05_initial.txt'), 'BHM_07': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/BHM_07/plate_data_BHM_07_initial.txt'), '2020.08.x.bhm-mwm': PosixPath('/home/zari/Documents/SDSS_Data/five_plates/plateruns/2020.08.x.bhm-mwm/plate_data_2020.08.x.bhm-mwm.txt')}
Hi Jon,
Copying. I am using python v. 3.7.4.
Cheers, Eleonora
ValueError Traceback (most recent call last) in ----> 1 import ppv.fiveplates
~/ppv/src/ppv/fiveplates.py in 15 from . import config 16 from .process import simulate_platedesign ---> 17 from .parse_platedata import main_platedata 18 import numpy as np 19 from astropy import units as u
~/ppv/src/ppv/parse_platedata.py in 13 pruns_to_parse = list(pruns_to_parse_path.keys()) 14 ---> 15 platedata_tables = [io.load_fp_platedata(prun) for prun 16 in pruns_to_parse] 17
~/ppv/src/ppv/parse_platedata.py in (.0) 13 pruns_to_parse = list(pruns_to_parse_path.keys()) 14 ---> 15 platedata_tables = [io.load_fp_platedata(prun) for prun 16 in pruns_to_parse] 17
~/ppv/src/ppv/data/io.py in load_fp_platedata(platerun, **table_kwds) 127 pd_colnames_lower = [col.lower() for col in pd_table.colnames] 128 if 'platerun' in pd_colnames_lower: --> 129 pd_table.rename_columns(pd_table.colnames, _pd_standard_colnames + ['platerun']) 130 else: # need to add platerun 131 pd_table.rename_columns(pd_table.colnames, _pd_standard_colnames + ['notes'])
~/anaconda3/envs/ppv/lib/python3.8/site-packages/astropy/table/table.py in rename_columns(self, names, new_names) 2626 2627 if len(names) != len(new_names): -> 2628 raise ValueError("input 'names' and 'new_names' list arguments must be the same length") 2629 2630 for name, new_name in zip(names, new_names):
ValueError: input 'names' and 'new_names' list arguments must be the same length