home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

15 rows where issue = 264747372 and user = 4160723 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 1

  • benbovy · 15 ✖

issue 1

  • html repr of xarray object (for the notebook) · 15 ✖

author_association 1

  • MEMBER 15
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
405014221 https://github.com/pydata/xarray/issues/1627#issuecomment-405014221 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDQwNTAxNDIyMQ== benbovy 4160723 2018-07-14T10:25:24Z 2018-07-14T10:25:24Z MEMBER

Yeah I really need to continue the work in #1820, this PR has stalled for too long!

Last time I worked on this I was struggling a bit on good column auto-sizing and alignment with a pure CSS implementation (i.e., using CSS grid, display: content), but that's not really a blocker I think.

Another option would be to write a jupyterlab mime render extension. This narrows the supported front-ends, but I guess the issue of front-end theme integration will be easier to solve. Also, it will be possible to add more fancy features later.

Did you were at SciPy? I hope you had a great time! I wanted to attend the conference this year but finally I couldn't make it, unfortunately.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
344062538 https://github.com/pydata/xarray/issues/1627#issuecomment-344062538 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDM0NDA2MjUzOA== benbovy 4160723 2017-11-13T21:22:28Z 2017-11-13T21:22:28Z MEMBER

Yes good points.

One part of me (the one that loves every cool, new package) says "let's use vdom for this right now", and the other (more wise) part says "let's use Python string formatting -- not even sure we need something like jinja2 --, we'll switch to vdom once it is more mature and it will be quite easy to do so."

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 2,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
344021451 https://github.com/pydata/xarray/issues/1627#issuecomment-344021451 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDM0NDAyMTQ1MQ== benbovy 4160723 2017-11-13T18:59:28Z 2017-11-13T18:59:28Z MEMBER

So we have different options regarding the tools to use for implementing these rich representations:

  • Using vdom. This option is very pythonic and is suggested by jupyterlab and nteract developers. I have used vdom to implement the rich repr of Dataset (not fully working yet + you need last jupyterlab or nteract to see it): https://gist.github.com/benbovy/a30f286f7fdf9528c4d0c7980be9b6a7. vdom is still in development, though. It is not yet supported by all front-ends. Currently it is supported in jupyterlab and nteract and support will be added soon for the classic notebook (and nbviewer?)

  • Using a template system like jinja2. It doesn't require any specific support on the various notebook front-ends, but it still adds a dependency.

  • Using Python strings formatting. No dependencies, but more tough to maintain.

I'd like to know what are your thoughts. Should we go with vdom and wait a bit until the tool is more mature / more front-ends are supported (hopefully soon, which let us some time if we can wait for release v0.11)? Or do you want it right now and so it's perhaps better to use templates / formatting?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
342452818 https://github.com/pydata/xarray/issues/1627#issuecomment-342452818 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDM0MjQ1MjgxOA== benbovy 4160723 2017-11-07T11:20:41Z 2017-11-07T11:20:41Z MEMBER

I started working on a new PR (not yet submitted), but before continuing the work I really need to know how best we can include the CSS code in rich outputs for the notebook (e.g., inline CSS or using the <style> tag) without requiring any extension for the various front-end applications.

It is not really clear to me if it is even supported so I opened an issue on the jupyterlab side (see reference above).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
341116013 https://github.com/pydata/xarray/issues/1627#issuecomment-341116013 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDM0MTExNjAxMw== benbovy 4160723 2017-11-01T14:07:24Z 2017-11-01T14:07:24Z MEMBER

Sorry for my late reply @shoyer !

Yes I'm happy with this version too, I'll open asap a PR! Unfortunately I hadn't much time to work on this these last two weeks, but I want to put this in my priorities next week.

I guess that it is a bit late for v0.10 release which is already on track? I still don't exactly know how much time I'll need to implement this. I haven't thought yet about all implementation details (e.g., how to calculate the width of the variable name column? potential issues with jupyter notebook / jupyterlab...). It might also require some refactoring and/or new public API (e.g., to_html like in pandas).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336510673 https://github.com/pydata/xarray/issues/1627#issuecomment-336510673 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjUxMDY3Mw== benbovy 4160723 2017-10-13T17:04:07Z 2017-10-13T17:04:07Z MEMBER

though we might only show the number when it is collapsed

Good idea!

Changes the letter "A" to "a" for attributes

Agreed.

Moves the marker "a" closer to the variable name

The good (or bad?) thing with the marker "a" to the very left is that it is aligned with the drop-down symbols of the main sections, but to me either way is fine.

Let's summarize all suggestions so far:

Dataset: https://jsfiddle.net/tay08cn9/2/ DataArray: https://jsfiddle.net/43z4v2wt/7/

I think that we're getting close to something good!

I'll wait a bit before starting a PR (maybe sometime next week), in case other feedbacks or suggestions come up.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336477198 https://github.com/pydata/xarray/issues/1627#issuecomment-336477198 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjQ3NzE5OA== benbovy 4160723 2017-10-13T14:57:06Z 2017-10-13T15:00:03Z MEMBER

Is it reasonable to add a drop down in the attribute section if there are too many items there?

In the examples above, you can click on the Attributes section title to collapse the whole section (same with coordinates and data variables sections).

Given your case, maybe it would be nice to add a rule to show the attribute section collapsed when the number of attributes is too long. If we allow that, then maybe it would be nice to also show the number of items in the section titles, e.g., ► Attributes (10):

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336452959 https://github.com/pydata/xarray/issues/1627#issuecomment-336452959 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjQ1Mjk1OQ== benbovy 4160723 2017-10-13T13:30:44Z 2017-10-13T13:30:44Z MEMBER

And for DataArray: https://jsfiddle.net/43z4v2wt/5/ (possibility to reduce the full data repr to a one-line preview)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336436271 https://github.com/pydata/xarray/issues/1627#issuecomment-336436271 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjQzNjI3MQ== benbovy 4160723 2017-10-13T12:16:01Z 2017-10-13T12:16:01Z MEMBER

New version for Dataset: https://jsfiddle.net/9ab4c3tr/50/

  • clicking on the name of a variable with A symbol shows its attributes.
  • clicking on the first-values of a variable shows the .data repr
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336275494 https://github.com/pydata/xarray/issues/1627#issuecomment-336275494 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjI3NTQ5NA== benbovy 4160723 2017-10-12T21:23:34Z 2017-10-12T21:23:34Z MEMBER

A comment regarding the use of javascript: after reading this discussion (https://github.com/bokeh/bokeh/issues/6700) I'm not sure that maintaining a javascript-based repr that works with both jupyterlab and the classic notebook is worth the few fancy features it would provide.

I'd rather stick with a pure html/css solution here. It might still co-exist with a full-featured jupyterlab extension for viewing NetCDF files.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336270137 https://github.com/pydata/xarray/issues/1627#issuecomment-336270137 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjI3MDEzNw== benbovy 4160723 2017-10-12T21:10:16Z 2017-10-12T21:10:16Z MEMBER

When hovering over data, show repr for the full array values (as a numpy array) in a box (similar to "title" text, but ideally fixed-width format).

That would be nice, although I guess that it would require javascript.

Alternatively, we can imagine two drop-downs per variable, one for the attributes and one for the full array values (numpy or dask repr). Each would be shown/hidden by two distinct symbols or links, perhaps both located on the right after the preview-values so that we avoid confusion with symbol * in the normal repr.

In the DataArray repr, instead of completely collapsing the data section we may reduce it into a one-line preview of the first values. We can even imagine showing the reduced version by default in cases where the full data section would take too much vertical space.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336202067 https://github.com/pydata/xarray/issues/1627#issuecomment-336202067 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjIwMjA2Nw== benbovy 4160723 2017-10-12T17:06:26Z 2017-10-12T17:06:26Z MEMBER

My main suggestion is it should be possible to click somewhere (maybe on top xarray.DataArray header) to hide/show the data section.

See https://jsfiddle.net/43z4v2wt/3/

I find text that moves very distracting

Indeed, I agree now, it's annoying.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336187799 https://github.com/pydata/xarray/issues/1627#issuecomment-336187799 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjE4Nzc5OQ== benbovy 4160723 2017-10-12T16:15:29Z 2017-10-12T16:15:29Z MEMBER

have a slight concern that the + icons could be confusing with the * we use for index variables in the normal repr.

Maybe putting the + icon more to the left would do the trick (https://jsfiddle.net/9ab4c3tr/49/).

For highlighting, maybe something a little more subtle would work well

Changing font-weight instead of background-color works better IMO (same link above).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336184204 https://github.com/pydata/xarray/issues/1627#issuecomment-336184204 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjE4NDIwNA== benbovy 4160723 2017-10-12T16:02:59Z 2017-10-12T16:02:59Z MEMBER

Before starting a PR on this, I'd like to get the design right (at least the static part) and also to clarify the repr of other xarray objects such as DataArray, Variable, Dataset.coords and Dataset.data_vars.

For Dataset.coords and Dataset.data_vars it would be pretty straightforward (we may simply display the corresponding sections in Dataset html repr).

For DataArray and Variable I have still no clear idea on what would be a good representation for the data values:

  • Option A: embed the plain-text representation of the wrapped numpy.array (or dask.array) in a HTML container (https://jsfiddle.net/43z4v2wt/1/). The result is not that bad, although monospace and sans-serif fonts do not mix very well IMO.

  • Option B: a html-formatted table for data values as well. That would be tricky for >2d arrays, it has already been discussed in other issues without real consensus.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372
336127376 https://github.com/pydata/xarray/issues/1627#issuecomment-336127376 https://api.github.com/repos/pydata/xarray/issues/1627 MDEyOklzc3VlQ29tbWVudDMzNjEyNzM3Ng== benbovy 4160723 2017-10-12T13:00:59Z 2017-10-12T13:34:32Z MEMBER

Thanks for the feedback!

Here are a few more ideas: https://jsfiddle.net/9ab4c3tr/48/

  • main section titles are colored so that these are more detached from the content (not sure I really like it, though),
  • subtle shade variations, notably for displaying the first values for each variable,
  • drop-downs for displaying attributes per variable if any (collapsed by default).
  • hover-effect for dimensions: highlight all variables having the hovered dimension (uses Javascript)

We might use drop-downs to display other useful information as well, such as the type of array (e.g., dask-array, in-memory numpy.array, etc...)

Fancy hover effects would be awesome indeed, although my concern is that too much hover effect would be a source of distraction.

A jupyterlab NetCDF viewer extension would be awesome too! It might also leverage phosphor's datagrid (https://github.com/phosphorjs/phosphor/issues/285) to explore the raw data values.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  html repr of xarray object (for the notebook) 264747372

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 152.086ms · About: xarray-datasette