tardis-sn / tardis

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

Doc changes for RPacketTracker #2795

Closed Sumit112192 closed 3 weeks ago

Sumit112192 commented 1 month ago

:pencil: Description

Type: :memo: documentation

Many things in the RPacketTracker were outdated, so I updated those and also added the boundary_interaction part.

Things to add: Generate a diff version of what has changed, and comment it. Edit*: It is already generated by github workflows https://app.reviewnb.com/tardis-sn/tardis/pull/2795/

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

tardis-bot commented 1 month ago

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

```diff 79 W191 [ ] Indentation contains tabs 17 W291 [*] Trailing whitespace 9 E999 [ ] SyntaxError: Expected ',', found ':' 7 W293 [*] Blank line contains whitespace 5 F405 [ ] `exclude_patterns` may be undefined, or defined from star imports 5 UP032 [*] Use f-string instead of `format` call 4 I001 [*] Import block is un-sorted or un-formatted 4 E101 [ ] Indentation contains mixed spaces and tabs 4 F401 [*] `logging` imported but unused 3 E902 [ ] No such file or directory (os error 2) 3 F631 [ ] Assert test is a non-empty tuple, which is always `True` 3 UP015 [*] Unnecessary open mode parameters 2 B018 [ ] Found useless expression. Either assign it to a variable or remove it. 2 C408 [*] Unnecessary `dict` call (rewrite as a literal) 2 G004 [ ] Logging statement uses f-string 2 E402 [ ] Module level import not at top of file 2 UP030 [*] Use implicit references for positional format fields 1 ANN205 [ ] Missing return type annotation for staticmethod `get_relative_path` 1 COM818 [ ] Trailing comma on bare tuple prohibited 1 G001 [ ] Logging statement uses `str.format` 1 RET505 [ ] Unnecessary `else` after `return` statement 1 RET506 [ ] Unnecessary `else` after `raise` statement 1 E712 [*] Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks 1 W292 [*] No newline at end of file 1 W605 [*] Invalid escape sequence: `\ ` 1 D209 [*] Multi-line docstring closing quotes should be on a separate line 1 PGH004 [ ] Use specific rule codes when using `noqa` 1 PLW0127 [ ] Self-assignment of variable `observed_spectrum` 1 UP009 [*] UTF-8 encoding declaration is unnecessary ```

Complete output(might be large):

```diff .github/workflows/tardis-research-papers.yml:1:1: E902 No such file or directory (os error 2) .zenodo.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it. .zenodo.json:354:2: W292 [*] No newline at end of file CHANGELOG.md:4:15: E999 SyntaxError: Expected ',', found ':' CITATION.cff:3:1: E999 SyntaxError: Invalid annotated assignment target README.rst:1:1: E999 SyntaxError: Expected a statement asv.conf.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it. benchmarks/benchmark_base.py:29:9: ANN205 Missing return type annotation for staticmethod `get_relative_path` benchmarks/benchmark_base.py:75:9: RET506 Unnecessary `else` after `raise` statement docs/Makefile:5:16: E999 SyntaxError: Expected an expression docs/Makefile:22:1: W191 Indentation contains tabs docs/Makefile:23:1: W191 Indentation contains tabs docs/Makefile:24:1: W191 Indentation contains tabs docs/Makefile:25:1: W191 Indentation contains tabs docs/Makefile:26:1: W191 Indentation contains tabs docs/Makefile:27:1: W191 Indentation contains tabs docs/Makefile:28:1: W191 Indentation contains tabs docs/Makefile:29:1: W191 Indentation contains tabs docs/Makefile:30:1: W191 Indentation contains tabs docs/Makefile:31:1: W191 Indentation contains tabs docs/Makefile:32:1: W191 Indentation contains tabs docs/Makefile:33:1: W191 Indentation contains tabs docs/Makefile:34:1: W191 Indentation contains tabs docs/Makefile:35:1: W191 Indentation contains tabs docs/Makefile:36:1: W191 Indentation contains tabs docs/Makefile:37:1: W191 Indentation contains tabs docs/Makefile:40:1: W191 Indentation contains tabs docs/Makefile:41:1: W191 Indentation contains tabs docs/Makefile:42:1: W191 Indentation contains tabs docs/Makefile:45:1: W191 Indentation contains tabs docs/Makefile:46:1: W191 Indentation contains tabs docs/Makefile:47:1: W191 Indentation contains tabs docs/Makefile:50:1: W191 Indentation contains tabs docs/Makefile:51:1: W191 Indentation contains tabs docs/Makefile:52:1: W191 Indentation contains tabs docs/Makefile:55:1: W191 Indentation contains tabs docs/Makefile:56:1: W191 Indentation contains tabs docs/Makefile:57:1: W191 Indentation contains tabs docs/Makefile:60:1: W191 Indentation contains tabs docs/Makefile:61:1: W191 Indentation contains tabs docs/Makefile:62:1: W191 Indentation contains tabs docs/Makefile:65:1: W191 Indentation contains tabs docs/Makefile:66:1: W191 Indentation contains tabs docs/Makefile:67:1: W191 Indentation contains tabs docs/Makefile:70:1: W191 Indentation contains tabs docs/Makefile:71:1: W191 Indentation contains tabs docs/Makefile:72:1: W191 Indentation contains tabs docs/Makefile:73:1: W191 Indentation contains tabs docs/Makefile:73:1: E101 Indentation contains mixed spaces and tabs docs/Makefile:76:1: W191 Indentation contains tabs docs/Makefile:77:1: W191 Indentation contains tabs docs/Makefile:78:1: W191 Indentation contains tabs docs/Makefile:79:1: W191 Indentation contains tabs docs/Makefile:79:1: E101 Indentation contains mixed spaces and tabs docs/Makefile:80:1: W191 Indentation contains tabs docs/Makefile:81:1: W191 Indentation contains tabs docs/Makefile:82:1: W191 Indentation contains tabs docs/Makefile:85:1: W191 Indentation contains tabs docs/Makefile:86:1: W191 Indentation contains tabs docs/Makefile:87:1: W191 Indentation contains tabs docs/Makefile:88:1: W191 Indentation contains tabs docs/Makefile:89:1: W191 Indentation contains tabs docs/Makefile:90:1: W191 Indentation contains tabs docs/Makefile:91:1: W191 Indentation contains tabs docs/Makefile:94:1: W191 Indentation contains tabs docs/Makefile:95:1: W191 Indentation contains tabs docs/Makefile:96:1: W191 Indentation contains tabs docs/Makefile:99:1: W191 Indentation contains tabs docs/Makefile:100:1: W191 Indentation contains tabs docs/Makefile:101:1: W191 Indentation contains tabs docs/Makefile:102:1: W191 Indentation contains tabs docs/Makefile:103:1: W191 Indentation contains tabs docs/Makefile:103:1: E101 Indentation contains mixed spaces and tabs docs/Makefile:106:1: W191 Indentation contains tabs docs/Makefile:107:1: W191 Indentation contains tabs docs/Makefile:108:1: W191 Indentation contains tabs docs/Makefile:109:1: W191 Indentation contains tabs docs/Makefile:112:1: W191 Indentation contains tabs docs/Makefile:113:1: W191 Indentation contains tabs docs/Makefile:114:1: W191 Indentation contains tabs docs/Makefile:117:1: W191 Indentation contains tabs docs/Makefile:118:1: W191 Indentation contains tabs docs/Makefile:119:1: W191 Indentation contains tabs docs/Makefile:122:1: W191 Indentation contains tabs docs/Makefile:123:1: W191 Indentation contains tabs docs/Makefile:124:1: W191 Indentation contains tabs docs/Makefile:127:1: W191 Indentation contains tabs docs/Makefile:128:1: W191 Indentation contains tabs docs/Makefile:129:1: W191 Indentation contains tabs docs/Makefile:130:1: W191 Indentation contains tabs docs/Makefile:130:1: E101 Indentation contains mixed spaces and tabs docs/Makefile:133:1: W191 Indentation contains tabs docs/Makefile:134:1: W191 Indentation contains tabs docs/conf.py:1:1: UP009 [*] UTF-8 encoding declaration is unnecessary docs/conf.py:28:1: I001 [*] Import block is un-sorted or un-formatted docs/conf.py:31:8: F401 [*] `tardis` imported but unused docs/conf.py:37:43: PGH004 Use specific rule codes when using `noqa` docs/conf.py:47:6: UP015 [*] Unnecessary open mode parameters docs/conf.py:68:1: F405 `exclude_patterns` may be undefined, or defined from star imports docs/conf.py:69:1: F405 `exclude_patterns` may be undefined, or defined from star imports docs/conf.py:70:1: F405 `exclude_patterns` may be undefined, or defined from star imports docs/conf.py:71:1: F405 `exclude_patterns` may be undefined, or defined from star imports docs/conf.py:72:1: F405 `exclude_patterns` may be undefined, or defined from star imports docs/conf.py:139:1: W293 Blank line contains whitespace docs/conf.py:174:1: W293 Blank line contains whitespace docs/conf.py:191:13: UP030 Use implicit references for positional format fields docs/conf.py:191:13: UP032 [*] Use f-string instead of `format` call docs/conf.py:218:1: E402 Module level import not at top of file docs/conf.py:291:4: E712 Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks docs/conf.py:352:1: E402 Module level import not at top of file docs/conf.py:367:10: UP015 [*] Unnecessary open mode parameters, use ""w"" docs/conf.py:382:10: UP015 [*] Unnecessary open mode parameters, use ""w"" docs/contributing/development/documentation_guidelines.rst:1:1: E999 SyntaxError: Expected a statement docs/contributing/development/documentation_guidelines.rst:44:1: W293 [*] Blank line contains whitespace docs/contributing/development/documentation_guidelines.rst:58:10: W291 [*] Trailing whitespace docs/contributing/development/git_workflow.rst:1:1: E999 SyntaxError: Expected a statement docs/contributing/development/running_tests.rst:1:1: E999 SyntaxError: Expected a statement docs/contributing/development/running_tests.rst:8:90: COM818 Trailing comma on bare tuple prohibited docs/contributing/development/running_tests.rst:41:42: W291 [*] Trailing whitespace docs/contributing/development/running_tests.rst:64:112: W291 [*] Trailing whitespace docs/contributing/development/running_tests.rst:65:124: W291 [*] Trailing whitespace docs/contributing/development/running_tests.rst:69:92: W291 [*] Trailing whitespace docs/contributing/development/running_tests.rst:70:107: W291 [*] Trailing whitespace docs/contributing/development/running_tests.rst:80:62: W291 [*] Trailing whitespace docs/installation.rst:1:1: E999 SyntaxError: Expected a statement docs/installation.rst:9:1: W293 [*] Blank line contains whitespace docs/installation.rst:10:84: W291 [*] Trailing whitespace docs/installation.rst:11:109: W291 [*] Trailing whitespace docs/installation.rst:14:116: W291 [*] Trailing whitespace docs/installation.rst:15:133: W291 [*] Trailing whitespace docs/installation.rst:27:67: W291 [*] Trailing whitespace docs/installation.rst:59:1: W293 [*] Blank line contains whitespace docs/installation.rst:66:19: W291 [*] Trailing whitespace docs/installation.rst:69:1: W293 [*] Blank line contains whitespace docs/installation.rst:86:102: W291 [*] Trailing whitespace docs/io/output/how_to_rpacket_tracking.ipynb:cell 12:1:62: W291 [*] Trailing whitespace docs/resources/credits.rst:1:1: E999 SyntaxError: Expected a statement docs/resources/research_done_using_TARDIS/ads.ipynb:cell 2:1:1: I001 [*] Import block is un-sorted or un-formatted docs/resources/research_done_using_TARDIS/ads.ipynb:cell 4:5:15: UP032 [*] Use f-string instead of `format` call docs/resources/research_done_using_TARDIS/ads.ipynb:cell 4:12:31: UP032 [*] Use f-string instead of `format` call docs/resources/research_done_using_TARDIS/ads.ipynb:cell 6:2:5: D209 [*] Multi-line docstring closing quotes should be on a separate line docs/resources/research_done_using_TARDIS/ads.ipynb:cell 6:3:110: W291 Trailing whitespace docs/resources/research_done_using_TARDIS/ads.ipynb:cell 7:7:77: W605 [*] Invalid escape sequence: `\ ` docs/resources/research_done_using_TARDIS/ads.ipynb:cell 8:4:28: UP032 [*] Use f-string instead of `format` call docs/resources/research_done_using_TARDIS/ads.ipynb:cell 8:5:34: UP032 [*] Use f-string instead of `format` call docs/resources/research_done_using_TARDIS/ads.ipynb:cell 8:6:1: W293 Blank line contains whitespace docs/resources/research_done_using_TARDIS/ads.ipynb:cell 10:1:101: W291 [*] Trailing whitespace setup.py:7:1: I001 [*] Import block is un-sorted or un-formatted tardis/io/atom_data/base.py:171:22: C408 Unnecessary `dict` call (rewrite as a literal) tardis/io/atom_data/base.py:172:24: C408 Unnecessary `list` call (rewrite as a literal) tardis/io/atom_data/base.py:181:34: G004 Logging statement uses f-string tardis/io/atom_data/base.py:259:17: G004 Logging statement uses f-string tardis/io/atom_data/base.py:263:21: UP030 Use implicit references for positional format fields tardis/io/atom_data/base.py:263:21: G001 Logging statement uses `str.format` tardis/io/atom_data/collision_data.py:1:1: E902 No such file or directory (os error 2) tardis/io/atom_data/macro_atom_data.py:1:1: E902 No such file or directory (os error 2) tardis/simulation/tests/test_simulation.py:1:1: I001 [*] Import block is un-sorted or un-formatted tardis/simulation/tests/test_simulation.py:1:8: F401 [*] `os` imported but unused tardis/simulation/tests/test_simulation.py:6:8: F401 [*] `logging` imported but unused tardis/simulation/tests/test_simulation.py:10:20: F401 [*] `tardis.run_tardis` imported but unused tardis/simulation/tests/test_simulation.py:50:5: RET505 Unnecessary `else` after `return` statement tardis/visualization/tools/tests/test_sdec_plot.py:343:17: F631 Assert test is a non-empty tuple, which is always `True` tardis/visualization/tools/tests/test_sdec_plot.py:475:13: F631 Assert test is a non-empty tuple, which is always `True` tardis/visualization/tools/tests/test_sdec_plot.py:557:13: PLW0127 Self-assignment of variable `observed_spectrum` tardis/visualization/tools/tests/test_sdec_plot.py:618:13: F631 Assert test is a non-empty tuple, which is always `True` Found 165 errors. [*] 40 fixable with the `--fix` option (9 hidden fixes can be enabled with the `--unsafe-fixes` option). ```
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.68%. Comparing base (67c9cea) to head (81dffe9). Report is 13 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2795 +/- ## ========================================== - Coverage 69.91% 69.68% -0.23% ========================================== Files 206 208 +2 Lines 15523 15453 -70 ========================================== - Hits 10853 10769 -84 - Misses 4670 4684 +14 ```

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

Sumit112192 commented 1 month ago

Not much changed in the file, just some class renaming and added the new attributes.

tardis-bot commented 1 month ago

*beep* *bop*

Hi, human.

The docs workflow has succeeded :heavy_check_mark:

Click here to see your results.

tardis-bot commented 1 month ago

*beep* *bop* Hi human, I ran benchmarks as you asked comparing master (67c9cea39c79f101b278b9fa7117aa8c6cf6ab13) and the latest commit (81dffe9965a8cdd76efc7f25958fe3244118c188). 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 improved: | Change | Before [5fe6806d] | After [81dffe99] | Ratio | Benchmark (Parameter) | |----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------| | | failed | 511±100ns | n/a | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation | | | failed | 1.14±0.2μs | n/a | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation | | | failed | 581±100ns | n/a | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation | | | failed | 4.40±0.2ms | n/a | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom') | | | failed | 2.81±0ms | n/a | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter') | | | failed | 39.6±0s | n/a | run_tardis.BenchmarkRunTardis.time_run_tardis | | | failed | 1.06±0m | n/a | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking | | | failed | 2.07±0m | n/a | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions | | | failed | 206±0.2ns | n/a | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body | | | failed | 1.23±0μs | n/a | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary | | | failed | 1.55±0.4μs | n/a | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line | | | failed | 2.01±1μs | n/a | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators | | | failed | 39.6±20μs | n/a | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission | | | failed | 49.4±20μs | n/a | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter | | | failed | 734±0.6ns | n/a | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter | | | failed | 1.79±0.02ms | n/a | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop | | | failed | 23.8±6μs | n/a | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list | | | failed | 31.7±0.03μs | n/a | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list | | | failed | 63.2±0.5ms | n/a | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe | | | failed | 2.54±0.4ms | n/a | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop | | | failed | 2.98±0.4μs | n/a | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket | | | failed | 6.39±1μs | n/a | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket | | | failed | 7.93±2μs | n/a | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley | | | failed | 3.23±0.6μs | n/a | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell | ```

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

andrewfullard commented 1 month ago

Make sure you commit the notebook without outputs.

Sumit112192 commented 1 month ago

Make sure you commit the notebook without outputs.

done

andrewfullard commented 3 weeks ago

Do you know why the docs aren't building?

Sumit112192 commented 3 weeks ago

Do you know why the docs aren't building?

Due to the meta data of the notebook, right? It was discussed that this will be fixed in the workflows.