Skip to content

Figure out how to display nice notebook previews of radar datasets #5

@thomasteisberg

Description

@thomasteisberg

We need to load in the parameter structures, but they're deeply nested dictionaries and the previews of them look awful with the default xarray _repr_html_.

Current workaround: We now have a custom accessor that provides a new _repr_html_ that collapses nested dictionaries, similar to how other elements of xarray datasets can be collapsed. The problem is that you have to use ds.xopr to see it, rather than just ds.

Best case scenario would be to upstream the collapsible dictionaries, but it may be too niche a use case for xarray. PR is here: pydata/xarray#10663

Other options:

  • Stick with the accessor
  • Subclass Dataset
  • Maybe make a custom object type for the params dictionaries, which could at least override _str_ and return a shorter (but plain text only) preview?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions