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 spectrum visualization notebook #2964

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

Conversation

KasukabeDefenceForce
Copy link
Contributor

📝 Description

Type: 🪲 bugfix | 🚀 feature | ☣️ breaking change | 🚦 testing | 📝 documentation | 🎢 infrastructure
This PR aims at adding a spectrum visualization notebook which has some examples regarding how can someone plot the spectrum data.

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 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 Feb 3, 2025

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

6	W291	[*] Trailing whitespace
5	W293	[*] Blank line contains whitespace
3	E999	[ ] SyntaxError: Expected a statement

Complete output(might be large):

docs/analysing_tardis_outputs/index.rst:1:1: E999 SyntaxError: Expected an expression
docs/analysing_tardis_outputs/index.rst:12:1: W293 [*] Blank line contains whitespace
docs/analysing_tardis_outputs/visualization/index.rst:1:1: E999 SyntaxError: Expected a statement
docs/analysing_tardis_outputs/visualization/index.rst:25:1: W293 [*] Blank line contains whitespace
docs/index.rst:1:1: E999 SyntaxError: Expected a statement
docs/index.rst:21:51: W291 [*] Trailing whitespace
docs/index.rst:43:76: W291 [*] Trailing whitespace
docs/index.rst:44:64: W291 [*] Trailing whitespace
docs/index.rst:45:71: W291 [*] Trailing whitespace
docs/index.rst:46:69: W291 [*] Trailing whitespace
docs/index.rst:47:68: W291 [*] Trailing whitespace
docs/index.rst:66:1: W293 [*] Blank line contains whitespace
docs/index.rst:88:1: W293 [*] Blank line contains whitespace
docs/index.rst:112:1: W293 [*] Blank line contains whitespace
Found 14 errors.
[*] 11 fixable with the `--fix` option.

@KasukabeDefenceForce KasukabeDefenceForce marked this pull request as ready for review February 4, 2025 14:09
@tardis-bot
Copy link
Contributor

tardis-bot commented Feb 4, 2025

*beep* *bop*

Hi, human.

The docs workflow has failed

Click here to see the build log.

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.17%. Comparing base (b53686a) to head (bc2fe96).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2964      +/-   ##
==========================================
- Coverage   69.52%   69.17%   -0.35%     
==========================================
  Files         228      228              
  Lines       16429    16429              
==========================================
- Hits        11422    11365      -57     
- Misses       5007     5064      +57     

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

@KasukabeDefenceForce KasukabeDefenceForce marked this pull request as draft February 4, 2025 15:04
@KasukabeDefenceForce KasukabeDefenceForce marked this pull request as ready for review February 11, 2025 05:47
@KasukabeDefenceForce KasukabeDefenceForce force-pushed the spec_vis_notebook branch 2 times, most recently from 25fdcbe to 73333c1 Compare February 11, 2025 06:02
@andrewfullard
Copy link
Contributor

  • Add markdown explaining the plots
  • Clean up commented cells or explain them
  • Focus on formal integral spectrum as the default plotting option (and note in markdown that it takes time to calculate)

@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (cec8b53) and the latest commit (bc2fe96).
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 [cec8b531] <master>   | After [bc2fe969]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 2.84±0.3μs                   | 3.65±0.9μs          | ~1.28   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 23.7±6μs                     | 20.7±5μs            | ~0.87   | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 3.78±0.5ms                   | 2.94±0.5ms          | ~0.78   | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 6.27±1μs                     | 6.62±0.6μs          | 1.06    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 2.08±1μs                     | 2.16±1μs            | 1.04    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 7.86±2μs                     | 8.17±2μs            | 1.04    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 206±0.2ns                    | 213±0.05ns          | 1.03    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 1.53±0.3μs                   | 1.57±0.5μs          | 1.03    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 64.2±0.05ms                  | 65.8±0.06ms         | 1.03    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 531±100ns                    | 541±100ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 561±100ns                    | 571±200ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 1.73±0ms                     | 1.76±0.02ms         | 1.02    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 48.8±40μs                    | 49.0±30μs           | 1.01    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 38.9±0.01s                   | 38.7±0.1s           | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.04±0m                      | 1.05±0m             | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 2.08±0m                      | 2.09±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 39.2±0.05μs                  | 38.9±0.06μs         | 0.99    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 3.35±0.8μs                   | 3.31±0.6μs          | 0.99    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 611±100ns                    | 601±100ns           | 0.98    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 42.4±30μs                    | 41.7±20μs           | 0.98    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 713±2ns                      | 701±0.8ns           | 0.98    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 4.21±0.03ms                  | 4.02±0.03ms         | 0.95    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 1.22±0μs                     | 1.15±0μs            | 0.95    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 3.18±0.01ms                  | 2.89±0.02ms         | 0.91    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |

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

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.

3 participants