tardis-sn / tardis

TARDIS - Temperature And Radiative Diffusion In Supernovae
https://tardis-sn.github.io/tardis
204 stars 406 forks source link

Add Packet Wavelength filter to LIV Plot #2784

Closed sarthak-dv closed 3 months ago

sarthak-dv commented 3 months ago

:pencil: Description

Type: :rocket: feature

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

:pushpin: Resources

Examples, notebooks, and links to useful references.

:vertical_traffic_light: Testing

How did you test these changes?

:ballot_box_with_check: Checklist

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

review-notebook-app[bot] commented 3 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

tardis-bot commented 3 months ago

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

```diff 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):

```diff 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. ```
codecov[bot] commented 3 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tardis-bot commented 3 months ago

*beep* *bop*

Hi, human.

The docs workflow has succeeded :heavy_check_mark:

Click here to see your results.

tardis-bot commented 3 months ago

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

Significantly changed benchmarks:

```diff ```

All benchmarks:

```diff Benchmarks that have stayed the same: | Change | Before [92df2cf4] | 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 commented 3 months ago

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

sarthak-dv commented 3 months ago

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.