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

[GSoC] Rewrite the TARDIS visualisation module using Panel #2989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sonu0305
Copy link
Contributor

@Sonu0305 Sonu0305 commented Feb 22, 2025

📝 Description

Type: 🪲 bugfix | 🚀 feature | ☣️ breaking change | 🚦 testing | 📝 documentation | 🎢 infrastructure

🟢 This PR completes the first objective of Rewrite the TARDIS visualisation module using Panel, by migrating the shell info widget to completely using panel and more importantly by removing any dependancy on qgrid,qgridnext and IPython.
🟢 The Bonus mentioned in the PR is also completed, i.e. used the SimulationShellInfo and displayed the hierarchical dataset as interlinked tables where selecting a row in the first table updates the 2nd table with the data corresponding to the selected row. Additionally, the 1st table displaying shell data and the 2nd table displaying element abundances, further selecting a row further updates the 3rd and 4th table dislaying ion and level count data respectively.
🟢 The Widget runs at both places, in-place jupyter notebook and also on a separate localhost server.

Screen Recordings of the Widget Interaction:

  1. In-Place Jupyter Notebook:
Notebook.mp4
  1. Localhost Server
localhostserver.mp4

📌 Resources

Examples, notebooks, and links to useful references.

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

cc: @andrewfullard @atharva-2001 @KasukabeDefenceForce @jamesgillanders @wkerzendorf

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran ruff on the latest commit (dd3e264).
Here are the outputs produced.
Results can also be downloaded as artifacts here.
Summarised output:

6	F401  	[*] `numpy` imported but unused
3	I001  	[*] Import block is un-sorted or un-formatted
1	PIE808	[*] Unnecessary `start` argument in `range`

Complete output(might be large):

docs/analysing_tardis_outputs/visualization/how_to_generating_widgets.ipynb:cell 3:2:33: F401 [*] `tardis.io.atom_data.download_atom_data` imported but unused
docs/analysing_tardis_outputs/visualization/how_to_generating_widgets.ipynb:cell 5:1:1: I001 [*] Import block is un-sorted or un-formatted
docs/analysing_tardis_outputs/visualization/how_to_generating_widgets.ipynb:cell 5:3:5: F401 [*] `tardis.visualization.shell_info_from_hdf` imported but unused
tardis/visualization/widgets/shell_info.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/widgets/shell_info.py:1:25: F401 [*] `tardis.base.run_tardis` imported but unused
tardis/visualization/widgets/shell_info.py:2:51: F401 [*] `tardis.io.atom_data.atom_web_download.download_atom_data` imported but unused
tardis/visualization/widgets/shell_info.py:6:5: F401 [*] `tardis.util.base.is_notebook` imported but unused
tardis/visualization/widgets/shell_info.py:12:17: F401 [*] `numpy` imported but unused
tardis/visualization/widgets/shell_info.py:300:25: PIE808 [*] Unnecessary `start` argument in `range`
tardis/visualization/widgets/util.py:3:1: I001 [*] Import block is un-sorted or un-formatted
Found 10 errors.
[*] 10 fixable with the `--fix` option.

@tardis-bot
Copy link
Contributor

tardis-bot commented Feb 22, 2025

*beep* *bop*

Hi, human.

The docs workflow has failed

Click here to see the build log.

Comment on lines -306 to -319
"""Event listener to update the data in element count table widget based
on interaction (row selected event) in shells table widget.

Parameters
----------
event : dict
Dictionary that holds information about event (see Notes section)
qgrid_widget : qgrid.QgridWidget
QgridWidget instance that fired the event (see Notes section)

Notes
-----
You will never need to pass any of these arguments explicitly. This is
the expected signature of the function passed to :code:`handler` argument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Since I have migrated the shell info widget to using panel completely, there is no usage of qgrid and its widgets, hence removed the docstrings which were related to qgrid.

Comment on lines -118 to -122
Label like widget to show summary of a qgrid table widget.

Also handles aligning the label with the table columns exactly like a
summary row.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Same for this one, the docstring talked about the qgrid table widgets, which I have removed and migrated to using panel widgets functionality.

Comment on lines -284 to -288

Notes
-----
This decorator is reproduced from ipywidgets documentation, for more information
please see https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Events.html#debounce
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Same, since the project idea talks about removing every usage of IPython too (along with qgrid & qgridnext), hence I removed the Notes, should I revert the docstring changes for the whole class Timer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants