Skip to content

adding Table.psave method#372

Closed
eteq wants to merge 1 commit into
astropy:masterfrom
eteq:table/add-psave
Closed

adding Table.psave method#372
eteq wants to merge 1 commit into
astropy:masterfrom
eteq:table/add-psave

Conversation

@eteq

@eteq eteq commented Sep 6, 2012

Copy link
Copy Markdown
Member

Note that this is not ready for merging immediately - it needs tests/docs/polish before merging/

The main thing this does is add a psave method to astropy.table.Table. This just generates text as the pformat and pprint functions do, and saves it to a file instead of the terminal.

The main question is whether or not this method should exist at all - @taldcroft and @astrofrog, in particular, may have some thoughts on this. This seems reasonable to me because it's simple enough to implement that I've already found myself doing it by hand semi-regularly, so a convinience method might make sense here. On the other hand, in principal that's what Table.write and the I/O framework for table is for, so this sort of duplicates some efforts.

Should I go ahead and flesh this out more, or do we not want such a thing in astropy.table right now?

@taldcroft

Copy link
Copy Markdown
Member

Maybe this could be done by registering a new Table.write method format fixed_width that connects to the io.ascii.FixedWidth writer. The only loss of functionality right now is not being able to show the units row. That would be a useful thing to add at the same time as doing the integration of io.ascii with Table. This is my plan for the October sprint.

@eteq

eteq commented Sep 6, 2012

Copy link
Copy Markdown
Member Author

@taldcroft - so are you saying you'd rather not have a distinct psave method in the API, and instead use the existing I/O framework? I definitely see the merit there (otherwise there are two different ways to save a table), but I just want to make sure I'm clear on this.

@taldcroft

Copy link
Copy Markdown
Member

Yes, I'd say the separate psave method is not needed.

@astrofrog

Copy link
Copy Markdown
Member

I agree that having psave and write would be confusing.

@eteq

eteq commented Sep 8, 2012

Copy link
Copy Markdown
Member Author

Alright, in that case I'll close this PR. I'll look forward to you putting in this functionality at the sprint, then :)

@eteq eteq closed this Sep 8, 2012
astrofrog added a commit to astrofrog/astropy that referenced this pull request Jun 12, 2019
Fix compatibility with the latest versions of setuptools
jeffjennings pushed a commit to jeffjennings/astropy that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants