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

adding RPacketPlotter to TARDIS #2119

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

jayantbhakar
Copy link
Member

@jayantbhakar jayantbhakar commented Aug 21, 2022

📝 Description

Type: 🚀 feature

This PR is based on the Montecarlo 2D packet visualization project. It aims to write a module for the RPacketPlotter tool which creates a 2D animated graph of the RPackets or the real packets used in the Montecarlo simulation.

Example code to plot is shown below:

rpacket_plotter = RPacketPlotter.from_simulation(sim, no_of_packets=10)
rpacket_plotter.generate_plot()

Here's how the plot looks like:

Light Theme:

Screencast-from-02-09-22-12-47-5

Dark theme:

darktheme_PR

Also, link issues affected by this pull request by using the keywords: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved.

📌 Resources

Examples, notebooks, and links to useful references.

🚦 Testing

How did you test these changes?

  • Testing locally: Here is the log of pytests that I have run locally.

Screenshot from 2022-10-10 10-05-38

☑️ 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

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

@jayantbhakar jayantbhakar marked this pull request as draft August 21, 2022 07:44
@jayantbhakar jayantbhakar changed the title Add mc packet visualization adding RPacketPlotter to TARDIS Aug 21, 2022
@codecov
Copy link

codecov bot commented Aug 21, 2022

Codecov Report

Attention: Patch coverage is 18.47826% with 75 lines in your changes are missing coverage. Please review.

Project coverage is 61.08%. Comparing base (de9f29b) to head (02edb56).

❗ Current head 02edb56 differs from pull request most recent head bfdd23a. Consider uploading reports for the commit bfdd23a to get more accurate results

Files Patch % Lines
tardis/visualization/tools/rpacket_plot.py 18.47% 75 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2119      +/-   ##
==========================================
- Coverage   67.67%   61.08%   -6.59%     
==========================================
  Files         170       76      -94     
  Lines       14308     8727    -5581     
==========================================
- Hits         9683     5331    -4352     
+ Misses       4625     3396    -1229     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

I'll review the code in the module soon. Please start writing unit tests and updating the docs

@jayantbhakar
Copy link
Member Author

Yeah, I think before writing tests and docs, I should work on adding some functionalities that are left. Today I am working on the dark theme.

Copy link
Contributor

@MarkMageeAstro MarkMageeAstro left a comment

Choose a reason for hiding this comment

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

Nice work Jayant. This will be a really nice addition to TARDIS when it's merged. I have a few specific codes that I've left. Generally though I think it would be good to add more comments throughout the code -- comments never hurt. The docstrings are good, but there are some specific bits of code where it's not clear exactly what they're doing. Just adding some comments to explain that will really help

tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
Copy link
Member

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

Good to see things finally shaping up - the final plot looks great. Thanks for finishing up animation and adding themes.

I have few minor comments about code n comments

tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
@review-notebook-app
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

tardis-bot commented Sep 6, 2022

*beep* *bop*

Hi, human.

The docs workflow has failed

Click here to see the build log.

@sonachitchyan
Copy link
Member

image

in here, change it from ```ith`` to ```i-th```

Copy link
Contributor

@MarkMageeAstro MarkMageeAstro 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 overall. I think some of the comments could be a bit more descriptive in places

tardis/visualization/tools/rpacket_visualization.py Outdated Show resolved Hide resolved
@review-notebook-app
Copy link

review-notebook-app bot commented Sep 7, 2022

View / edit / reply to this conversation on ReviewNB

MarkMageeAstro commented on 2022-09-07T09:54:57Z
----------------------------------------------------------------

properties (specifically...

with respect to the x-axis...

used (along...

calculate the x and y...


@review-notebook-app
Copy link

review-notebook-app bot commented Sep 7, 2022

View / edit / reply to this conversation on ReviewNB

MarkMageeAstro commented on 2022-09-07T09:54:58Z
----------------------------------------------------------------

Here the theme parameter...

Remove only

By default the light theme


@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

MarkMageeAstro commented on 2022-09-07T09:54:59Z
----------------------------------------------------------------

Is there supposed to be something here? It doesn't show anything for me even in the docs preview


@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

MarkMageeAstro commented on 2022-09-07T09:55:00Z
----------------------------------------------------------------

The Play button

The animation

to reach any


@andrewfullard
Copy link
Contributor

Okay, I did the rebase so now it just needs some cleanup to the current code structure.

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.

None yet

8 participants