Adds show_in_notebook functions for Interactive tables using itables#7899
Conversation
|
itables can be a great alternative here, as it eliminates the need for additional dependencies. Here's how you can use it: from itables import show
show(df)If you prefer to avoid the IPython dependency, you can consider the following approach: Additionally, do you have any suggestions for writing tests for this integration? |
I assume astropy picked the other library for a reason? What is the difference between them? Also is this an AI answer?
Honestly, I do not. How did astropy do it? Since astropy are dealing with these types of dependencies, I think investigating how they do that and copying their solution is the simplest path forward. |
I believe maybe they didn't pick itables because "itables appears to change how dataframes are rendered Notebook-wide which I felt isn't something we're going for." said by exitflynn, although this is not a problem now because itable have
If we use itables we can directly use their show method which can display them in jupyter notbook, but in astropy they have used ipydatagrid to single tables and returned them directly, which we cannot do in sunpy as there can be multiple tables in a fido result, also this is the reason why we cannot use astropy's show_in_notebook method. Edit:
Neither the code nor the comments are ai (although I use grammarly), I guess it is a problem? I will stop that now.
Yes, they just checked |
How does it change them compared to the other library?
So how does both libraries handle having multiple tables and rendering them in a notebook?
No that's fine. It's a common tool and its different from Gen AI.
Hmm, I expect that properly testing this kind of output is painful and why it was not done. Can you check how the |
This converts all dataframes into those interactive tables, this is what exitflynn meant although i guess he missed or they added
Naturally they cannot render multiple tables, but
Yes I had a look, I will try using mocking. |
So in your opinion, which library should we use?
Thanks |
itables, for some reasons I am not able to run the test locally I am pushing to test it. |
|
Also can you please clarify what you mean by |
https://docs.sunpy.org/en/stable/tutorial/acquiring_data/index.html#searching-for-data |
|
|
Looks fine with me. |
Hi, ipydatagrid felt much slower and more laggy when I used it, which is why we decided to go with tables. Ref comment
I'm not quite sure could you please let me know where the dependency should be placed |
I've now added an optional |
Co-authored-by: Will Barnes <will.t.barnes@gmail.com>
| assert isinstance(results[0], QueryResponseTable) | ||
|
|
||
|
|
||
| @pytest.mark.remote_data |
There was a problem hiding this comment.
I know we have random requirements on remote data but do we really need to use a real fido return for this
There was a problem hiding this comment.
Yeah I agree, there's no need for this to be an online PR.
|
Changed test to be offline. |
|
Thank you again @Prtm2110 |


PR Description
Fixes #7639