You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unified file read/write interface: binary votable format #7352
Hmm, looks like a bug in unified I/O connector. Documentation stated it is supported but the registry throws error. I am glad you have a workaround. Thanks for reporting this!
astropy.io.registry.IORegistryError: No writer defined for format 'binary' and class 'Table'.
Actually, I need some clarification. Maybe this is not a bug after all but wrong usage due to lack of documentation. I failed to reproduce the error you reported. These both worked for me using Astropy 3.1.dev21672.
So it looks like a pilot PICNIC error although giving an explicit example for binary and binary2 since I think the default is ASCII which for large datasets is too bulky.
@bsipocz , unfortunately, not quite... The listing below does not provide all the options that are possible (e.g., tabledata_format). @taldcroft , any advice?
In [1]: importastropyIn [2]: astropy.__version__Out[2]: '3.2'In [3]: fromastropy.tableimportTableIn [4]: Table.read.help('votable')
==========================================
Table.read(format='votable') documentation
==========================================
Read a Table object from an VO table file
Parameters
----------
input : str or `~astropy.io.votable.tree.VOTableFile` or `~astropy.io.votable.tr
ee.Table`
If a string, the filename to read the table from. If a
:class:`~astropy.io.votable.tree.VOTableFile` or
:class:`~astropy.io.votable.tree.Table` object, the object to extract
the table from.
table_id : str or int, optional
The table to read in. If a `str`, it is an ID corresponding
to the ID of the table in the file (not all VOTable files
assign IDs to their tables). If an `int`, it is the index of
the table in the file, starting at 0.
use_names_over_ids : bool, optional
When `True` use the ``name`` attributes of columns as the names
of columns in the `~astropy.table.Table` instance. Since names
are not guaranteed to be unique, this may cause some columns
to be renamed by appending numbers to the end. Otherwise
(default), use the ID attributes as the column names.
>>> Table.write.help('votable')
===========================================
Table.write(format='votable') documentation
===========================================
Write a Table object to an VO table file
Parameters
----------
input : Table
The table to write out.
output : str
The filename to write the table to.
table_id : str, optional
The table ID to use. If this is not specified, the 'ID' keyword in the
``meta`` object of the table will be used.
overwrite : bool, optional
Whether to overwrite any existing file without warning.
tabledata_format : str, optional
The format of table data to write. Must be one of ``tabledata``
(text representation), ``binary`` or ``binary2``. Default is
``tabledata``. See :ref:`votable-serialization`.
Activity
pllim commentedon Apr 5, 2018
It is unfortunate that https://github.com/astropy/astropy/blob/master/astropy/io/votable/connect.py#L136 is not exposed in user documentation. Does
'binary'or'binary2'work for you?richardgmcmahon commentedon Apr 5, 2018
Thanks,
format = 'binary' gives the error:
astropy.io.registry.IORegistryError: No writer defined for format 'binary' and class 'Table'.
I am using astropy 2.0.2 and 2.0.5
Meanwhile I used the io.votable.to do it:
This could be a useful example for io.votable.
pllim commentedon Apr 6, 2018
Hmm, looks like a bug in unified I/O connector. Documentation stated it is supported but the registry throws error. I am glad you have a workaround. Thanks for reporting this!
pllim commentedon Apr 6, 2018
Actually, I need some clarification. Maybe this is not a bug after all but wrong usage due to lack of documentation. I failed to reproduce the error you reported. These both worked for me using Astropy 3.1.dev21672.
richardgmcmahon commentedon Apr 6, 2018
OK, it works for me too using:
format='votable', tabledata_format='binary'
So it looks like a pilot PICNIC error although giving an explicit example for binary and binary2 since I think the default is ASCII which for large datasets is too bulky.
pllim commentedon Apr 6, 2018
Perhaps the doc update can be a part of work for #1011
bsipocz commentedon Jun 18, 2019
@pllim - would you think the new helps for the unified io addresses this issue, too? If yes, please close this.
#8255
pllim commentedon Jun 19, 2019
@bsipocz , unfortunately, not quite... The listing below does not provide all the options that are possible (e.g.,
tabledata_format). @taldcroft , any advice?taldcroft commentedon Jun 19, 2019
@pllim - you need to check the write help. 😸
pllim commentedon Jun 19, 2019
Ops!!! Thanks for pointing that out, @taldcroft !