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 root files #2849

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Ruff root files #2849

merged 2 commits into from
Oct 21, 2024

Conversation

atharva-2001
Copy link
Member

📝 Description

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

Run ruff on root level files

📌 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 (9a3c268).
Here are the outputs produced.
Results can also be downloaded as artifacts here.
Summarised output:

3	F821   	[ ] Undefined name `atomic_dataset`
2	F401   	[ ] `tardis.base.run_tardis` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
1	ICN001 	[*] `matplotlib` should be imported as `mpl`
1	RET505 	[ ] Unnecessary `else` after `return` statement
1	PGH004 	[ ] Use specific rule codes when using `noqa`
1	PLW0127	[ ] Self-assignment of variable `atom_data`

Complete output(might be large):

tardis/__init__.py:6:31: PGH004 Use specific rule codes when using `noqa`
tardis/__init__.py:32:25: F401 `tardis.base.run_tardis` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/__init__.py:33:46: F401 `tardis.io.util.yaml_load_file` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/base.py:100:13: PLW0127 Self-assignment of variable `atom_data`
tardis/scripts/cmfgen2tardis.py:13:27: F821 Undefined name `atomic_dataset`
tardis/scripts/cmfgen2tardis.py:68:34: F821 Undefined name `atomic_dataset`
tardis/tests/integration_tests/conftest.py:43:13: F821 Undefined name `tardis_githash`
tardis/tests/integration_tests/conftest.py:88:5: RET505 Unnecessary `else` after `return` statement
tardis/tests/integration_tests/test_integration.py:3:8: ICN001 `matplotlib` should be imported as `mpl`
Found 9 errors.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.71%. Comparing base (81ec6e8) to head (9a3c268).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
tardis/scripts/cmfgen2tardis.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2849      +/-   ##
==========================================
- Coverage   71.08%   70.71%   -0.38%     
==========================================
  Files         213      213              
  Lines       15823    15819       -4     
==========================================
- Hits        11248    11186      -62     
- Misses       4575     4633      +58     

☔ 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:49
@atharva-2001 atharva-2001 marked this pull request as ready for review October 16, 2024 12:16
@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (81ec6e8) and the latest commit (9a3c268).
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 [9a3c2689]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 1.50±0.4μs                   | 2.03±0.4μs          | ~1.35   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 2.08±2μs                     | 2.51±1μs            | ~1.20   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 3.10±0.01ms                  | 3.48±0ms            | ~1.12   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 662±200ns                    | 590±100ns           | ~0.89   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 4.35±0.5μs                   | 3.50±0.5μs          | ~0.80   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 58.9±30μs                    | 44.5±30μs           | ~0.76   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 4.30±0.02ms                  | 4.67±0.01ms         | 1.09    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 3.04±0.4μs                   | 3.28±0.4μs          | 1.08    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 7.13±2μs                     | 7.58±2μs            | 1.06    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 727±0.5ns                    | 753±2ns             | 1.04    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 32.3±0.01μs                  | 33.7±0.3μs          | 1.04    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 561±100ns                    | 571±100ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 38.2±0.2s                    | 38.4±0.2s           | 1.01    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.04±0m                      | 1.05±0m             | 1.01    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 1.82±0.01ms                  | 1.84±0.02ms         | 1.01    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 2.10±0m                      | 2.10±0.01m          | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.22±0μs                     | 1.19±0μs            | 0.98    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 43.6±30μs                    | 41.9±20μs           | 0.96    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 67.1±0.03ms                  | 63.9±0.1ms          | 0.95    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 228±1ns                      | 215±0.1ns           | 0.94    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 652±100ns                    | 601±200ns           | 0.92    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 2.86±0.5ms                   | 2.62±0.4ms          | 0.92    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 6.58±0.8μs                   | 6.04±0.8μs          | 0.92    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 25.5±7μs                     | 23.2±6μs            | 0.91    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |

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

@jvshields jvshields merged commit 6ae9446 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