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

Numpy v2 Upgrade PR 2 #2935

Merged
merged 9 commits into from
Feb 24, 2025
Merged

Conversation

atharva-2001
Copy link
Member

@atharva-2001 atharva-2001 commented Jan 10, 2025

📝 Description

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

Based on #2934
Tested on my own Reference Data- https://github.com/tardis-sn/tardis/actions/runs/12789863418?pr=2935

This is the new regression data- tardis-sn/tardis-regression-data#42

📌 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 Jan 10, 2025

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

7	W293 	[*] Blank line contains whitespace
6	W291 	[*] Trailing whitespace
5	E999 	[ ] SyntaxError: Expected an expression
3	G004 	[ ] Logging statement uses f-string
1	FA100	[ ] Add `from __future__ import annotations` to simplify `typing.Tuple`
1	G001 	[ ] Logging statement uses `str.format`

Complete output(might be large):

.github/actions/setup_lfs/action.yml:5:8: E999 SyntaxError: Expected an expression
.github/actions/setup_lfs/action.yml:37:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:1:12: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
.github/workflows/lfs-cache.yml:43:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:62:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:65:78: W291 [*] Trailing whitespace
.github/workflows/lfs-cache.yml:70:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:73:45: W291 [*] Trailing whitespace
.github/workflows/lfs-cache.yml:74:78: W291 [*] Trailing whitespace
.github/workflows/lfs-cache.yml:78:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:81:46: W291 [*] Trailing whitespace
.github/workflows/lfs-cache.yml:82:78: W291 [*] Trailing whitespace
.github/workflows/lfs-cache.yml:86:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:96:1: W293 [*] Blank line contains whitespace
conda-linux-64.lock:5:1: E999 SyntaxError: Expected class, function definition or async function definition after decorator
conda-lock.yml:14:10: E999 SyntaxError: Expected an expression
conda-osx-arm64.lock:5:1: E999 SyntaxError: Expected class, function definition or async function definition after decorator
tardis/io/atom_data/base.py:197:34: G004 Logging statement uses f-string
tardis/io/atom_data/base.py:259:17: G004 Logging statement uses f-string
tardis/io/atom_data/base.py:263:21: G001 Logging statement uses `str.format`
tardis/io/atom_data/base.py:705:17: G004 Logging statement uses f-string
tardis/io/model/readers/generic_readers.py:20:6: FA100 Add `from __future__ import annotations` to simplify `typing.Tuple`
tardis/io/model/readers/generic_readers.py:51:72: W291 [*] Trailing whitespace
Found 23 errors.
[*] 13 fixable with the `--fix` option.

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.17%. Comparing base (6e790c6) to head (12fe439).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2935      +/-   ##
==========================================
- Coverage   69.53%   69.17%   -0.37%     
==========================================
  Files         228      228              
  Lines       16429    16430       +1     
==========================================
- Hits        11424    11365      -59     
- Misses       5005     5065      +60     

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

@tardis-bot
Copy link
Contributor

tardis-bot commented Jan 15, 2025

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (6e790c6) and the latest commit (12fe439).
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 [6e790c66] <release-2025.02.23>   | After [12fe439e]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 66.4±40μs                                | 87.8±40μs           | ~1.32   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 2.09±0.05ms                              | 2.59±0.1ms          | ~1.24   | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 662±200ns                                | 572±200ns           | ~0.86   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 5.79±0.3ms                               | 4.99±0.2ms          | ~0.86   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 56.3±30μs                                | 42.8±30μs           | ~0.76   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 872±200ns                                | 591±100ns           | ~0.68   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 4.29±0.07ms                              | 2.83±0.08ms         | ~0.66   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 52.1±20μs                                | 25.5±6μs            | ~0.49   | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 39.9±0.3μs                               | 41.6±0.4μs          | 1.04    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 3.73±0.4μs                               | 3.81±0.4μs          | 1.02    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 719±0.3ns                                | 728±0.3ns           | 1.01    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 2.92±0.4ms                               | 2.94±0.5ms          | 1.01    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 206±0.1ns                                | 205±0.1ns           | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 66.4±0.1ms                               | 66.7±0.04ms         | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 8.70±2μs                                 | 8.68±2μs            | 1.00    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 41.9±0.1s                                | 41.4±0.03s          | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 2.18±0m                                  | 2.16±0m             | 0.99    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.22±0μs                                 | 1.21±0μs            | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 1.14±0m                                  | 1.11±0m             | 0.98    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 551±100ns                                | 531±100ns           | 0.96    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 7.00±0.8μs                               | 6.67±0.8μs          | 0.95    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 4.15±0.3μs                               | 3.95±1μs            | 0.95    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 1.64±0.5μs                               | 1.55±0.3μs          | 0.94    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 2.67±2μs                                 | 2.48±2μs            | 0.93    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |

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

@atharva-2001 atharva-2001 marked this pull request as ready for review January 27, 2025 14:13
@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
repository: atharva-2001/tardis-regression-data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert changes in this file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs doing

@andrewfullard
Copy link
Contributor

Please resolve the merge conflicts

andrewfullard
andrewfullard previously approved these changes Feb 24, 2025
DeerWhale
DeerWhale previously approved these changes Feb 24, 2025
@andrewfullard andrewfullard added the git-lfs-pull Allow git lfs pull in PRs label Feb 24, 2025
@atharva-2001 atharva-2001 dismissed stale reviews from DeerWhale and andrewfullard via 12fe439 February 24, 2025 15:37
@andrewfullard andrewfullard requested review from andrewfullard and removed request for andrewfullard February 24, 2025 15:56
@andrewfullard andrewfullard merged commit e0297c6 into tardis-sn:master Feb 24, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants