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

Migrate to Regression Data Completely #2808

Merged
merged 12 commits into from
Sep 11, 2024

Conversation

atharva-2001
Copy link
Member

@atharva-2001 atharva-2001 commented Aug 23, 2024

📝 Description

Type: ☣️ breaking change | 🚦 testing | 🎢 infrastructure

This PR aims to remove references of refdata from the tardis repo.
tardis-sn/tardis-regression-data#21 and tardis-sn/tardis-regression-data#22 will need to be merged before in order for tests to pass.

📌 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 Aug 23, 2024

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

23	E999  	[ ] SyntaxError: Expected an expression
6	UP015 	[*] Unnecessary open mode parameters
5	W291  	[*] Trailing whitespace
4	I001  	[*] Import block is un-sorted or un-formatted
4	F401  	[*] `astropy.constants` imported but unused
2	FLY002	[*] Consider `f"{hash_string}_{nlte_prop}"` instead of string join
1	B018  	[ ] Found useless expression. Either assign it to a variable or remove it.
1	G004  	[ ] Logging statement uses f-string
1	INP001	[ ] File `tardis/io/model/readers/tests/test_arepo_parser.py` is part of an implicit namespace package. Add an `__init__.py`.
1	W292  	[*] No newline at end of file
1	W605  	[*] Invalid escape sequence: `\g`
1	F403  	[ ] `from tardis.tests.fixtures.atom_data import *` used; unable to detect undefined names
1	F821  	[ ] Undefined name `pytest_report_header`
1	PGH004	[ ] Use specific rule codes when using `noqa`

Complete output(might be large):

.github/actions/setup_lfs/action.yml:5:8: E999 SyntaxError: Expected an expression
.github/workflows/archive/dispatcher.yml:2:4: E999 SyntaxError: Expected an expression
.github/workflows/build-docs.yml:7:4: E999 SyntaxError: Expected an expression
.github/workflows/pre-release.yml:7:4: E999 SyntaxError: Expected an expression
.github/workflows/tests.yml:7:4: E999 SyntaxError: Expected an expression
asv.conf.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it.
asv.conf.json:32:2: W292 [*] No newline at end of file
docs/io/configuration/components/models/data/config_init_trad.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
docs/io/configuration/components/models/data/config_no_init_trad.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
docs/resources/code_comparison/plasma_compare/tardis_example.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/conftest.py:12:1: F403 `from tardis.tests.fixtures.atom_data import *` used; unable to detect undefined names
tardis/conftest.py:30:49: PGH004 Use specific rule codes when using `noqa`
tardis/conftest.py:32:9: F821 Undefined name `pytest_report_header`
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 1:2:1: I001 [*] Import block is un-sorted or un-formatted
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 1:3:18: F401 [*] `pandas` imported but unused
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 1:6:29: F401 [*] `astropy.constants` imported but unused
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 1:7:25: F401 [*] `astropy.units` imported but unused
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 2:2:1: I001 [*] Import block is un-sorted or un-formatted
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 7:5:70: W291 [*] Trailing whitespace
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 9:3:96: W291 [*] Trailing whitespace
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 9:4:99: W291 [*] Trailing whitespace
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 9:6:78: W291 [*] Trailing whitespace
tardis/energy_input/docs/working_gamma_ray_test.ipynb:cell 10:2:65: W605 [*] Invalid escape sequence: `\g`
tardis/io/model/parse_atom_data.py:40:21: G004 Logging statement uses f-string
tardis/io/model/readers/tests/data/csvy_test_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/io/model/readers/tests/test_arepo_parser.py:1:1: INP001 File `tardis/io/model/readers/tests/test_arepo_parser.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/io/model/readers/tests/test_arepo_parser.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/io/model/readers/tests/test_arepo_parser.py:16:10: UP015 [*] Unnecessary open mode parameters
tardis/io/model/readers/tests/test_arepo_parser.py:48:10: UP015 [*] Unnecessary open mode parameters
tardis/io/model/readers/tests/test_arepo_parser.py:59:10: UP015 [*] Unnecessary open mode parameters
tardis/io/model/readers/tests/test_arepo_parser.py:89:10: UP015 [*] Unnecessary open mode parameters
tardis/io/model/readers/tests/test_arepo_parser.py:99:10: UP015 [*] Unnecessary open mode parameters
tardis/io/model/readers/tests/test_arepo_parser.py:109:10: UP015 [*] Unnecessary open mode parameters
tardis/model/tests/data/branch85_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/branch85_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/csvy_model_to_test_abundances.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/exponential_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/exponential_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/model_full_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/model_full_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/powerlaw_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/powerlaw_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/radiative_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/radiative_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/uniform_csvy.yml:1:69: W291 [*] Trailing whitespace
tardis/model/tests/data/uniform_csvy.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/model/tests/data/uniform_old_config.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/plasma/tests/data/config_init_trad.yml:2:26: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
tardis/plasma/tests/test_complete_plasmas.py:149:27: FLY002 Consider `f"{hash_string}_{prop}"` instead of string join
tardis/plasma/tests/test_complete_plasmas.py:154:39: FLY002 Consider `f"{hash_string}_{nlte_prop}"` instead of string join
tardis/tests/fixtures/atom_data.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/tests/fixtures/atom_data.py:2:21: F401 [*] `pathlib.Path` imported but unused
Found 52 errors.
[*] 21 fixable with the `--fix` option (2 hidden fixes can be enabled with the `--unsafe-fixes` option).

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tardis-bot
Copy link
Contributor

tardis-bot commented Aug 23, 2024

*beep* *bop*

Hi, human.

The docs workflow has failed

Click here to see the build log.

Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

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

I'm happy with this, I just want @wkerzendorf to sign off as well on the regression data PRs, then everything here should work as expected.

@andrewfullard
Copy link
Contributor

andrewfullard commented Sep 3, 2024

Can you fix the benchmarks? Docs as well.

@tardis-bot
Copy link
Contributor

tardis-bot commented Sep 4, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (260207c) and the latest commit (8b6fda3).
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 [260207cb] <master>   | After [8b6fda30]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 2.03±1μs                     | 2.50±1μs            | ~1.23   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 3.10±0.5μs                   | 3.80±0.6μs          | ~1.23   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 44.2±20μs                    | 51.8±30μs           | ~1.17   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 1.73±0.02ms                  | 1.95±0.01ms         | ~1.13   | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 491±200ns                    | 551±100ns           | ~1.12   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 1.58±0.3μs                   | 1.38±0.4μs          | ~0.87   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 3.46±0.01ms                  | 2.77±0.03ms         | ~0.80   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 11.0±3μs                     | 7.30±2μs            | ~0.66   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 6.50±0.8μs                   | 6.87±0.6μs          | 1.06    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 23.2±6μs                     | 23.9±6μs            | 1.03    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 2.77±0.4ms                   | 2.81±0.5ms          | 1.02    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 2.07±0m                      | 2.10±0.01m          | 1.01    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 204±0.2ns                    | 206±0.6ns           | 1.01    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 1.17±0μs                     | 1.18±0μs            | 1.01    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 63.2±0.2ms                   | 64.1±0.06ms         | 1.01    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 601±100ns                    | 601±100ns           | 1.00    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 30.6±0.01μs                  | 30.6±0.06μs         | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 3.26±0.5μs                   | 3.25±0.4μs          | 1.00    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 3.92±0.03ms                  | 3.79±0.02ms         | 0.97    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 561±100ns                    | 541±200ns           | 0.96    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 40.8±0.05s                   | 39.2±0.08s          | 0.96    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 1.09±0m                      | 1.05±0m             | 0.96    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 44.8±20μs                    | 42.1±20μs           | 0.94    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 742±0.5ns                    | 697±1ns             | 0.94    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |

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

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.79%. Comparing base (be4ec9a) to head (8b6fda3).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2808      +/-   ##
==========================================
- Coverage   70.96%   70.79%   -0.18%     
==========================================
  Files         209      209              
  Lines       15638    15637       -1     
==========================================
- Hits        11098    11070      -28     
- Misses       4540     4567      +27     

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

@andrewfullard
Copy link
Contributor

Do you know why docs are failing?

@atharva-2001
Copy link
Member Author

atharva-2001 commented Sep 6, 2024 via email

@atharva-2001
Copy link
Member Author

atharva-2001 commented Sep 6, 2024 via email

andrewfullard
andrewfullard previously approved these changes Sep 6, 2024
@wkerzendorf wkerzendorf merged commit 31d352a into tardis-sn:master Sep 11, 2024
16 of 18 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.

4 participants