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

Tracking RPacket Properties in Montecarlo Single Packet Loop Function #1748

Merged
merged 23 commits into from
Dec 10, 2021

Conversation

DhruvSondhi
Copy link
Contributor

@DhruvSondhi DhruvSondhi commented Jul 21, 2021

This PR aims to add tracking functionality to Single Packet Loop via a new RPacketCollection Jitclass. It tracks all the properties to a single instance of the RPacketCollection class. The class object has the following properties available to access for the tracked packets:

  • index of the packets
  • seed of the packets
  • status of the packets
  • r (radius) of the packets
  • nu of the packets
  • mu of the packets
  • energy of the packets

Description

Functionality to Track R_Packet interactions with the respective properties. It tracks every interaction for each packet.
Stored in a RPacketCollection Class object namely r_packet_track

Motivation and context

Important for visualising the montecarlo packets. Allows to debug the interactions a packet may undergo.

Documentation Preview
https://dhruvsondhi.github.io/tardis/branch/packet_tracking/io/output/rpacket_tracking.html

How has this been tested?

  • Testing pipeline.
  • Other. Local Testing

Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

Copy link
Contributor Author

@DhruvSondhi DhruvSondhi left a comment

Choose a reason for hiding this comment

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

Initial Draft that allows logging Packet Properties to a File.

tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #1748 (4215291) into master (59c7f87) will decrease coverage by 0.37%.
The diff coverage is n/a.

❗ Current head 4215291 differs from pull request most recent head 97216e9. Consider uploading reports for the commit 97216e9 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1748      +/-   ##
==========================================
- Coverage   58.04%   57.66%   -0.38%     
==========================================
  Files          66       66              
  Lines        6747     6808      +61     
==========================================
+ Hits         3916     3926      +10     
- Misses       2831     2882      +51     
Impacted Files Coverage Δ
...dis/montecarlo/montecarlo_numba/numba_interface.py 35.64% <0.00%> (-10.52%) ⬇️
tardis/tardis/montecarlo/montecarlo_numba/base.py 25.00% <0.00%> (-1.22%) ⬇️
...rdis/tardis/montecarlo/montecarlo_configuration.py 100.00% <0.00%> (ø)
tardis/tardis/montecarlo/base.py 88.94% <0.00%> (+0.17%) ⬆️
.../montecarlo/montecarlo_numba/single_packet_loop.py 29.78% <0.00%> (+2.66%) ⬆️

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 59c7f87...97216e9. Read the comment docs.

tardis/montecarlo/base.py Outdated Show resolved Hide resolved
tardis/montecarlo/base.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
@andrewfullard
Copy link
Contributor

Apologies, I didn't realise this was marked draft!

@DhruvSondhi DhruvSondhi requested a review from marxwillia July 22, 2021 15:08
@DhruvSondhi DhruvSondhi marked this pull request as ready for review July 22, 2021 15:11
@DhruvSondhi DhruvSondhi changed the title Tracking Packet Properties via Logger in Montecarlo Single Packet Loop Function Tracking RPacket Properties in Montecarlo Single Packet Loop Function Jul 26, 2021
@DhruvSondhi DhruvSondhi force-pushed the packet_tracking branch 3 times, most recently from bd331ad to b6c989d Compare July 26, 2021 11:07
@DhruvSondhi DhruvSondhi marked this pull request as draft July 27, 2021 14:50
@DhruvSondhi DhruvSondhi force-pushed the packet_tracking branch 2 times, most recently from 981490b to 4df3b70 Compare July 29, 2021 09:34
@DhruvSondhi DhruvSondhi requested a review from wkerzendorf July 29, 2021 16:22
@DhruvSondhi DhruvSondhi marked this pull request as ready for review July 29, 2021 16:23
tardis/montecarlo/base.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/single_packet_loop.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/numba_interface.py Outdated Show resolved Hide resolved
tardis/montecarlo/montecarlo_numba/base.py Outdated Show resolved Hide resolved
@DhruvSondhi DhruvSondhi force-pushed the packet_tracking branch 2 times, most recently from 9e7512c to 0b04d28 Compare July 30, 2021 06:32
Changed the implementation of the finalize_array function to reduce the array size
Implemented tests with Setup & Teardown mechanics for INITIAL_TRACKING_ARRAY_LENGTH
Removed track_r_packet func from r_packet.py
Renamed tracked_rpacket to rpacket_tracker
@DhruvSondhi
Copy link
Contributor Author

Need to change a test. please don't merge until I push the changes to the test :)

@andrewfullard andrewfullard merged commit 59ff077 into tardis-sn:master Dec 10, 2021
@DhruvSondhi DhruvSondhi deleted the packet_tracking branch December 10, 2021 17:59
@DhruvSondhi DhruvSondhi restored the packet_tracking branch December 10, 2021 18:20
@DhruvSondhi
Copy link
Contributor Author

There is an issue with the documentation here. It needs to be fixed. I am working on it.

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