Skip to content

Commit

Permalink
I take it back; keeping the html repr for Data.
Browse files Browse the repository at this point in the history
I forgot it only shows up when plain calling the aggregator; the print
statement still yields the plaintext repr. Without this, in a notebook
all one gets with calling the aggregator is the practically useless
wrapped list representation.
  • Loading branch information
dotsdl committed Apr 8, 2015
1 parent 5d4911b commit 356b275
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mdsynthesis/core/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,19 @@ class Data(Aggregator):
def __repr__(self):
return "<Data({})>".format(self.list())

def _repr_html_(self):
data = self.list()
agg = "Data"
if not data:
out = "No Data"
else:
out = "<h3>{}</h3>".format(agg)
out = out + "<ul style='list-style-type:none'>"
for datum in data:
out = out + "<li>{}</li>".format(datum)
out = out + "</ul>"
return out

def __str__(self):
data = self.list()
agg = "Data"
Expand Down

0 comments on commit 356b275

Please sign in to comment.