tardis-sn / tardis

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

Fix ruff comments issue #2762

Closed atharva-2001 closed 3 months ago

atharva-2001 commented 3 months ago

:pencil: Description

Type: :beetle: bugfix :vertical_traffic_light: testing | :roller_coaster: infrastructure Working output demonstration (see comment) https://github.com/atharva-2001/tardis/pull/49

Ruff only works on files which were edited- https://github.com/tardis-sn/tardis/actions/runs/10215044491/job/28263649725?pr=2762

:pushpin: Resources

Examples, notebooks, and links to useful references.

:vertical_traffic_light: Testing

How did you test these changes?

:ballot_box_with_check: Checklist

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

tardis-bot commented 3 months ago

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

```diff ```

Complete output(might be large):

```diff ```
codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 69.42%. Comparing base (c82dde5) to head (1536f79).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2762 +/- ## ========================================== - Coverage 69.98% 69.42% -0.56% ========================================== Files 196 196 Lines 15008 15008 ========================================== - Hits 10503 10419 -84 - Misses 4505 4589 +84 ```

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

tardis-bot commented 3 months ago

*beep* *bop* Hi human, I ran benchmarks as you asked comparing master (c82dde5fb55a81dafc67e8b182efb9084a0d58a3) and the latest commit (1536f790edf7bba2c714109e454e5912a27104db). Here are the logs produced by ASV. Results can also be downloaded as artifacts here.

Significantly changed benchmarks:

```diff ```

All benchmarks:

```diff All benchmarks: | Change | Before [c82dde5f] | After [1536f790] | Ratio | Benchmark (Parameter) | |----------|------------------------------|---------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | | 2.37±0.7μs | 3.52±1μs | ~1.49 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 255.5) | | | 2.50±0.8μs | 2.73±0.9μs | 1.09 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 511.0) | | | 2.40±0.8μs | 2.57±0.9μs | 1.07 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 5110000000.0) | | | 2.78±0.9μs | 2.53±0.8μs | 0.91 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 255.5) | | | 3.02±1μs | 2.68±0.9μs | ~0.89 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 511.0) | | | 2.51±0.8μs | 2.33±0.8μs | 0.93 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 5110000000.0) | | | 2.46±0.8μs | 2.59±0.9μs | 1.05 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 255.5) | | | 2.50±0.8μs | 2.62±0.9μs | 1.05 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 511.0) | | | 2.47±0.8μs | 3.03±1μs | ~1.22 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 5110000000.0) | | | 2.98±1μs | 4.47±2μs | ~1.50 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.0}) | | | 3.14±1μs | 4.18±2μs | ~1.33 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.5}) | | | 3.36±1μs | 4.30±2μs | ~1.28 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 511.0, 'Iron_group_fraction': 0.5}) | | | 3.32±1μs | 4.22±2μs | ~1.27 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 5110000000.0, 'Iron_group_fraction': 0.0}) | | | 2.97±1μs | 4.03±1μs | ~1.36 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 100000.0, 'Energy': 255.5, 'Iron_group_fraction': 1.0}) | | | 2.97±1μs | 4.21±2μs | ~1.42 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.0}) | | | 3.30±1μs | 4.34±2μs | ~1.32 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.5}) | | | 3.24±1μs | 4.29±2μs | ~1.32 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 511.0, 'Iron_group_fraction': 0.5}) | | | 3.22±1μs | 4.14±2μs | ~1.29 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 5110000000.0, 'Iron_group_fraction': 0.0}) | | | 3.34±1μs | 4.40±2μs | ~1.32 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 100000.0, 'Energy': 255.5, 'Iron_group_fraction': 1.0}) | | | 1.48±0.01s | 1.45±0.01s | 0.99 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom') | | | 1.48±0.01s | 1.50±0s | 1.01 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter') | | | 39.8±0.01s | 39.6±0.05s | 0.99 | run_tardis.BenchmarkRunTardis.time_run_tardis | | | 1.03±0m | 1.03±0m | 1.00 | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking | | | 2.13±0m | 2.13±0m | 1.00 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions | | | 3.47±1μs | 2.93±0.9μs | ~0.84 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body({'nu': 100000000000000.0, 'temperature': 10000.0}) | | | 66.5±20μs | 64.8±20μs | 0.97 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary | | | 71.3±10μs | 72.5±10μs | 1.02 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line({'packet': {'nu_line': 0.1, 'is_last_line': True}, 'enable_full_relativity': True}) | | | 72.3±10μs | 71.2±10μs | 0.98 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line({'packet': {'nu_line': 0.2, 'is_last_line': False}, 'enable_full_relativity': True}) | | | 86.6±20μs | 82.5±20μs | 0.95 | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators({'cur_line_id': 0, 'distance_trace': 0, 'time_explosion': 52000000.0, 'enable_full_relativity': True}) | | | 85.3±20μs | 88.6±20μs | 1.04 | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators({'cur_line_id': 0, 'distance_trace': 1000000000000.0, 'time_explosion': 52000000.0, 'enable_full_relativity': True}) | | | 85.0±20μs | 83.0±20μs | 0.98 | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators({'cur_line_id': 1, 'distance_trace': 100000.0, 'time_explosion': 10000000000.0, 'enable_full_relativity': False}) | | | 7.73±0.01s | 7.77±0.01s | 1.00 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission({'mu': 0.8599443103322428, 'emission_line_id': 1000, 'energy': 0.9114437898710559}) | | | 7.80±0.03s | 7.84±0.01s | 1.00 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter() | | | 7.84±0.01s | 7.75±0.02s | 0.99 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter() | | | 3.59±0.02s | 3.56±0.03s | 0.99 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter | | | 5.16±0.02s | 4.99±0.04s | 0.97 | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop | | | 20.7±6μs | 21.4±6μs | 1.03 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list(10) | | | 31.2±7μs | 40.5±10μs | ~1.30 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list(100) | | | 123±10μs | 137±20μs | ~1.11 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list(1000) | | | 26.2±9μs | 27.4±9μs | 1.05 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(1, 1) | | | 25.2±8μs | 31.0±10μs | ~1.23 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(1, 10) | | | 24.6±8μs | 27.7±10μs | ~1.12 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(1, 50) | | | 43.7±10μs | 36.0±10μs | ~0.82 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(10, 1) | | | 48.7±20μs | 40.7±10μs | ~0.83 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(10, 10) | | | 38.2±10μs | 36.5±10μs | 0.96 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(10, 50) | | | 76.1±20μs | 76.0±20μs | 1.00 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(50, 1) | | | 104±30μs | 72.2±10μs | ~0.70 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(50, 10) | | | 98.1±8μs | 79.6±10μs | ~0.81 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list(50, 50) | | | 1.45±0s | 1.44±0s | 0.99 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe | | | 6.38±0.01s | 6.33±0.02s | 0.99 | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop | | | 5.01±0.01s | 4.98±0.02s | 0.99 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket | | | 5.03±0.03s | 5.00±0.01s | 1.00 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket | | | 5.02±0.01s | 4.95±0.01s | 0.99 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley({'tau_russian': 10.0, 'survival_possibility': 0.0}) | | | 4.99±0.02s | 4.97±0.01s | 1.00 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley({'tau_russian': 15.0, 'survival_possibility': 0.1}) | | | 3.56±0.02s | 3.61±0.01s | 1.01 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell | ```

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