question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

writing a basic ascii table from QTable is broken

See original GitHub issue
from astropy.table import QTable,Column
import astropy.units as u
q = QTable()
q['dt'] = [1,2,3]*u.s
q.write('foo.txt',format='ascii.no_header',delimiter=',',formats={'dt':'%.18f'})

The write call throws an exception with “Quantity object has no name member”

If I look in _set_col_formats in io/ascii/core.py it says

if col.info.name in self.formats:
   col.info.format = self.formats[col.name]

That second line probably should say “col.info.name” instead. A similar change would need to be made in the fast writer

EDIT: Syntax highlighting

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
taldcroftcommented, May 9, 2019

I can also probably make a quick fix if @mcbeth does not have time.

1reaction
mcbethcommented, May 9, 2019

On Thu, May 09, 2019 at 07:21:56AM -0700, P. L. Lim wrote:

From your Slack message, you said this exact code used to work in Astropy 1.2.4? If not, please provide the snippet that worked in Astropy 1.2.4. Thanks.

Yes, that exact code worked on 1.2.4

Jeff

– “The man who does not read good books has no advantage over the man who cannot read them.” – not Mark Twain, maybe a southen librarian in 1910

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table Operations — Astropy v5.2
Aggregation is the process of applying a specified reduction function to the values within each group for each non-key column. This function must...
Read more >
qt showing non-latin special characters in QTableWidgetItem
I am attempting to show some chess pieces in a QTableWidget through a QTableWidgetItem but when i do i do not get the...
Read more >
QTableWidget Class | Qt Widgets 6.4.1
Sets the given widget to be displayed in the cell in the given row and column, passing the ownership of the widget to...
Read more >
Create an ASCII art table from tabular data
I've tried troff -based solutions and while the simple demos have worked, feeding the command actual input has resulted in bizarre errors. I've ......
Read more >
libjpeg.doc - Apple Open Source
The file example.c provides heavily commented skeleton code for calling the JPEG library. Also see jpeglib.h (the include file to be used by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found