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

Address pytest warnings #2745

Merged
merged 8 commits into from
Jul 29, 2024
Merged

Conversation

atharva-2001
Copy link
Member

📝 Description

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

Addresses pytest warnings.

📌 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 Jul 26, 2024

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

Copy link

codecov bot commented Jul 26, 2024

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 ⚠️
tardis/io/model/readers/blondin_toymodel.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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     

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

@atharva-2001 atharva-2001 added benchmarks run-generation-tests Run refdata generation tests on pull requests build-docs labels Jul 26, 2024
@atharva-2001 atharva-2001 marked this pull request as ready for review July 26, 2024 12:51
@tardis-bot
Copy link
Contributor

tardis-bot commented Jul 26, 2024

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

Significantly changed benchmarks:

All benchmarks:

All benchmarks:

| Change   | Before [17ee2872] <master>   | 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(<LineInteractionType.MACROATOM: 2>)                                                                                                                     |
|          | 7.81±0.04s                   | 7.72±0.01s          | 0.99    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter(<LineInteractionType.SCATTER: 0>)                                                                                                                       |
|          | 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
Copy link
Contributor

tardis-bot commented Jul 29, 2024

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

Complete output(might be large):

@atharva-2001 atharva-2001 marked this pull request as draft July 29, 2024 14:10
@atharva-2001 atharva-2001 marked this pull request as ready for review July 29, 2024 14:38
@andrewfullard andrewfullard merged commit 56a9dbc into tardis-sn:master Jul 29, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks build-docs run-generation-tests Run refdata generation tests on pull requests testing 🚦
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants