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

Gammaray opacity documentation #2876

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

Conversation

CePowers
Copy link
Contributor

📝 Description

Type: 📝 documentation `

I started a new documentation file for the sources of opacity for gamma rays. I added information for Compton Scattering with plans to add other sources of opacity.

📌 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.

@CePowers CePowers marked this pull request as draft November 12, 2024 14:16
@tardis-bot
Copy link
Contributor

tardis-bot commented Nov 12, 2024

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

5	E902	[ ] stream did not contain valid UTF-8
3	W291	[*] Trailing whitespace
2	E999	[ ] SyntaxError: Expected an expression
1	E701	[ ] Multiple statements on one line (colon)
1	W292	[*] No newline at end of file
1	W293	[*] Blank line contains whitespace

Complete output(might be large):

docs/physics/tardisgamma/images/all_coeffs.png:1:1: E902 stream did not contain valid UTF-8
docs/physics/tardisgamma/images/coeff_fractions.png:1:1: E902 stream did not contain valid UTF-8
docs/physics/tardisgamma/images/compton_scattering_coefficient.png:1:1: E902 stream did not contain valid UTF-8
docs/physics/tardisgamma/images/pair_production_coefficient.png:1:1: E902 stream did not contain valid UTF-8
docs/physics/tardisgamma/images/photoabsorption_coefficient.png:1:1: E902 stream did not contain valid UTF-8
docs/physics/tardisgamma/index.rst:1:1: E999 SyntaxError: Expected an expression
docs/physics/tardisgamma/opacities.rst:1:1: E999 SyntaxError: Expected an expression
docs/physics/tardisgamma/opacities.rst:4:64: E701 Multiple statements on one line (colon)
docs/physics/tardisgamma/opacities.rst:4:118: W291 [*] Trailing whitespace
docs/physics/tardisgamma/opacities.rst:9:221: W291 [*] Trailing whitespace
docs/physics/tardisgamma/opacities.rst:25:310: W291 [*] Trailing whitespace
docs/physics/tardisgamma/opacities.rst:40:1: W293 [*] Blank line contains whitespace
docs/physics/tardisgamma/opacities.rst:81:39: W292 [*] No newline at end of file
Found 13 errors.
[*] 5 fixable with the `--fix` option.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.72%. Comparing base (fd4369f) to head (261871e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2876      +/-   ##
==========================================
- Coverage   70.08%   69.72%   -0.36%     
==========================================
  Files         216      216              
  Lines       16034    16034              
==========================================
- Hits        11237    11180      -57     
- Misses       4797     4854      +57     

☔ 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.

@tardis-bot
Copy link
Contributor

tardis-bot commented Nov 12, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (b95388b) and the latest commit (b5c424d).
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 [b95388b6] <master>   | After [b5c424d8]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 571±200ns                    | 682±100ns           | ~1.19   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 2.97±0.4μs                   | 3.44±0.3μs          | ~1.16   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 6.33±2μs                     | 7.28±2μs            | ~1.15   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 1.39±0.4μs                   | 1.54±0.5μs          | ~1.11   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 48.9±30μs                    | 44.3±40μs           | ~0.91   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 1.82±1μs                     | 1.98±1μs            | 1.09    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 21.2±5μs                     | 22.7±6μs            | 1.07    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 3.68±0.02ms                  | 3.87±0.01ms         | 1.05    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 5.88±1μs                     | 6.06±0.9μs          | 1.03    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 62.0±0.08ms                  | 62.9±0.3ms          | 1.02    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 41.6±20μs                    | 41.9±30μs           | 1.01    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 491±200ns                    | 491±100ns           | 1.00    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 2.54±0.01ms                  | 2.54±0.01ms         | 1.00    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 1.06±0m                      | 1.07±0m             | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 2.07±0m                      | 2.07±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 203±0.1ns                    | 203±0.2ns           | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 2.63±0.6ms                   | 2.62±0.5ms          | 1.00    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 39.7±0.03s                   | 39.5±0.05s          | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.21±0μs                     | 1.20±0μs            | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 1.70±0.01ms                  | 1.69±0.01ms         | 0.99    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 592±200ns                    | 582±100ns           | 0.98    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 726±0.9ns                    | 711±0.7ns           | 0.98    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 32.6±0.02μs                  | 31.7±0.03μs         | 0.97    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 3.46±0.4μs                   | 3.21±0.6μs          | 0.93    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |

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

@CePowers CePowers marked this pull request as ready for review November 19, 2024 13:56
@CePowers CePowers marked this pull request as draft November 25, 2024 03:46
@CePowers CePowers marked this pull request as ready for review November 26, 2024 15:08
Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

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

Would like to see units on the y-axis of each plot

docs/physics/tardisgamma/opacities.rst Outdated Show resolved Hide resolved
Photoabsorption
===============
This occurs when the photon is completely absorbed by a material. We assume that the :math:`\gamma`-ray deposits all of its energy when this occurs
The coefficient is:
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a period before this line.

@jvshields
Copy link
Contributor

I think that this would be a lot more informative if all the different opacities were plotted together so you could more easily compare which opacity matters in which range. The text is fine and looks good, but I would definitely like to see the plots merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

The Total line being yellow is very difficult to read on white. I would also recommend using colourblind-safe colours for all lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would also be reasonable to limit the axes to cover the interesting region where all 3 opacities cross.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the y-axis needs to be logarithmic 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.

4 participants