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

Add Packet Wavelength filter to LIV Plot #2784

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

sarthak-dv
Copy link
Contributor

@sarthak-dv sarthak-dv commented Aug 7, 2024

📝 Description

Type: 🚀 feature

Added a Wavelength range filter to restrict the analysis of interacting packets in LIV Plot.

📌 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

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

tardis-bot commented Aug 7, 2024

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

2	D202  	[*] No blank lines allowed after function docstring (found 1)
1	G004  	[ ] Logging statement uses f-string
1	RET506	[ ] Unnecessary `elif` after `raise` statement
1	I001  	[*] Import block is un-sorted or un-formatted

Complete output(might be large):

tardis/visualization/tools/liv_plot.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/liv_plot.py:25:9: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/visualization/tools/liv_plot.py:48:9: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/visualization/tools/liv_plot.py:247:17: G004 Logging statement uses f-string
tardis/visualization/tools/liv_plot.py:357:13: RET506 Unnecessary `elif` after `raise` statement
Found 5 errors.
[*] 3 fixable with the `--fix` option.

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 69.37%. Comparing base (92df2cf) to head (c4b9ff8).

Files Patch % Lines
tardis/visualization/tools/liv_plot.py 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2784      +/-   ##
==========================================
- Coverage   69.97%   69.37%   -0.61%     
==========================================
  Files         206      206              
  Lines       15509    15523      +14     
==========================================
- Hits        10853    10769      -84     
- Misses       4656     4754      +98     

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

@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

@sarthak-dv sarthak-dv changed the title Add Packet Wavelength filter Add Packet Wavelength filter to LIV Plot Aug 7, 2024
@tardis-bot
Copy link
Contributor

tardis-bot commented Aug 7, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (92df2cf) and the latest commit (c4b9ff8).
Here are the logs produced by ASV.
Results can also be downloaded as artifacts here.

Significantly changed benchmarks:

All benchmarks:

Benchmarks that have stayed the same:

| Change   | Before [92df2cf4] <master>   | After [c4b9ff89]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 501±200ns                    | 602±100ns           | ~1.20   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 5.95±0.9μs                   | 7.00±1μs            | ~1.18   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 2.97±0.4μs                   | 3.40±0.7μs          | ~1.14   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 49.1±20μs                    | 43.2±30μs           | ~0.88   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 1.68±0.3μs                   | 1.41±0.4μs          | ~0.84   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 3.13±0.02ms                  | 2.56±0.01ms         | ~0.82   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 541±200ns                    | 571±100ns           | 1.06    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 1.98±2μs                     | 2.08±2μs            | 1.05    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 2.07±0m                      | 2.06±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 206±0.3ns                    | 205±0.03ns          | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 728±0.7ns                    | 732±0.9ns           | 1.00    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 2.54±0.5ms                   | 2.55±0.4ms          | 1.00    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 39.6±0.05s                   | 39.3±0.1s           | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.19±0μs                     | 1.18±0.01μs         | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 44.4±20μs                    | 44.2±20μs           | 0.99    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 3.90±0.02ms                  | 3.83±0.01ms         | 0.98    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 1.05±0m                      | 1.03±0m             | 0.98    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 31.0±0.01μs                  | 30.5±0.02μs         | 0.98    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 2.93±0.2μs                   | 2.86±0.5μs          | 0.98    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 561±100ns                    | 541±200ns           | 0.96    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 66.2±1ms                     | 63.6±0.2ms          | 0.96    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 1.76±0ms                     | 1.65±0ms            | 0.94    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 7.76±2μs                     | 7.31±2μs            | 0.94    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 21.7±5μs                     | 20.0±4μs            | 0.92    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |

If you want to see the graph of the results, you can check it here

@sarthak-dv
Copy link
Contributor Author

@jamesgillanders @jaladh-singhal I have added the species not found in wvl range logger, please review this PR.

jaladh-singhal
jaladh-singhal previously approved these changes Aug 9, 2024
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.

Looks good to me - some minor comments for notebook

@sarthak-dv
Copy link
Contributor Author

sarthak-dv commented Aug 12, 2024

Looks good to me - some minor comments for notebook

Thanks for noticing the errors I missed, I have made the corrections please review it again.

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.

Thanks

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.

Great work Sarthak! Code is concise and tidy -- happy to merge.

@jamesgillanders jamesgillanders merged commit 714cffc into tardis-sn:master Aug 14, 2024
13 of 17 checks passed
@sarthak-dv sarthak-dv deleted the packet-wvl-filter branch August 21, 2024 08:56
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.

4 participants