Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AxisKeys and friends #708

Closed
aplavin opened this issue Nov 23, 2020 · 6 comments
Closed

Support AxisKeys and friends #708

aplavin opened this issue Nov 23, 2020 · 6 comments
Assignees
Labels
display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages

Comments

@aplavin
Copy link
Contributor

aplavin commented Nov 23, 2020

using AxisKeys
KeyedArray([1 2; 3 4]; i=2:3, j=["a", "b"])

image

If I'm not mistaken, those displayed fine before recent Pluto updates. Also I confirmed that everything works in Julia REPL and IJulia.
Looks like issues lie somewhere in the Pluto "magic" trying to show the arrays as rich as possible.

@fonsp
Copy link
Owner

fonsp commented Nov 23, 2020

Thanks! You can subscribe to #458

@fonsp fonsp closed this as completed Nov 23, 2020
@fonsp
Copy link
Owner

fonsp commented Nov 23, 2020

Sorry, I edited your comment to remove the duplicate issue #458, but AxisKeys is new

@fonsp fonsp reopened this Nov 23, 2020
@fonsp fonsp changed the title Exception when trying to display certain types Support AxisKeys Nov 23, 2020
@fonsp fonsp added display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages labels Nov 23, 2020
@aplavin
Copy link
Contributor Author

aplavin commented Nov 23, 2020

I guess I missed that issue you link.

@aplavin
Copy link
Contributor Author

aplavin commented Nov 23, 2020

Do you think it's possible to make the fix more general than "support AxisKeys"? Surely there are other packages, more or less popular, that define various array types, and some of those types may suffer from similar issues.
E.g., maybe just fallback to "regular" plain-text rendering if the "rich" one errors?

@fonsp fonsp changed the title Support AxisKeys Support AxisKeys and friends Nov 23, 2020
@mcabbott
Copy link
Contributor

So the problem appears to be that it's going through the Tables.jl interface, which AxisKeys.jl provides in case it's a useful way to get data out into something else. But the structure isn't principally a table. It's an N-dim array, with labels along each axis.

It overloads the basic REPL printing heavily. I haven't really looked into providing an HTML version. (Last time I looked at PrettyTables.jl, which I think does so, it did not seem easy to hook up --- it seemed quite focused on tabular data, headings & columns. But that was a while ago.)

@fonsp fonsp self-assigned this Nov 24, 2020
@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

The error is fixed in #726

Pluto now displays it as a table:

image

You can open a new issue if this is not what we want

@fonsp fonsp closed this as completed Nov 27, 2020
fonsp added a commit that referenced this issue Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display & PlutoRunner & AbstractPlutoDingetjes.jl other packages Integration with other Julia packages
Projects
None yet
Development

No branches or pull requests

3 participants