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

Ruff tardis/spectrum #2848

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Ruff tardis/spectrum #2848

merged 2 commits into from
Oct 21, 2024

Conversation

atharva-2001
Copy link
Member

📝 Description

Type: 🪲 bugfix | 🚀 feature | ☣️ breaking change | 🚦 testing | 📝 documentation | 🎢 infrastructure

Write a complete description of your changes, including the necessary context or any piece of information required to understand your work.

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.

@tardis-bot
Copy link
Contributor

tardis-bot commented Oct 8, 2024

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

4	RET505	Unnecessary `else` after `return` statement
1	RET506	Unnecessary `else` after `raise` statement
1	F811  	Redefinition of unused `opacity_state_initialize` from line 13

Complete output(might be large):

tardis/spectrum/formal_integral.py:23:5: F811 Redefinition of unused `opacity_state_initialize` from line 13
tardis/spectrum/formal_integral.py:340:13: RET506 Unnecessary `else` after `raise` statement
tardis/spectrum/formal_integral.py:681:5: RET505 Unnecessary `else` after `return` statement
tardis/spectrum/formal_integral.py:717:5: RET505 Unnecessary `else` after `return` statement
tardis/spectrum/formal_integral_cuda.py:375:5: RET505 Unnecessary `else` after `return` statement
tardis/spectrum/formal_integral_cuda.py:420:5: RET505 Unnecessary `else` after `return` statement
Found 6 errors.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.69%. Comparing base (81ec6e8) to head (774f7b2).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2848      +/-   ##
==========================================
- Coverage   71.08%   70.69%   -0.40%     
==========================================
  Files         213      213              
  Lines       15823    15817       -6     
==========================================
- Hits        11248    11182      -66     
- Misses       4575     4635      +60     

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

@andrewfullard
Copy link
Contributor

Benchmarks are failing, please investigate

@atharva-2001 atharva-2001 marked this pull request as draft October 14, 2024 14:50
@atharva-2001 atharva-2001 marked this pull request as ready for review October 16, 2024 12:05
@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (81ec6e8) and the latest commit (774f7b2).
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 [81ec6e8e] <master>   | After [774f7b2a]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 2.97±0.03ms                  | 3.45±0.03ms         | ~1.16   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 2.85±0.5μs                   | 2.56±0.5μs          | ~0.90   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 24.6±7μs                     | 21.7±5μs            | ~0.88   | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 601±200ns                    | 521±200ns           | ~0.87   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 2.27±1μs                     | 1.92±1μs            | ~0.85   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 58.0±10μs                    | 40.9±20μs           | ~0.71   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 2.73±0.4ms                   | 2.90±0.4ms          | 1.06    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 5.74±0.8μs                   | 6.10±0.9μs          | 1.06    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 715±0.2ns                    | 742±10ns            | 1.04    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 3.85±0.01ms                  | 3.99±0.02ms         | 1.03    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 41.4±20μs                    | 42.2±30μs           | 1.02    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 1.19±0μs                     | 1.21±0μs            | 1.01    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 531±100ns                    | 531±200ns           | 1.00    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 1.03±0m                      | 1.03±0m             | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 2.08±0m                      | 2.08±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 208±0.04ns                   | 208±0.08ns          | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 1.70±0ms                     | 1.69±0.02ms         | 1.00    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 65.0±0.2ms                   | 65.2±0.07ms         | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 37.8±0.04s                   | 37.4±0.1s           | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.50±6μs                     | 1.49±0.4μs          | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 31.7±0.04μs                  | 31.3±0.1μs          | 0.99    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 530±100ns                    | 511±200ns           | 0.96    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 7.36±2μs                     | 6.90±1μs            | 0.94    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 3.42±0.4μs                   | 3.20±0.4μ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

@DeerWhale DeerWhale merged commit 03d970d into tardis-sn:master Oct 21, 2024
20 of 21 checks passed
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.

5 participants