atpy/atpy — pull request #50 by ChrisBeaumont (2012-08-24 16:58:25+00:00)
Title: common ascii extensions registered with asciitable

I wonder if it would be possible to incorporate something like the following into atpy. The two problems I'm trying to address:

1) As far as I can tell, I always have to specify `type='ascii'` to `Table.read()` to invoke asciitable. File formats like csv, tsv, and txt seem like good fits to dispatch to asciitable automatically.

2) When it isn't clear what table reader to use, I've changed the exception type from Exception to TypeError.

The use case for these changes is in projects like glue, where atpy is embedded somewhere where its harder for a user to pass custom keyword parameters. Change 1) makes it less likely that Table.read needs any information beyond the filename, and point 2) makes it easier to recover from file extension errors.

Perhaps these ideas should be fleshed out before merging (i.e. should more extensions be registered with asciitable by default, and should more exception types in registry.py be changed?)