Now the database is displayed as an astropy table #1871

Merged
merged 17 commits into from Aug 31, 2016

Conversation

Projects
None yet
4 participants
@Punyaslok
Member

Punyaslok commented Aug 8, 2016

sunpy/database/database.py
@@ -954,6 +955,14 @@ def redo(self, n=1):
"""
self._command_manager.redo(n) # pragma: no cover
+ def display_entries(self, columns=None, sort=False):
+ print display_entries(self, columns, sort)

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

print()

@Cadair

Cadair Aug 8, 2016

Member

print()

sunpy/database/database.py
+ print display_entries(self, columns, sort)
+ return
+
+ def show_in_browser(self, columns=None, sort=False):

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

you should expose the jsviewer kwarg in the method definition so users can change it.

@Cadair

Cadair Aug 8, 2016

Member

you should expose the jsviewer kwarg in the method definition so users can change it.

sunpy/database/database.py
+
+ def show_in_browser(self, columns=None, sort=False):
+ display_entries(self, columns, sort).show_in_browser(jsviewer=True)
+ return

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

you don't need the return

@Cadair

Cadair Aug 8, 2016

Member

you don't need the return

sunpy/database/tables.py
+ If True, sorts the entries before displaying them.
+
+ """
+ print (create_display_table(database_entries, columns, sort))

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

style: no space before (

@Cadair

Cadair Aug 8, 2016

Member

style: no space before (

sunpy/database/database.py
@@ -954,6 +955,13 @@ def redo(self, n=1):
"""
self._command_manager.redo(n) # pragma: no cover
+ def display_entries(self, columns=None, sort=False):
+ print (create_display_table(self, columns, sort))

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

style: no space before (

@Cadair

Cadair Aug 8, 2016

Member

style: no space before (

sunpy/database/database.py
+ print (create_display_table(self, columns, sort))
+
+ def show_in_browser(self, columns=None, sort=False, **kwargs):
+ jsviewer = kwargs.get('jsviewer', True)

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

just put it in the def line:
def show_in_browser(self, columns=None, sort=False, jsviewer=True)

@Cadair

Cadair Aug 8, 2016

Member

just put it in the def line:
def show_in_browser(self, columns=None, sort=False, jsviewer=True)

sunpy/database/tables.py
@@ -10,6 +10,7 @@
import os
from astropy.units import Unit, nm, equivalencies
+import astropy

This comment has been minimized.

@Cadair

Cadair Aug 8, 2016

Member

import astropy.table ??

@Cadair

Cadair Aug 8, 2016

Member

import astropy.table ??

@Cadair

This comment has been minimized.

Show comment
Hide comment
@Cadair

Cadair Aug 16, 2016

Member

👍

Member

Cadair commented Aug 16, 2016

👍

sunpy/database/tables.py
@@ -594,7 +595,7 @@ def entries_from_dir(fitsdir, recursive=False, pattern='*',
break
-def display_entries(database_entries, columns, sort=False):
+def create_display_table(database_entries, columns=None, sort=False):

This comment has been minimized.

@Cadair

Cadair Aug 16, 2016

Member

it might be worth making this 'private' i.e. starting it with an _

@Cadair

Cadair Aug 16, 2016

Member

it might be worth making this 'private' i.e. starting it with an _

Punyaslok added some commits Aug 19, 2016

@Cadair

This comment has been minimized.

Show comment
Hide comment
@Cadair

Cadair Aug 31, 2016

Member

can you add a changelog entry please?

Member

Cadair commented Aug 31, 2016

can you add a changelog entry please?

@wafels

This comment has been minimized.

Show comment
Hide comment
@wafels

wafels Aug 31, 2016

Member

+1

Member

wafels commented Aug 31, 2016

+1

@dpshelio

This comment has been minimized.

Show comment
Hide comment
@dpshelio

dpshelio Aug 31, 2016

Member

👍

Member

dpshelio commented Aug 31, 2016

👍

@Cadair Cadair merged commit 14793a4 into sunpy:master Aug 31, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Cadair Cadair removed the [Review] label Aug 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment