Skip to content

Allow to specify CSS classes for Table.pformat - #4131

Merged
taldcroft merged 5 commits into
astropy:masterfrom
saimn:table-format
Oct 2, 2015
Merged

taldcroft merged 5 commits into
astropy:masterfrom
saimn:table-format

Conversation

@saimn

@saimn saimn commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

Currently it is possible to specify an ID when formatting a Table to HTML, this PR add a way to specify CSS classes which is more flexible and useful when integrating tables in an HTML page.

I have also updated several docstring in the pprint module. BTW the out dict stuff in the Table.pprint module is pretty weird: for instance show_length is not passed to _pformat_col but it is check in the out dict just after which seems quite useless.

@saimn

saimn commented Sep 28, 2015

Copy link
Copy Markdown
Contributor Author

@taldcroft just in case you have some time to take a look a this, it could be useful for the jsviewer in notebook feature (though I'm not sure I will have the time to finalize this quick enough).

Comment thread astropy/table/table.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the new tableclass=None to the end? I know it makes more sense here, but in theory someone could be calling pformat with all positional arguments and so this will be an API break.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@taldcroft taldcroft added this to the v1.1.0 milestone Oct 2, 2015
@taldcroft taldcroft self-assigned this Oct 2, 2015
@taldcroft

Copy link
Copy Markdown
Member

@saimn - sorry, things have been hectic and this fell off the radar. This generally looks good, and thanks for the docstring fixes.

One request is to generally try to avoid pure-formatting changes (which don't change the code at all) so that all the diffs are are related the new functionality. I know it's annoying if they show up red in your editor, but it makes reviewing easier. Then one can go with a separate PR to do PEP8 or other formatting improvements.

This just needs a changelog entry and could be good for merge. Not sure if it will be in time for 1.1 but we'll see.

@saimn

saimn commented Oct 2, 2015

Copy link
Copy Markdown
Contributor Author

@taldcroft no problem, I saw there is a lot of PRs to review this week ! I have added the changelog entry.

One request is to generally try to avoid pure-formatting changes (which don't change the code at all) so that all the diffs are are related the new functionality. I know it's annoying if they show up red in your editor, but it makes reviewing easier.

Ah yeah sorry, I can't help myself doing this, as you said it makes less noise in my editor which is also useful because a static checker sometimes helps to find non-initialized variables or other issues (typos in variable names typically). But I will try to avoid doing this or at least put the style changes in a separate commit.

Comment thread astropy/table/table.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be after align.

@taldcroft

Copy link
Copy Markdown
Member

OK, just a couple of minor non-code fixes. You can do these and [skip ci].

@saimn

saimn commented Oct 2, 2015

Copy link
Copy Markdown
Contributor Author

@taldcroft done.

taldcroft added a commit that referenced this pull request Oct 2, 2015
Allow to specify CSS classes for Table.pformat
@taldcroft
taldcroft merged commit a0c9913 into astropy:master Oct 2, 2015
@taldcroft

Copy link
Copy Markdown
Member

@embray - commit 391d006 has some documentation fixes that should go into 1.0.x. Let me know if there is anything I need to do or if you'll just cherry pick this.

@embray

embray commented Oct 2, 2015

Copy link
Copy Markdown
Member

@taldcroft If you want you can just cherry pick it and push directly to the branch; no big deal.

@saimn
saimn deleted the table-format branch October 2, 2015 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants