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

Renamed widgets subpackage to visualization and restructured modules within it #1462

Merged
merged 4 commits into from
Feb 24, 2021

Conversation

jaladh-singhal
Copy link
Member

@jaladh-singhal jaladh-singhal commented Feb 18, 2021

Besides renaming, changed subpackage structure from:

widgets
├── __init__.py
├── line_info.py
├── plot_util.py
├── sdec_plot.py
├── shell_info.py
├── tests
│   ├── __init__.py
│   ├── test_line_info.py
│   └── test_shell_info.py
└── util.py

to:

visualization
├── __init__.py
├── plot_util.py
├── tools
│   ├── __init__.py
│   └── sdec_plot.py
└── widgets
    ├── __init__.py
    ├── line_info.py
    ├── shell_info.py
    ├── tests
    │   ├── __init__.py
    │   ├── test_line_info.py
    │   └── test_shell_info.py
    └── util.py

This way I've segregated tools and widgets similar to visualization docs:

key of difference tools widgets
contained modules restructured tardisanalysis tools like SDEC plot Jupyter widgets version of old GUI
can be generated through both script and notebook only notebook since they're "Jupyter" widgets
needs a running python kernel to render no (check SDEC demo notebook, both matplotlib & plolty plots show up) yes (check widgets demo notebook, widgets don't render instead GIF has to be used)

This segregation won't affect how users will import modules (except the name has been changed from widgets to visualization) since all the important functions/classes are imported in top-level visualization directory's init file. Hence a user need not to know whether a functionality is tool or widget, they will simply import all functionality from visualization subpackage, e.g.:

  • tool: from tardis.visualization import SDECPlotter
  • widget: from tardis.visualization import LineInfoWidget

The changes in two notebooks in docs reflect the same.

Motivation and Context

Name visualization is more inclusive and understandable to wider audience, also docs refer this section same, hence renaming subpackage was essential. Restructure is essential for making it easier for developers to add new modules right way, without creating clutter and maintaining modularity in codebase.

How Has This Been Tested?

  • Testing pipeline
  • Reference Data Comparison following these instructions
  • Other (please describe)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • None of the above (please describe)

Checklist:

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have built the documentation on my fork following these instructions
  • I have assigned and requested two reviewers for this pull request

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #1462 (01ca927) into master (927c606) will decrease coverage by 1.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1462      +/-   ##
==========================================
- Coverage   71.13%   70.00%   -1.14%     
==========================================
  Files          67       67              
  Lines        5523     5314     -209     
==========================================
- Hits         3929     3720     -209     
  Misses       1594     1594              
Impacted Files Coverage Δ
...dis/tardis/montecarlo/montecarlo_numba/r_packet.py 23.15% <0.00%> (-7.83%) ⬇️
.../tardis/montecarlo/montecarlo_numba/interaction.py 24.32% <0.00%> (-5.68%) ⬇️
.../montecarlo/montecarlo_numba/single_packet_loop.py 24.56% <0.00%> (-3.78%) ⬇️
...rdis/tardis/montecarlo/montecarlo_numba/vpacket.py 15.00% <0.00%> (-2.48%) ⬇️
tardis/tardis/plasma/properties/util/macro_atom.py 30.00% <0.00%> (-2.26%) ⬇️
...rdis/montecarlo/montecarlo_numba/tests/conftest.py 91.11% <0.00%> (-1.88%) ⬇️
tardis/tardis/plasma/properties/nlte.py 39.21% <0.00%> (-1.74%) ⬇️
...s/tardis/montecarlo/montecarlo_numba/macro_atom.py 43.75% <0.00%> (-1.71%) ⬇️
tardis/tardis/montecarlo/spectrum.py 70.00% <0.00%> (-1.70%) ⬇️
...is/tardis/plasma/properties/continuum_processes.py 41.66% <0.00%> (-1.58%) ⬇️
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 927c606...01ca927. Read the comment docs.

Copy link
Contributor

@ycamacho ycamacho left a comment

Choose a reason for hiding this comment

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

This is a good way to restructure the visualization tools. Good work!

Copy link
Member

@jamesgillanders jamesgillanders left a comment

Choose a reason for hiding this comment

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

looks good

@antreev-brar
Copy link
Contributor

Loved the detailed description.

@ycamacho ycamacho merged commit 50f13ba into tardis-sn:master Feb 24, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
…within it (tardis-sn#1462)

* Reorganized widgets & tools modules

* Changed import paths as per new subpackage structure

* Updated imports in demo notebooks

* Added EOF newline to init files
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.

5 participants