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

Feature request: add virtual-packet-logging option to run_tardis() #1498

Conversation

yuyizheng1112
Copy link
Contributor

@yuyizheng1112 yuyizheng1112 commented Mar 19, 2021

Description

This PR is to resolve #1356.

Motivation and Context

The virtual packet data is not enabled by default. Currently, we have to enable virtual_packet_logging by editing the configuration file to use visualization tools that require virtual packet data. Although offering instruction in the documentation can partly solve the problem, it is still inconvenient to edit configuration file every time.

The new feature allows us to enable virtual_packet_logging option while running TARDIS simulation by setting the parameter virtual_packet_logging=True. The default value of the parameter is False. Meanwhile, it still supports specifying the option in configuration files.

How Has This Been Tested?

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

Screenshots (if appropriate):

The output of virt_packet_last_interaction_type indicates whether the packet has been enabled.
image

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

@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #1498 (219c639) into master (47ed0ce) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1498   +/-   ##
=======================================
  Coverage   68.12%   68.12%           
=======================================
  Files          68       68           
  Lines        6040     6040           
=======================================
  Hits         4115     4115           
  Misses       1925     1925           
Impacted Files Coverage Δ
tardis/tardis/base.py 5.55% <0.00%> (ø)
tardis/tardis/montecarlo/base.py 86.20% <0.00%> (ø)
tardis/tardis/simulation/base.py 85.71% <0.00%> (ø)

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 47ed0ce...219c639. Read the comment docs.

@andrewfullard
Copy link
Contributor

Thank you for this contribution! Please look at the results of failing checks and adjust appropriately. In particular, apply black formatting and add a docstring that informs the user of the new virtual packet logging option.

@andrewfullard andrewfullard marked this pull request as draft March 19, 2021 14:30
@yuyizheng1112
Copy link
Contributor Author

Thank you for this contribution! Please look at the results of failing checks and adjust appropriately. In particular, apply black formatting and add a docstring that informs the user of the new virtual packet logging option.

Thanks for your kind reminder. I made some additions to the docstring and reformatted the files. Please review my work.

@yuyizheng1112 yuyizheng1112 force-pushed the virtual-packet-logging-initialization branch from 290af0a to 219c639 Compare March 20, 2021 07:14
@yuyizheng1112 yuyizheng1112 marked this pull request as ready for review March 20, 2021 07:26
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.

@yuyizheng1112 this looks good. Just to make sure everything is alright, can you post output of sim.runner.virt_logging for both cases?

@yuyizheng1112
Copy link
Contributor Author

@yuyizheng1112 this looks good. Just to make sure everything is alright, can you post output of sim.runner.virt_logging for both cases?

I've post the screenshot of new output. Please review it :)

@andrewfullard andrewfullard merged commit aa12a98 into tardis-sn:master Mar 24, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
…ardis-sn#1498)

* add new parameter to initialize virtual-packet-logging

* add docstring

* reformat files with black
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.

Add virtual_packet_logging option to run_tardis()
3 participants