tardis-sn / tardis

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

Address pytest warnings #2745

Closed atharva-2001 closed 3 months ago

atharva-2001 commented 3 months ago

:pencil: Description

Type: :beetle: bugfix | :rocket: feature | :biohazard: breaking change | :vertical_traffic_light: testing | :memo: documentation | :roller_coaster: infrastructure

Addresses pytest warnings.

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

The docs workflow has succeeded :heavy_check_mark:

Click here to see your results.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 65.62500% with 11 lines in your changes missing coverage. Please review.

Project coverage is 69.83%. Comparing base (bcbe40d) to head (ea84805). Report is 9 commits behind head on master.

Files Patch % Lines
tardis/visualization/widgets/custom_abundance.py 18.18% 9 Missing :warning:
tardis/io/model/readers/blondin_toymodel.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2745 +/- ## ========================================== + Coverage 69.65% 69.83% +0.17% ========================================== Files 188 191 +3 Lines 14930 15022 +92 ========================================== + Hits 10400 10490 +90 - Misses 4530 4532 +2 ```

: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 (bcbe40d16cf75e7b13cbce2ce68bf876571c470e) and the latest commit (ea8480501a71c712515f674d39dc6aaf37717555). 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 [17ee2872] | After [ea848050] | Ratio | Benchmark (Parameter) | |----------|------------------------------|---------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | | 2.76±0.9μs | 2.78±0.9μs | 1.01 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 255.5) | | | 2.57±0.8μs | 2.44±0.8μs | 0.95 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 511.0) | | | 2.84±1μs | 2.80±0.9μs | 0.98 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000.0, 5110000000.0) | | | 3.65±1μs | 2.88±0.9μs | ~0.79 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 255.5) | | | 2.83±0.9μs | 2.48±0.8μs | ~0.88 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 511.0) | | | 2.78±0.9μs | 2.57±0.8μs | 0.93 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(100000000000.0, 5110000000.0) | | | 2.72±0.9μs | 3.14±1μs | ~1.15 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 255.5) | | | 2.83±1μs | 2.60±0.9μs | 0.92 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 511.0) | | | 2.56±0.8μs | 2.77±0.9μs | 1.08 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation(1000000000000000.0, 5110000000.0) | | | 3.03±1μs | 5.23±2μs | ~1.73 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.0}) | | | 2.91±0.9μs | 6.86±3μs | ~2.36 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.5}) | | | 2.71±0.8μs | 5.25±2μs | ~1.94 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 511.0, 'Iron_group_fraction': 0.5}) | | | 3.80±1μs | 4.01±2μs | 1.06 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 5110000000.0, 'Iron_group_fraction': 0.0}) | | | 2.70±0.8μs | 3.89±1μs | ~1.44 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation({'Ejecta_density': 100000.0, 'Energy': 255.5, 'Iron_group_fraction': 1.0}) | | | 3.65±0.8μs | 4.55±2μs | ~1.25 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.0}) | | | 2.98±1μs | 4.48±2μs | ~1.51 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 255.5, 'Iron_group_fraction': 0.5}) | | | 3.07±1μs | 4.19±2μs | ~1.36 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 511.0, 'Iron_group_fraction': 0.5}) | | | 3.01±0.9μs | 4.44±2μs | ~1.48 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 0.01, 'Energy': 5110000000.0, 'Iron_group_fraction': 0.0}) | | | 3.76±1μs | 5.60±2μs | ~1.49 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation({'Ejecta_density': 100000.0, 'Energy': 255.5, 'Iron_group_fraction': 1.0}) | | | 1.45±0.01s | 1.44±0.01s | 0.99 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom') | | | 1.47±0.01s | 1.47±0s | 1.00 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter') | | | 40.6±0.08s | 40.0±0.02s | 0.99 | run_tardis.BenchmarkRunTardis.time_run_tardis | | | 2.14±0m | 2.14±0m | 1.00 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions | | | 3.47±1μs | 4.38±2μs | ~1.26 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body({'nu': 100000000000000.0, 'temperature': 10000.0}) | | | 67.0±20μs | 61.6±20μs | 0.92 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary | | | 73.3±10μs | 73.7±10μs | 1.01 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line({'packet': {'nu_line': 0.1, 'is_last_line': True}, 'enable_full_relativity': True}) | | | 72.5±10μs | 71.5±10μs | 0.99 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line({'packet': {'nu_line': 0.2, 'is_last_line': False}, 'enable_full_relativity': True}) | | | 80.7±20μs | 89.7±20μs | ~1.11 | 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}) | | | 81.1±20μs | 85.2±20μs | 1.05 | 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}) | | | 83.2±20μs | 79.5±20μs | 0.96 | 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.84±0.04s | 7.65±0.02s | 0.98 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission({'mu': 0.8599443103322428, 'emission_line_id': 1000, 'energy': 0.9114437898710559}) | | | 7.80±0.01s | 7.68±0s | 0.98 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter() | | | 7.81±0.04s | 7.72±0.01s | 0.99 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter() | | | 3.63±0.03s | 3.57±0.04s | 0.99 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter | | | 4.34±0.02s | 4.46±0.01s | 1.03 | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop | | | 1.44±0s | 1.44±0s | 1.00 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe | | | 6.41±0.02s | 6.36±0.01s | 0.99 | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop | | | 5.11±0.07s | 4.99±0s | 0.98 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket | | | 4.97±0.04s | 4.88±0.01s | 0.98 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket | | | 5.02±0.02s | 4.92±0.01s | 0.98 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley({'tau_russian': 10.0, 'survival_possibility': 0.0}) | | | 4.98±0.01s | 4.93±0s | 0.99 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley({'tau_russian': 15.0, 'survival_possibility': 0.1}) | | | 3.72±0.03s | 3.58±0.01s | 0.96 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell | ```

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

tardis-bot commented 3 months ago

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

```diff ```

Complete output(might be large):

```diff ```