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 packet initialization documentation #2822

Closed

Conversation

CePowers
Copy link
Contributor

📝 Description

Type: : 📝 documentation

I created a new file for the gamma ray documentation within the physics walkthrough. I put information on packet initialization, including packet properties.

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

@tardis-bot
Copy link
Contributor

tardis-bot commented Sep 13, 2024

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

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

Complete output(might be large):

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:79:1: W293 [*] Blank line contains whitespace
docs/index.rst:103:1: W293 [*] Blank line contains whitespace
docs/physics/tardisgamma/gammaraypacketinitialization.rst:1:8: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
docs/physics/tardisgamma/index.rst:1:1: E999 SyntaxError: Expected an expression
Found 12 errors.
[*] 9 fixable with the `--fix` option.

@tardis-bot
Copy link
Contributor

tardis-bot commented Sep 13, 2024

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 12 lines in your changes missing coverage. Please review.

Project coverage is 70.51%. Comparing base (62395d3) to head (8d5ea89).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
tardis/io/logger/tests/test_logging.py 50.00% 3 Missing ⚠️
tardis/visualization/widgets/util.py 50.00% 3 Missing ⚠️
tardis/io/atom_data/util.py 50.00% 2 Missing ⚠️
tardis/io/model/readers/blondin_toymodel.py 0.00% 2 Missing ⚠️
tardis/io/configuration/config_internal.py 80.00% 1 Missing ⚠️
tardis/model/matter/decay.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2822      +/-   ##
==========================================
- Coverage   70.99%   70.51%   -0.49%     
==========================================
  Files         209      209              
  Lines       15650    15589      -61     
==========================================
- Hits        11111    10992     -119     
- Misses       4539     4597      +58     

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

@tardis-bot
Copy link
Contributor

tardis-bot commented Sep 13, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (62395d3) and the latest commit (8d5ea89).
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 [3b6084f2] <master>   | After [8d5ea891]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 1.39±0.4μs                   | 1.60±0.3μs          | ~1.15   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 552±200ns                    | 621±200ns           | ~1.12   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 3.28±0.5μs                   | 2.92±0.4μs          | ~0.89   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 8.12±2μs                     | 6.78±1μs            | ~0.84   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 60.2±30μs                    | 47.6±40μs           | ~0.79   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 2.01±1μs                     | 2.15±1μs            | 1.07    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 23.7±6μs                     | 25.0±7μs            | 1.06    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 203±0.04ns                   | 213±0.03ns          | 1.05    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 561±200ns                    | 581±100ns           | 1.04    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 2.62±0.5ms                   | 2.71±0.4ms          | 1.04    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 713±0.03ns                   | 733±2ns             | 1.03    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 571±100ns                    | 581±200ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 1.71±0.01ms                  | 1.75±0.01ms         | 1.02    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 7.36±1μs                     | 7.52±2μs            | 1.02    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 2.78±0.03ms                  | 2.80±0.01ms         | 1.01    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 39.3±20μs                    | 39.6±20μs           | 1.01    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 37.9±0.03s                   | 37.9±0.06s          | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 2.08±0m                      | 2.09±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 67.5±0.2ms                   | 66.6±0.2ms          | 0.99    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 4.21±0.04ms                  | 4.14±0.03ms         | 0.98    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 1.04±0m                      | 1.02±0m             | 0.98    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 1.23±0μs                     | 1.21±0μs            | 0.98    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 31.5±0.07μs                  | 29.8±0μs            | 0.95    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 3.44±0.5μs                   | 3.22±0.5μs          | 0.94    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |

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

Packet Initialization
=====================

The gamma ray portion of tardis also uses packets of photons, which are given the following properties:
Copy link
Member

Choose a reason for hiding this comment

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

Please add references!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the references.

- **Packet Energy:** This is the energy of the packet in the comoving frame and is equal to the total energy divided by the number of packets.
- **Packet Frequency:** This is the frequency of the packet in the comoving frame and is equal to the packet energy divided by Planck's constant, h.
- **Packet Direction:** This is the direction of the packet and is made up of two angles, :math:`\theta` and :math:`\phi`.
:math:`\theta` is a polar angle between 0 and :math:`\pi` and :math:`\phi` is an azimuth angle between 0 and 2:math:`\pi`.
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the bullets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the bullets

* Adds try-except block for qgridnext and small docs note

* black

* Add forced output to the widget notebook so docs can build
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

CePowers and others added 13 commits October 1, 2024 11:29
* ruff autofix analysios

* ruff autofix tardis/grid

* ruff autofix tardis/radiation_field

* ruff autofix tardis/util

* black tardis/grid/base.py
* ruff io auto safe fixes

* ruff io auto unsafe fixes

* black tardis/io/util.py

* black tardis/io/model/readers/arepo.py
* ruff model auto safe fixes

* ruff model auto unsafe fixes

* black tardis/model/base.py
* ruff autofix tardis/transport safe fixes

* ruff autofix tardis/transport unsafe fixes

* fix ruff unsafe rule PIE790

* black 2 files

---------

Co-authored-by: Andrew Fullard <[email protected]>
Fix download_atom_data import
Make sure tests only run when push to master and pull request to master
* Fixed inplace warnings

* Replace add function with update

* Update  ion_number_density  without using a inplace function

* Fix chained assignment error in partition_function

* Fix chained assignment error in helium_nlte

* Fix chained assignment error in ion_population.py

* Refactor assignment of Helium population updated  values

* Change deprecated delim_whitespace param with sep param

* Fix warning  'path_or_buf' will be keyword-only.

* Replace deprecated  flex_nu with luminosity_to_flux

* Fix get_cmap is deprecated warning

* Fix virtual packet logging to true warning

* FOrmat using black
* Remove extra asv installation step

* Add conda build to list of dependencies alongside asv

* change trigger temporarily for testing

* Change conditonals too

* Add conda as a dependency too

* undo test modifications

* pip asv
* Update create pull request action

* Add arm lock file

* Modifications for displaying vhangelog

* Test on fork

* Undo changes to test on fork

* Test git cliff pinned

* Reset release triggers
Fallback to qgrid (currently in lock files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants