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/model #2828

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Ruff tardis/model #2828

merged 3 commits into from
Sep 25, 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 Sep 24, 2024

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

3	G004  	Logging statement uses f-string
1	INP001	File `tardis/model/geometry/tests/test_radial1d.py` is part of an implicit namespace package. Add an `__init__.py`.
1	PTH117	`os.path.isabs()` should be replaced by `Path.is_absolute()`
1	F401  	`tardis.model.base.SimulationState` imported but unused; consider removing, adding to `__all__`, or using a redundant alias

Complete output(might be large):

tardis/model/__init__.py:9:31: F401 `tardis.model.base.SimulationState` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/model/base.py:340:12: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()`
tardis/model/base.py:375:21: G004 Logging statement uses f-string
tardis/model/geometry/tests/test_radial1d.py:1:1: INP001 File `tardis/model/geometry/tests/test_radial1d.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/model/matter/decay.py:101:21: G004 Logging statement uses f-string
tardis/model/matter/decay.py:104:17: G004 Logging statement uses f-string
Found 6 errors.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.43%. Comparing base (71aad19) to head (e542691).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
tardis/model/matter/decay.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2828      +/-   ##
==========================================
+ Coverage   70.98%   71.43%   +0.44%     
==========================================
  Files         209      209              
  Lines       15654    16287     +633     
==========================================
+ Hits        11112    11634     +522     
- Misses       4542     4653     +111     

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

@andrewfullard andrewfullard marked this pull request as ready for review September 25, 2024 17:00
@andrewfullard andrewfullard merged commit 59c5d28 into tardis-sn:master Sep 25, 2024
27 of 29 checks passed
@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (71aad19) and the latest commit (e542691).
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 [59c5d280] <master>   | After [e5426914]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 561±100ns                    | 681±100ns           | ~1.21   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 3.23±0.5μs                   | 2.92±0.5μs          | ~0.91   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 1.53±0.4μs                   | 1.34±0.3μs          | ~0.88   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 2.16±1μs                     | 1.91±1μs            | ~0.88   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 631±200ns                    | 521±200ns           | ~0.83   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 20.0±5μs                     | 20.9±5μs            | 1.05    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 6.41±0.8μs                   | 6.72±1μs            | 1.05    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 561±200ns                    | 581±200ns           | 1.04    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 2.70±0.04ms                  | 2.79±0ms            | 1.03    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 3.27±0.6μs                   | 3.36±0.5μs          | 1.03    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 31.5±0.02μs                  | 32.2±0μs            | 1.02    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 2.08±0m                      | 2.09±0m             | 1.01    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.19±0μs                     | 1.19±0μs            | 1.00    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 41.3±20μs                    | 41.4±30μs           | 1.00    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 37.1±0.02s                   | 36.8±0.03s          | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.03±0m                      | 1.02±0m             | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 207±0.2ns                    | 206±0.05ns          | 0.99    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 2.61±0.5ms                   | 2.59±0.4ms          | 0.99    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 3.71±0.02ms                  | 3.65±0.02ms         | 0.98    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 743±0.3ns                    | 731±0.4ns           | 0.98    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 46.3±30μs                    | 44.8±30μs           | 0.97    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 64.5±0.2ms                   | 62.4±0.08ms         | 0.97    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 1.79±0.01ms                  | 1.69±0.01ms         | 0.94    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 7.50±2μs                     | 6.82±2μs            | 0.91    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |

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

CePowers pushed a commit to CePowers/tardis that referenced this pull request Oct 1, 2024
* ruff model auto safe fixes

* ruff model auto unsafe fixes

* black tardis/model/base.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants