--cols-file in fits importer#27
Conversation
| dtype = table.dtype.fields[name][0] | ||
| setcols[name] = (dtype, dtype.type(val)) | ||
|
|
||
| # Slurp the columns from file |
There was a problem hiding this comment.
This block of text is taken from the text importer.
| parser.add_argument('table', help='Name of the table into which to import', type=str) | ||
| parser.add_argument('file', help='One or more fits files. If ending in .gz or .bz2, they are assumed to be compressed.', type=str, nargs='+') | ||
| parser.add_argument('-c', '--cols', help='Comma separated list of <colname>:<file_column>, where <file_column> is the name of the column in the FITS file that is to be loaded into <colname>.', type=str) | ||
| parser.add_argument('--cols-file', help='A file with two, whitespace delimited columns, <colname> <file_column>, having the same meaning as arguments to --cols', type=str) |
There was a problem hiding this comment.
This is taken from the text importer as well. I think this line contains a tab, which will have to be converted to spaces.
| except ValueError: | ||
| dbname = fitsname = spec[0] | ||
| if dbname not in table.dtype.names: | ||
| raise Exception("Unknown column '%s' in table %s" % (dbname, args.table)) |
There was a problem hiding this comment.
There was a bug here previously, with dbname incorrectly shortened to the non-existent variable name.
|
I hate to ask this, but for consistency with the rest of the codebase (and to make the diff more readable) could you switch spaces back to tabs? There's a unix command PS: Which editor do you use? |
|
I use vim. It's kind of a pain to switch it to use tabs. As I'm making changes to the code base, I'm using |
|
I've been trying to make the diffs more readable by doing |
This pull request adds the ability to specify
--cols-filewithlsd-import fits. It also fixes a bug that used to occur when a database column name was not recognized.I had to convert tabs to spaces in order to edit this file, because my text editor wouldn't allow me to write tabs, so that complicates reading the diff.