Skip to content

html repr of dataset shown in jupyter #8

Description

@mathause

This is confusing

Image

The reason is that jupyter tries to get the _repr_html_ of the object and succeeds because it can __getattr__ the one from the contained Dataset:

def __getattr__(self, attr):
if attr in self.__dict__:
return getattr(self, attr)
return getattr(self.ds, attr)

The workaround is to define your own _repr_html_

def _repr_html_(self):

    html_repr = fc.df._repr_html_()

    html_repr = "<h4>contrack</h4><br>" + html_repr

    return html_repr

or to special case _repr_html_ in __getattr__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions